From e77ba1d7512b3d7f4c3cd12bb499e0e296c485ae Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 9 Jun 2009 13:36:36 +0200 Subject: fix gallery2 import with multisite config --- modules/g2_import/controllers/admin_g2_import.php | 18 +++++++++++++++--- modules/g2_import/helpers/g2_import.php | 15 ++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index f2969f49..968d97cd 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -44,13 +44,20 @@ class Admin_g2_import_Controller extends Admin_Controller { $form = $this->_get_import_form(); if ($form->validate()) { $embed_path = $form->configure_g2_import->embed_path->value; + $multi_path = $form->configure_g2_import->multi_path->value; + if (!is_file($embed_path) && file_exists("$embed_path/embed.php")) { $embed_path = "$embed_path/embed.php"; } + + if (!empty($multi_path) && !is_file($multi_path) && file_exists("$multi_path/config.php")) { + $multi_path = "$multi_path/embed.php"; + } - if (g2_import::is_valid_embed_path($embed_path)) { + if (g2_import::is_valid_embed_path($embed_path, $multi_path)) { message::success("Gallery 2 path saved."); module::set_var("g2_import", "embed_path", $embed_path); + module::set_var("g2_import", "multi_path", $multi_path); url::redirect("admin/g2_import"); } else { $form->configure_g2_import->embed_path->add_error("invalid", 1); @@ -67,11 +74,16 @@ class Admin_g2_import_Controller extends Admin_Controller { $form = new Forge( "admin/g2_import/save", "", "post", array("id" => "gAdminConfigureG2ImportForm")); $group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import")); - $group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file")) + $group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file (in case of multisite config, use the path to the 'master')")) ->value(module::get_var("g2_import", "embed_path", "")); + + $group->input("multi_path")->label(t("Filesystem path to your Gallery 2 multisite instance config (leave empty if not applicable)")) + ->value(module::get_var("g2_import", "multi_path", "")); + $group->embed_path->error_messages( "invalid", t("The path you entered is not a Gallery 2 installation.")); + $group->submit("")->value(t("Save")); return $form; } -} \ No newline at end of file +} diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 51dc8705..f68bd9c4 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -44,15 +44,15 @@ class g2_import_Core { g2_import::$init = g2_import::init_embed($embed_path); } - static function is_valid_embed_path($embed_path) { - return file_exists($embed_path) && g2_import::init_embed($embed_path); + static function is_valid_embed_path($embed_path, $multi_path) { + return file_exists($embed_path) && (empty($multi_path) || file_exists($multi_path)) && g2_import::init_embed($embed_path, $multi_path); } /** * Initialize the embedded Gallery2 instance. Call this before any other Gallery2 calls. */ - static function init_embed($embed_path) { - if (!is_file($embed_path)) { + static function init_embed($embed_path, $multi_path) { + if (!is_file($embed_path) || (!empty($multi_path) && !is_dir($multi_path)) { return false; } @@ -70,6 +70,11 @@ class g2_import_Core { mkdir($mod_path); $base_dir = dirname($embed_path); + if (!empty($multi_path)) + $config_dir = dirname($multi_path); + else + $config_dir = $base_dir + file_put_contents( "$mod_path/embed.php", str_replace( @@ -103,7 +108,7 @@ class g2_import_Core { "\$gallery =& new Gallery();"), array("require_once(dirname(__FILE__) . '/Gallery.class');", "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');", - "define('GALLERY_CONFIG_DIR', '$base_dir');", + "define('GALLERY_CONFIG_DIR', '$config_dir');", "\$gallery =& new G2_Gallery();"), array_merge(array("\n"), file("$base_dir/bootstrap.inc")))); -- cgit v1.2.3 From 657e17361db19ac1878b2a6d93595a763aef8b15 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 9 Jun 2009 16:16:18 +0200 Subject: fix previous commit --- modules/g2_import/helpers/g2_import.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index f68bd9c4..1ff63e36 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -37,11 +37,13 @@ class g2_import_Core { } $embed_path = module::get_var("g2_import", "embed_path"); + $multi_path = module::get_var("g2_import", "multi_path"); + if (empty($embed_path)) { throw new Exception("@todo G2_IMPORT_NOT_CONFIGURED"); } - g2_import::$init = g2_import::init_embed($embed_path); + g2_import::$init = g2_import::init_embed($embed_path, $multi_path); } static function is_valid_embed_path($embed_path, $multi_path) { @@ -52,7 +54,7 @@ class g2_import_Core { * Initialize the embedded Gallery2 instance. Call this before any other Gallery2 calls. */ static function init_embed($embed_path, $multi_path) { - if (!is_file($embed_path) || (!empty($multi_path) && !is_dir($multi_path)) { + if (!is_file($embed_path) || (!empty($multi_path) && !is_dir($multi_path))) { return false; } @@ -73,7 +75,7 @@ class g2_import_Core { if (!empty($multi_path)) $config_dir = dirname($multi_path); else - $config_dir = $base_dir + $config_dir = $base_dir; file_put_contents( "$mod_path/embed.php", -- cgit v1.2.3 From 315969e24e3ce4cbf06e5160e4738c083b2338be Mon Sep 17 00:00:00 2001 From: Marc Poulhiès Date: Wed, 10 Jun 2009 16:57:29 +0200 Subject: fix init_embed. test was not correct --- modules/g2_import/helpers/g2_import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 648f3809..01e07eba 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -54,7 +54,7 @@ class g2_import_Core { * Initialize the embedded Gallery2 instance. Call this before any other Gallery2 calls. */ static function init_embed($embed_path, $multi_path) { - if (!is_file($embed_path) || (!empty($multi_path) && !is_dir($multi_path))) { + if (!is_file($embed_path) && (empty($multi_path) || is_dir($multi_path))) { return false; } -- cgit v1.2.3 From c7770140ae2bfa325b7b079fc4975a5cd7927c4c Mon Sep 17 00:00:00 2001 From: unostar Date: Wed, 10 Jun 2009 14:12:40 -0700 Subject: adding string to localizer --- modules/gallery/helpers/gallery_block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index abc8a195..67900282 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -92,7 +92,7 @@ class gallery_block_Core { $form = new Forge("admin/dashboard/add_block", "", "post", array("id" => "gAddDashboardBlockForm")); $group = $form->group("add_block")->label(t("Add Block")); - $group->dropdown("id")->label("Available Blocks")->options(block_manager::get_available()); + $group->dropdown("id")->label(t("Available Blocks"))->options(block_manager::get_available()); $group->submit("center")->value(t("Add to center")); $group->submit("sidebar")->value(t("Add to sidebar")); return $form; -- cgit v1.2.3 From 49b3aa77f757119b404afcca7193cec25dca5b07 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Wed, 10 Jun 2009 11:33:16 +0800 Subject: Update floats after .rtl addition. Both should work now. Signed-off-by: --- themes/default/css/screen.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index f306f287..03c13cc1 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -92,11 +92,11 @@ a:hover, margin: .3em 1em; } -.rtl #gDialog .gCancel { +#gForgotPasswordLink, .rtl #gDialog .gCancel { float: right; } -.rtl #gForgotPasswordLink { +#gDialog .gCancel, .rtl #gForgotPasswordLink { float: left; } -- cgit v1.2.3 From 323b1e6077e82b757e20f30242bc1c53c6786090 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 11 Jun 2009 11:22:10 +0800 Subject: Improve our warning message to also mention that you need to have mod_rewrite installed. Signed-off-by: --- modules/gallery/views/permissions_browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php index 8bb2e830..36394877 100644 --- a/modules/gallery/views/permissions_browse.html.php +++ b/modules/gallery/views/permissions_browse.html.php @@ -27,7 +27,7 @@
  • - AllowOverride FileInfo Options to fix this.", array("attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride\" target=\"_blank\"")) ?> + mod_rewrite and set AllowOverride FileInfo Options to fix this.", array("mod_rewrite_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html\" target=\"_blank\"", "apache_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride\" target=\"_blank\"")) ?>
-- cgit v1.2.3 From 8d4567f4ccc90c954117cda1a34f9785dbd94b96 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 11 Jun 2009 11:37:38 +0800 Subject: Fix log links. html::anchor() implicitly calls url::site(), calling it a second time mangles the urls. Fixes ticket #360. Signed-off-by: --- modules/gallery/controllers/admin_maintenance.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php index c169de75..7c5934a3 100644 --- a/modules/gallery/controllers/admin_maintenance.php +++ b/modules/gallery/controllers/admin_maintenance.php @@ -61,7 +61,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { log::info("tasks", t("Task %task_name started (task id %task_id)", array("task_name" => $task->name, "task_id" => $task->id)), - html::anchor(url::site("admin/maintenance"), t("maintenance"))); + html::anchor("admin/maintenance", t("maintenance"))); print $view; } @@ -81,7 +81,7 @@ class Admin_Maintenance_Controller extends Admin_Controller { log::info("tasks", t("Task %task_name resumed (task id %task_id)", array("task_name" => $task->name, "task_id" => $task->id)), - html::anchor(url::site("admin/maintenance"), t("maintenance"))); + html::anchor("admin/maintenance", t("maintenance"))); print $view; } @@ -152,14 +152,14 @@ class Admin_Maintenance_Controller extends Admin_Controller { case "success": log::success("tasks", t("Task %task_name completed (task id %task_id)", array("task_name" => $task->name, "task_id" => $task->id)), - html::anchor(url::site("admin/maintenance"), t("maintenance"))); + html::anchor("admin/maintenance", t("maintenance"))); message::success(t("Task completed successfully")); break; case "error": log::error("tasks", t("Task %task_name failed (task id %task_id)", array("task_name" => $task->name, "task_id" => $task->id)), - html::anchor(url::site("admin/maintenance"), t("maintenance"))); + html::anchor("admin/maintenance", t("maintenance"))); message::success(t("Task failed")); break; } -- cgit v1.2.3 From 5f2dca7a51f246d03496f4cea0dcc795bbe2023a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 11 Jun 2009 12:05:24 +0800 Subject: Provide a way for non-admins to authenticate and use the upgrader, without using our regular code paths. Signed-off-by: --- modules/gallery/controllers/upgrader.php | 19 ++++++++++++++----- modules/gallery/views/upgrader.html.php | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index 0833e253..5eb96fdd 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -19,24 +19,33 @@ */ class Upgrader_Controller extends Controller { public function index() { - // Todo: give the admin a chance to log in here - if (!user::active()->admin) { - access::forbidden(); + $session = Session::instance(); + + // Make sure we have an upgrade token + if (!($upgrade_token = $session->get("upgrade_token", null))) { + $session->set("upgrade_token", $upgrade_token = md5(rand())); + } + + // If the upgrade token exists, then bless this session + if (file_exists(TMPPATH . $upgrade_token)) { + $session->set("can_upgrade", true); + @unlink(TMPPATH . $upgrade_token); } $view = new View("upgrader.html"); + $view->can_upgrade = user::active()->admin || $session->get("can_upgrade"); + $view->upgrade_token = $upgrade_token; $view->available = module::available(); $view->done = Input::instance()->get("done"); print $view; } public function upgrade() { - // Todo: give the admin a chance to log in here if (php_sapi_name() == "cli") { // @todo this may screw up some module installers, but we don't have a better answer at // this time. $_SERVER["HTTP_HOST"] = "example.com"; - } else if (!user::active()->admin) { + } else if (!user::active()->admin && !Session::instance()->get("can_upgrade", false)) { access::forbidden(); } diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 6b9a0110..fa21e196 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -9,6 +9,9 @@ font-family: Trebuchet MS; font-size: 1.1em; } + h1 { + font-size: 1.4em; + } div#outer { width: 650px; background: white; @@ -93,11 +96,17 @@ .gray_on_done { opacity: ; } + pre { + display: inline; + margin: 0px; + padding: 0px; + }
" />
+
@@ -158,6 +167,13 @@

+ +

+

+ gallery3/var/tmp directory.", array("name" => "
$upgrade_token")) ?> +

+ "> +
@@ -61,7 +61,7 @@ Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["resize"]["size"], "g3_pixels" => $resize_size, - "url" => url::site("admin/theme_details"))) ?> + "url" => url::site("admin/theme_options"))) ?>
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index 9729a868..fd4ec241 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -144,9 +144,9 @@ class gallery_menu_Core { ->label(t("Theme Choice")) ->url(url::site("admin/themes"))) ->append(Menu::factory("link") - ->id("theme_details") + ->id("theme_options") ->label(t("Theme Options")) - ->url(url::site("admin/theme_details")))) + ->url(url::site("admin/theme_options")))) ->append(Menu::factory("link") ->id("maintenance") ->label(t("Maintenance")) diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index af340db6..0a43f25c 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -40,7 +40,7 @@ class theme_Core { } static function get_edit_form_admin() { - $form = new Forge("admin/theme_details/save/", "", null, array("id" =>"gThemeDetailsForm")); + $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"gThemeOptionsForm")); $group = $form->group("edit_theme"); $group->input("page_size")->label(t("Items per page"))->id("gPageSize") ->rules("required|valid_digit") diff --git a/modules/gallery/views/admin_block_welcome.html.php b/modules/gallery/views/admin_block_welcome.html.php index a453b006..38d2bd56 100644 --- a/modules/gallery/views/admin_block_welcome.html.php +++ b/modules/gallery/views/admin_block_welcome.html.php @@ -9,9 +9,9 @@ "language_url" => url::site("admin/languages"))) ?>
  • - choose a theme, or customize the way it looks.", + choose a theme, or customize the way it looks.", array("theme_url" => url::site("admin/themes"), - "theme_details_url" => url::site("admin/theme_details"))) ?> + "theme_options_url" => url::site("admin/theme_options"))) ?>
  • install modules to add cool features!", diff --git a/modules/gallery/views/admin_theme_details.html.php b/modules/gallery/views/admin_theme_details.html.php deleted file mode 100644 index f093b70b..00000000 --- a/modules/gallery/views/admin_theme_details.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
    -

    - - -
    diff --git a/modules/gallery/views/admin_theme_options.html.php b/modules/gallery/views/admin_theme_options.html.php new file mode 100644 index 00000000..724e6438 --- /dev/null +++ b/modules/gallery/views/admin_theme_options.html.php @@ -0,0 +1,6 @@ + +
    +

    + + +
    -- cgit v1.2.3 From 62a19227b217d9dfafd6f19b4e910e9876c4811b Mon Sep 17 00:00:00 2001 From: unostar Date: Thu, 11 Jun 2009 17:18:51 -0700 Subject: Add string to localizer --- modules/gallery/views/permissions_form.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index adf2bd94..0f60070a 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -69,7 +69,7 @@ id == 1): ?> - <?= t('allowed icon') ?> + " alt="" /> -- cgit v1.2.3 From 9e348c51c1c61aacd53628b099ca6c344926835b Mon Sep 17 00:00:00 2001 From: unostar Date: Thu, 11 Jun 2009 17:38:54 -0700 Subject: Adding string to localizer --- modules/gallery/views/permissions_form.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index 0f60070a..ab0220f4 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -6,7 +6,7 @@ - name) ?> + name)) ?> -- cgit v1.2.3 From df538b6492914947d52284f3f7b00b7c5d6fffdf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Jun 2009 03:48:36 +0800 Subject: Trap exceptions from movie::create() and mark those movies as corrupt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Poulhiès --- modules/g2_import/helpers/g2_import.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 01e07eba..33cfc158 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -432,13 +432,19 @@ class g2_import_Core { case "GalleryMovieItem": // @todo we should transcode other types into FLV if (in_array($g2_item->getMimeType(), array("video/mp4", "video/x-flv"))) { - $item = movie::create( - $parent, - $g2_path, - $g2_item->getPathComponent(), - $g2_item->getTitle(), - self::extract_description($g2_item), - self::map($g2_item->getOwnerId())); + try { + $item = movie::create( + $parent, + $g2_path, + $g2_item->getPathComponent(), + $g2_item->getTitle(), + self::extract_description($g2_item), + self::map($g2_item->getOwnerId())); + } catch (Exception $e) { + Kohana::log("alert", "Corrupt movie $g2_path\n" . + $e->getMessage() . "\n" . $e->getTraceAsString()); + $corrupt = 1; + } } break; -- cgit v1.2.3 From 15adde714d667be984c2357cd0bf3fae5691ff5c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Jun 2009 03:50:24 +0800 Subject: add a missing 'break' after running tests which caused tests not to run. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Poulhiès --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index b2170fb1..50c08886 100644 --- a/index.php +++ b/index.php @@ -62,6 +62,7 @@ if (PHP_SAPI == "cli") { @mkdir("test/var/logs", 0777, true); define("VARPATH", realpath("test/var") . "/"); @copy("var/database.php", VARPATH . "database.php"); + break; default: print "Usage: php index.php { upgrade | package | test }\n"; -- cgit v1.2.3 From cf687fe15248b4d14f5fefc6eddd91f5dcafe3c2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Jun 2009 03:50:50 +0800 Subject: Rename theme_details to theme_options. These changes got left out of 68fd196d66e2d21f571ff3b5a673f18cd129abf9 leaving us in a temporarily broken state. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Poulhiès --- modules/g2_import/views/admin_g2_import.html.php | 4 ++-- modules/gallery/helpers/gallery_menu.php | 4 ++-- modules/gallery/helpers/theme.php | 2 +- modules/gallery/views/admin_block_welcome.html.php | 4 ++-- modules/gallery/views/admin_theme_details.html.php | 6 ------ modules/gallery/views/admin_theme_options.html.php | 6 ++++++ 6 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 modules/gallery/views/admin_theme_details.html.php create mode 100644 modules/gallery/views/admin_theme_options.html.php diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 85525a81..c0ee2b17 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -52,7 +52,7 @@ Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["thumb"]["size"], "g3_pixels" => $thumb_size, - "url" => url::site("admin/theme_details"))) ?> + "url" => url::site("admin/theme_options"))) ?>
  • @@ -61,7 +61,7 @@ Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["resize"]["size"], "g3_pixels" => $resize_size, - "url" => url::site("admin/theme_details"))) ?> + "url" => url::site("admin/theme_options"))) ?>
    diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index 9729a868..fd4ec241 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -144,9 +144,9 @@ class gallery_menu_Core { ->label(t("Theme Choice")) ->url(url::site("admin/themes"))) ->append(Menu::factory("link") - ->id("theme_details") + ->id("theme_options") ->label(t("Theme Options")) - ->url(url::site("admin/theme_details")))) + ->url(url::site("admin/theme_options")))) ->append(Menu::factory("link") ->id("maintenance") ->label(t("Maintenance")) diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index af340db6..0a43f25c 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -40,7 +40,7 @@ class theme_Core { } static function get_edit_form_admin() { - $form = new Forge("admin/theme_details/save/", "", null, array("id" =>"gThemeDetailsForm")); + $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"gThemeOptionsForm")); $group = $form->group("edit_theme"); $group->input("page_size")->label(t("Items per page"))->id("gPageSize") ->rules("required|valid_digit") diff --git a/modules/gallery/views/admin_block_welcome.html.php b/modules/gallery/views/admin_block_welcome.html.php index a453b006..38d2bd56 100644 --- a/modules/gallery/views/admin_block_welcome.html.php +++ b/modules/gallery/views/admin_block_welcome.html.php @@ -9,9 +9,9 @@ "language_url" => url::site("admin/languages"))) ?>
  • - choose a theme, or customize the way it looks.", + choose a theme, or customize the way it looks.", array("theme_url" => url::site("admin/themes"), - "theme_details_url" => url::site("admin/theme_details"))) ?> + "theme_options_url" => url::site("admin/theme_options"))) ?>
  • install modules to add cool features!", diff --git a/modules/gallery/views/admin_theme_details.html.php b/modules/gallery/views/admin_theme_details.html.php deleted file mode 100644 index f093b70b..00000000 --- a/modules/gallery/views/admin_theme_details.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
    -

    - - -
    diff --git a/modules/gallery/views/admin_theme_options.html.php b/modules/gallery/views/admin_theme_options.html.php new file mode 100644 index 00000000..724e6438 --- /dev/null +++ b/modules/gallery/views/admin_theme_options.html.php @@ -0,0 +1,6 @@ + +
    +

    + + +
    -- cgit v1.2.3 From 35e5a7d69b04bef171ed30b2f31aad32b83b19f0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Jun 2009 15:58:34 +0800 Subject: Add /usr/local/bin to PATH before trying to detect binaries. Signed-off-by: --- modules/gallery/helpers/graphics.php | 1 + modules/gallery/helpers/movie.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 25eb0891..feebfb34 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -326,6 +326,7 @@ class graphics_Core { if (!isset($gd["GD Version"])) { $gd["GD Version"] = false; } + putenv("PATH=" . getenv("PATH") . ":/usr/local/bin"); return array("gd" => $gd, "imagemagick" => $exec ? dirname(exec("which convert")) : false, "graphicsmagick" => $exec ? dirname(exec("which gm")) : false); diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 986d5f62..1d1d29d1 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -140,13 +140,11 @@ class movie_Core { static function find_ffmpeg() { if (!$ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) { + putenv("PATH=" . getenv("PATH") . ":/usr/local/bin"); if (function_exists("exec")) { $ffmpeg_path = exec("which ffmpeg"); } - if (empty($ffmpeg) && @file_exists("/usr/local/bin/ffmpeg")) { - $ffmpeg_path = "/usr/local/bin/ffmpeg"; - } module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); } return $ffmpeg_path; -- cgit v1.2.3 From f578906d33234fea363bb7b893ffe23ae8c81db3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 12 Jun 2009 17:13:12 +0800 Subject: Convert the filename to a sensible title to match the way that the simple uploader works. Signed-off-by: --- modules/server_add/helpers/server_add_task.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/server_add/helpers/server_add_task.php b/modules/server_add/helpers/server_add_task.php index 98575915..0482b47c 100644 --- a/modules/server_add/helpers/server_add_task.php +++ b/modules/server_add/helpers/server_add_task.php @@ -56,11 +56,12 @@ class server_add_task_Core { } else { $extension = strtolower(substr(strrchr($name, '.'), 1)); $source_path = "$path{$file['path']}/$name"; + $title = item::convert_filename_to_title($name); if (in_array($extension, array("flv", "mp4"))) { - $movie = movie::create($parent, $source_path, $name, $name, + $movie = movie::create($parent, $source_path, $name, $title, null, user::active()->id); } else { - $photo = photo::create($parent, $source_path, $name, $name, + $photo = photo::create($parent, $source_path, $name, $title, null, user::active()->id); } } -- cgit v1.2.3 From 4bd82c11670cf9c75ed9f9a1da31e0873a46ed9d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 11 Jun 2009 15:44:34 +0800 Subject: Changed rss_theme::sidebar_blocks to fire the event "request_feed_links" to allow modules to contribute rss feed links to the rss sidebar block. Ticket #388. Signed-off-by: --- modules/comment/helpers/comment_event.php | 6 ++++++ modules/gallery/helpers/gallery_event.php | 4 ++++ modules/rss/helpers/rss_theme.php | 13 ++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index a3beb27a..6370e27d 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -21,4 +21,10 @@ class comment_event_Core { static function item_before_delete($item) { Database::instance()->delete("comments", array("item_id" => $item->id)); } + + static function request_feed_links($event_data) { + $event_data->feeds[t("All new comments")] = url::site("rss/comments"); + $event_data->feeds[sprintf(t("Comments on %s"), $event_data->item->title)] = + url::site("rss/comments/{$event_data->item->id}"); + } } diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index aa11b7c0..b652d9a4 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -43,4 +43,8 @@ class gallery_event_Core { module::clear_var("gallery", "choose_default_tookit"); } } + + static function request_feed_links($event_data) { + $event_data->feeds[t("New photos or movies")] = url::site("rss/updates"); + } } diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index 54bba210..185d9d45 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -43,13 +43,12 @@ class rss_theme_Core { // @todo consider pushing the code for the feeds back to the associated modules // and create an event 'generate_rss_feeds' that modules can respond to create // the list of feeds. - $feeds = array(t("New photos or movies") => url::site("rss/updates")); - if (module::is_active("comment")) { - $feeds[t("All new comments")] = url::site("rss/comments"); - $feeds[sprintf(t("Comments on %s"), $theme->item()->title)] = - url::site("rss/comments/{$theme->item()->id}"); - } - $block->content->feeds = $feeds; + $event_data = new stdClass(); + $event_data->feeds = array(); + $event_data->item = $theme->item(); + + module::event("request_feed_links", $event_data); + $block->content->feeds = $event_data->feeds; return $block; } } -- cgit v1.2.3 From 1981c9bb09125d2d3471b60477ed5aaa2093f64f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 11 Jun 2009 15:48:32 +0800 Subject: Rearrange the code in sidebar_block to logically group the code for readability. Signed-off-by: --- modules/rss/helpers/rss_theme.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index 185d9d45..b433c66a 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -36,19 +36,17 @@ class rss_theme_Core { return; } - $block = new Block(); - $block->css_id = "gRss"; - $block->title = t("Available RSS Feeds"); - $block->content = new View("rss_block.html"); - // @todo consider pushing the code for the feeds back to the associated modules - // and create an event 'generate_rss_feeds' that modules can respond to create - // the list of feeds. $event_data = new stdClass(); $event_data->feeds = array(); $event_data->item = $theme->item(); - module::event("request_feed_links", $event_data); + + $block = new Block(); + $block->css_id = "gRss"; + $block->title = t("Available RSS Feeds"); + $block->content = new View("rss_block.html"); $block->content->feeds = $event_data->feeds; + return $block; } } -- cgit v1.2.3 From f15b4a5f35eed6fde3b675126341c68992a26c11 Mon Sep 17 00:00:00 2001 From: unostar Date: Fri, 12 Jun 2009 10:39:35 -0700 Subject: Multi-byte safe function to support all other languages. --- modules/tag/views/admin_tags.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index 62e3a2a1..21661c48 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -30,7 +30,7 @@ $tag): ?> - name, 0, 1)) ?> + name, 0, 1)) ?> -- cgit v1.2.3 From 0da812fdb0188d34a21b2b486c52699959909892 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 12 Jun 2009 21:58:53 +0800 Subject: Change the "request_feed_links" eventing handling so that individual modules provide the part of the url (the suffix) that they are interested in and the rss module will format the rest of the url. Signed-off-by: --- modules/comment/helpers/comment_event.php | 4 ++-- modules/gallery/helpers/gallery_event.php | 2 +- modules/rss/helpers/rss_theme.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index 6370e27d..fdf3a96f 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -23,8 +23,8 @@ class comment_event_Core { } static function request_feed_links($event_data) { - $event_data->feeds[t("All new comments")] = url::site("rss/comments"); + $event_data->feeds[t("All new comments")] = "comments"; $event_data->feeds[sprintf(t("Comments on %s"), $event_data->item->title)] = - url::site("rss/comments/{$event_data->item->id}"); + "comments/{$event_data->item->id}"; } } diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index b652d9a4..b1e9332d 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -45,6 +45,6 @@ class gallery_event_Core { } static function request_feed_links($event_data) { - $event_data->feeds[t("New photos or movies")] = url::site("rss/updates"); + $event_data->feeds[t("New photos or movies")] = url::site("updates"); } } diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index b433c66a..2e4e141b 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -40,7 +40,9 @@ class rss_theme_Core { $event_data->feeds = array(); $event_data->item = $theme->item(); module::event("request_feed_links", $event_data); - + foreach ($event_data->feeds as $key => $feed) { + $event_data->feeds[$key] = url::site("rss/$feed"); + } $block = new Block(); $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); -- cgit v1.2.3 From 94dc6baa4961a178ab68dc4cb0ce7a9bcba0ab26 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 12 Jun 2009 22:46:42 +0800 Subject: Change from an event driven model to a call driven model similiar to the task api. Signed-off-by: --- modules/comment/helpers/comment_event.php | 6 ------ modules/comment/helpers/comment_rss.php | 30 ++++++++++++++++++++++++++++++ modules/gallery/helpers/gallery_event.php | 4 ---- modules/gallery/helpers/gallery_rss.php | 27 +++++++++++++++++++++++++++ modules/rss/helpers/rss.php | 21 +++++++++++++++++++++ modules/rss/helpers/rss_theme.php | 9 +-------- 6 files changed, 79 insertions(+), 18 deletions(-) create mode 100644 modules/comment/helpers/comment_rss.php create mode 100644 modules/gallery/helpers/gallery_rss.php diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index fdf3a96f..a3beb27a 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -21,10 +21,4 @@ class comment_event_Core { static function item_before_delete($item) { Database::instance()->delete("comments", array("item_id" => $item->id)); } - - static function request_feed_links($event_data) { - $event_data->feeds[t("All new comments")] = "comments"; - $event_data->feeds[sprintf(t("Comments on %s"), $event_data->item->title)] = - "comments/{$event_data->item->id}"; - } } diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php new file mode 100644 index 00000000..9ae28726 --- /dev/null +++ b/modules/comment/helpers/comment_rss.php @@ -0,0 +1,30 @@ + t("All new comments"), + "sidebar" => true, + "uri" => "comments"), + array("description" => sprintf(t("Comments on %s"), $item->title), + "sidebar" => true, + "uri" => "comments/{$item->id}")); + } +} \ No newline at end of file diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index b1e9332d..aa11b7c0 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -43,8 +43,4 @@ class gallery_event_Core { module::clear_var("gallery", "choose_default_tookit"); } } - - static function request_feed_links($event_data) { - $event_data->feeds[t("New photos or movies")] = url::site("updates"); - } } diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php new file mode 100644 index 00000000..0b87b1b1 --- /dev/null +++ b/modules/gallery/helpers/gallery_rss.php @@ -0,0 +1,27 @@ + t("New photos or movies"), + "sidebar" => true, + "uri" => "updates")); + } +} diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index b320aeae..b0e7b30f 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -27,4 +27,25 @@ class rss_Core { static function tag_feed($tag) { return url::site("rss/tags/$tag->id}"); } + + /** + * Get all available rss feeds + */ + static function get_feeds($item, $sidebar_only=true) { + $feeds = array(); + foreach (module::active() as $module) { + $class_name = "{$module->name}_rss"; + if (method_exists($class_name, "available_feeds")) { + foreach (call_user_func(array($class_name, "available_feeds"), $item) as $feed) { + if ($sidebar_only && !$feed["sidebar"]) { + continue; + } + $feeds[$feed["description"]] = url::site("rss/{$feed['uri']}"); + } + } + } + + return $feeds; + } + } \ No newline at end of file diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index 2e4e141b..b82133bd 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -36,18 +36,11 @@ class rss_theme_Core { return; } - $event_data = new stdClass(); - $event_data->feeds = array(); - $event_data->item = $theme->item(); - module::event("request_feed_links", $event_data); - foreach ($event_data->feeds as $key => $feed) { - $event_data->feeds[$key] = url::site("rss/$feed"); - } $block = new Block(); $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); $block->content = new View("rss_block.html"); - $block->content->feeds = $event_data->feeds; + $block->content->feeds = rss::get_feeds($theme->item()); return $block; } -- cgit v1.2.3 From fd3a81f1ee9b1621f5be62ac4e7f595f7aa83fc0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 12 Jun 2009 23:52:03 +0800 Subject: Move the processing of rss feeds from the rss controller to callbacks in the modules that are supplying the feed. The rss controller becomes a router. In this change the comment and updates fields are distributed. Signed-off-by: --- modules/comment/helpers/comment_rss.php | 35 ++++++++++++ modules/comment/views/comment.mrss.php | 43 +++++++++++++++ modules/gallery/helpers/gallery_rss.php | 15 ++++++ modules/rss/controllers/rss.php | 95 ++++++--------------------------- modules/rss/helpers/rss.php | 8 +++ modules/rss/views/comment.mrss.php | 43 --------------- 6 files changed, 117 insertions(+), 122 deletions(-) create mode 100644 modules/comment/views/comment.mrss.php delete mode 100644 modules/rss/views/comment.mrss.php diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 9ae28726..b191c326 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -27,4 +27,39 @@ class comment_rss_Core { "sidebar" => true, "uri" => "comments/{$item->id}")); } + + static function comments($offset, $limit, $id) { + $feed = new stdClass(); + $orm = ORM::factory("comment") + ->where("state", "published") + ->orderby("created", "DESC"); + if (!empty($id)) { + $orm->where("item_id", $id); + } + + $feed->view = "comment.mrss"; + $comments = $orm->find_all($limit, $offset); + $feed->data["children"] = array(); + foreach ($comments as $comment) { + $item = $comment->item(); + $feed->data["children"][] = array( + "pub_date" => date("D, d M Y H:i:s T", $comment->created), + "text" => htmlspecialchars($comment->text), + "thumb_url" => $item->thumb_url(), + "thumb_height" => $item->thumb_height, + "thumb_width" => $item->thumb_width, + "item_link" => htmlspecialchars(url::abs_site("{$item->type}s/$item->id")), + "title" =>htmlspecialchars($item->title), + "author" => + empty($comment->guest_name) ? $comment->author()->full_name : $comment->guest_name + ); + } + + $feed->max_pages = ceil($comments->count() / $limit); + $feed->data["title"] = htmlspecialchars(t("Recent Comments")); + $feed->data["link"] = url::abs_site("albums/" . (empty($id) ? "1" : $id)); + $feed->data["description"] = t("Recent Comments"); + + return $feed; + } } \ No newline at end of file diff --git a/modules/comment/views/comment.mrss.php b/modules/comment/views/comment.mrss.php new file mode 100644 index 00000000..d2177026 --- /dev/null +++ b/modules/comment/views/comment.mrss.php @@ -0,0 +1,43 @@ + +" ?> + + + gallery3 + <?= p::clean($title) ?> + + + en-us + + + + + + + + diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 0b87b1b1..98798346 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -24,4 +24,19 @@ class gallery_rss_Core { "sidebar" => true, "uri" => "updates")); } + + static function updates($offset, $limit) { + $feed = new stdClass(); + $feed->data["children"] = ORM::factory("item") + ->viewable() + ->where("type !=", "album") + ->orderby("created", "DESC") + ->find_all($limit, $offset); + $feed->max_pages = ceil($feed->data["children"]->count() / $limit); + $feed->data["title"] = t("Recent Updates"); + $feed->data["link"] = url::abs_site("albums/1"); + $feed->data["description"] = t("Recent Updates"); + + return $feed; + } } diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index 1f8b8a4e..7e5b6193 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -62,47 +62,6 @@ class Rss_Controller extends Controller { print $view; } - public function updates() { - $page = $this->input->get("page", 1); - if ($page < 1) { - url::redirect("rss/updates"); - } - - $items = ORM::factory("item") - ->viewable() - ->where("type !=", "album") - ->orderby("created", "DESC") - ->find_all(self::$page_size, ($page - 1) * self::$page_size); - $max_pages = ceil($items->count() / self::$page_size); - - if ($max_pages && $page > $max_pages) { - url::redirect("rss/updates?page=$max_pages"); - } - - $view = new View("feed.mrss"); - $view->title = t("Recent Updates"); - $view->link = url::abs_site("albums/1"); - $view->description = t("Recent Updates"); - $view->feed_link = url::abs_site("rss/updates"); - $view->children = $items; - - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("rss/updates?page={$previous_page}"); - } - - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("rss/updates?page={$next_page}"); - } - - // @todo do we want to add an upload date to the items table? - $view->pub_date = date("D, d M Y H:i:s T"); - - rest::http_content_type(rest::RSS); - print $view; - } - public function tags($id) { $tag = ORM::factory("tag", $id); if (!$tag->loaded) { @@ -145,59 +104,37 @@ class Rss_Controller extends Controller { print $view; } - public function comments($id=null) { + public function __call($method, $arguments) { + $id = empty($arguments) ? null : $arguments[0]; $page = $this->input->get("page", 1); + $feed_uri = "rss/$method" . (empty($id) ? "" : "/$id"); if ($page < 1) { - url::redirect("rss/comments/$id"); + url::redirect($feed_uri); } - $orm = ORM::factory("comment") - ->where("state", "published") - ->orderby("created", "DESC"); - if (!empty($id)) { - $orm->where("item_id", $id); + $feed = rss::process_feed($method, ($page - 1) * self::$page_size, self::$page_size, $id); + if ($feed->max_pages && $page > $feed->max_pages) { + url::redirect("$feed_uri?page={$feed->max_pages}"); } - $comments = $orm->find_all(self::$page_size, ($page - 1) * self::$page_size); - $max_pages = ceil($orm->count_last_query() / self::$page_size); - - if ($max_pages && $page > $max_pages) { - url::redirect("rss/comments/{$item->id}?page=$max_pages"); - } - - $view = new View("comment.mrss"); - $view->title = htmlspecialchars(t("Recent Comments")); - $view->link = url::abs_site("albums/1"); - $view->description = t("Recent Comments"); - $view->feed_link = url::abs_site("rss/comments"); - $view->pub_date = date("D, d M Y H:i:s T"); - - $view->children = array(); - foreach ($comments as $comment) { - $item = $comment->item(); - $view->children[] = array( - "pub_date" => date("D, d M Y H:i:s T", $comment->created), - "text" => htmlspecialchars($comment->text), - "thumb_url" => $item->thumb_url(), - "thumb_height" => $item->thumb_height, - "thumb_width" => $item->thumb_width, - "item_link" => htmlspecialchars(url::abs_site("{$item->type}s/$item->id")), - "title" =>htmlspecialchars($item->title), - "author" => - empty($comment->guest_name) ? $comment->author()->full_name : $comment->guest_name - ); + $view = new View(empty($feed->view) ? "feed.mrss" : $feed->view); + foreach ($feed->data as $field => $value) { + $view->$field = $value; } + $view->feed_link = url::abs_site($feed_uri); if ($page > 1) { $previous_page = $page - 1; - $view->previous_page_link = url::site("rss/comments/{$item->id}?page={$previous_page}"); + $view->previous_page_link = url::site("$feed_uri?page={$previous_page}"); } - if ($page < $max_pages) { + if ($page < $feed->max_pages) { $next_page = $page + 1; - $view->next_page_link = url::site("rss/comments/{$item->id}?page={$next_page}"); + $view->next_page_link = url::site("$feed_uri?page={$next_page}"); } + $view->pub_date = date("D, d M Y H:i:s T"); + rest::http_content_type(rest::RSS); print $view; } diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index b0e7b30f..1d30425f 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -48,4 +48,12 @@ class rss_Core { return $feeds; } + static function process_feed($feed, $offset, $limit, $id) { + foreach (module::active() as $module) { + $class_name = "{$module->name}_rss"; + if (method_exists($class_name, $feed)) { + return call_user_func(array($class_name, $feed), $offset, $limit, $id); + } + } + } } \ No newline at end of file diff --git a/modules/rss/views/comment.mrss.php b/modules/rss/views/comment.mrss.php deleted file mode 100644 index d2177026..00000000 --- a/modules/rss/views/comment.mrss.php +++ /dev/null @@ -1,43 +0,0 @@ - -" ?> - - - gallery3 - <?= p::clean($title) ?> - - - en-us - - - - - - - - -- cgit v1.2.3 From 5f3d33b58ebbf5794eb9f432257e3eff9aaacf82 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 13 Jun 2009 02:48:13 +0800 Subject: Continue refactoring the rss module and distribute the creation of album and tag feeds to the gallery and tag modules respectively. This chould close ticket #388 Signed-off-by: --- modules/gallery/helpers/gallery_rss.php | 21 ++++++++- modules/rss/controllers/rss.php | 84 --------------------------------- modules/tag/helpers/tag_rss.php | 43 +++++++++++++++++ 3 files changed, 63 insertions(+), 85 deletions(-) create mode 100644 modules/tag/helpers/tag_rss.php diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 98798346..6e722ff6 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -22,7 +22,10 @@ class gallery_rss_Core { static function available_feeds($item) { return array(array("description" => t("New photos or movies"), "sidebar" => true, - "uri" => "updates")); + "uri" => "updates"), + array("description" => t("Album feed"), + "sidebar" => false, + "uri" => "albums")); } static function updates($offset, $limit) { @@ -39,4 +42,20 @@ class gallery_rss_Core { return $feed; } + + static function albums($offset, $limit, $id) { + $item = ORM::factory("item", $id); + access::required("view", $item); + + $feed = new stdClass(); + $feed->data["children"] = $item + ->viewable() + ->descendants($limit, $offset, "photo"); + $feed->max_pages = ceil($item->viewable()->descendants_count("photo") / $limit); + $feed->data["title"] = $item->title; + $feed->data["link"] = url::abs_site("albums/{$item->id}"); + $feed->data["description"] = $item->description; + + return $feed; + } } diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index 7e5b6193..164803cb 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -20,90 +20,6 @@ class Rss_Controller extends Controller { public static $page_size = 30; - public function albums($id) { - $item = ORM::factory("item", $id); - access::required("view", $item); - - $page = $this->input->get("page", 1); - if ($page < 1) { - url::redirect("rss/albums/{$item->id}"); - } - - $children = $item - ->viewable() - ->descendants(self::$page_size, ($page - 1) * self::$page_size, "photo"); - $max_pages = ceil($item->viewable()->descendants_count("photo") / self::$page_size); - - if ($max_pages && $page > $max_pages) { - url::redirect("rss/albums/{$item->id}?page=$max_pages"); - } - - $view = new View("feed.mrss"); - $view->title = $item->title; - $view->link = url::abs_site("albums/{$item->id}"); - $view->description = $item->description; - $view->feed_link = url::abs_site("rss/albums/{$item->id}"); - $view->children = $children; - - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("rss/albums/{$item->id}?page={$previous_page}"); - } - - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("rss/albums/{$item->id}?page={$next_page}"); - } - - // @todo do we want to add an upload date to the items table? - $view->pub_date = date("D, d M Y H:i:s T"); - - rest::http_content_type(rest::RSS); - print $view; - } - - public function tags($id) { - $tag = ORM::factory("tag", $id); - if (!$tag->loaded) { - return Kohana::show_404(); - } - - $page = $this->input->get("page", 1); - if ($page < 1) { - url::redirect("rss/tags/{$tag->id}"); - } - - $children = $tag->items(self::$page_size, ($page - 1) * self::$page_size, "photo"); - $max_pages = ceil($tag->count / self::$page_size); - - if ($max_pages && $page > $max_pages) { - url::redirect("rss/tags/{$tag->id}?page=$max_pages"); - } - - $view = new View("feed.mrss"); - $view->title = $tag->name; - $view->link = url::abs_site("tags/{$tag->id}"); - $view->description = t("Photos related to %tag_name", array("tag_name" => $tag->name)); - $view->feed_link = url::abs_site("rss/tags/{$tag->id}"); - $view->children = $children; - - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("rss/tags/{$tag->id}?page={$previous_page}"); - } - - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("rss/tags/{$tag->id}?page={$next_page}"); - } - - // @todo do we want to add an upload date to the items table? - $view->pub_date = date("D, d M Y H:i:s T"); - - rest::http_content_type(rest::RSS); - print $view; - } - public function __call($method, $arguments) { $id = empty($arguments) ? null : $arguments[0]; $page = $this->input->get("page", 1); diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php new file mode 100644 index 00000000..ace7fd6a --- /dev/null +++ b/modules/tag/helpers/tag_rss.php @@ -0,0 +1,43 @@ + t("Tag Album feed"), + "sidebar" => false, + "uri" => "tags")); + } + + static function tags($offset, $limit, $id) { + $tag = ORM::factory("tag", $id); + if (!$tag->loaded) { + return Kohana::show_404(); + } + + $feed = new stdClass(); + $feed->data["children"] = $tag->items($limit, $offset, "photo"); + $feed->max_pages = ceil($tag->count / $limit); + $feed->data["title"] = $tag->name; + $feed->data["link"] = url::abs_site("tags/{$tag->id}"); + $feed->data["description"] = t("Photos related to %tag_name", array("tag_name" => $tag->name)); + + return $feed; + } +} -- cgit v1.2.3 From 8645473df0f2e171458fe72021ad0ccc7036aad6 Mon Sep 17 00:00:00 2001 From: unostar Date: Sat, 13 Jun 2009 05:06:37 -0700 Subject: Corrected my mistake. --- modules/gallery/views/permissions_form.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index ab0220f4..0f60070a 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -6,7 +6,7 @@ - name)) ?> + name) ?> -- cgit v1.2.3 From 96b533f1b2fe4e01d7dd7e98631833c2e3c13a71 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Jun 2009 12:42:01 +0800 Subject: Don't count the root as an album in the stats block. It'll just confuse our users. Fixes ticket #369 Signed-off-by: --- modules/gallery/helpers/gallery_block.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 67900282..c3837f54 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -56,7 +56,8 @@ class gallery_block_Core { $block->css_id = "gStats"; $block->title = t("Gallery Stats"); $block->content = new View("admin_block_stats.html"); - $block->content->album_count = ORM::factory("item")->where("type", "album")->count_all(); + $block->content->album_count = + ORM::factory("item")->where("type", "album")->where("id <>", 1)->count_all(); $block->content->photo_count = ORM::factory("item")->where("type", "photo")->count_all(); break; -- cgit v1.2.3 From 3d89951c778265fb010d4bd20f93ced3ff7502d8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Jun 2009 13:44:51 +0800 Subject: Create gallery::date_time(), gallery::date() and gallery::time() functions that format a unix timestamp into a date+time/date/time string. Partial fix for ticket #347. Signed-off-by: --- .../views/admin_block_recent_comments.html.php | 2 +- modules/comment/views/admin_comments.html.php | 4 ++-- modules/comment/views/comment.html.php | 5 ++-- modules/gallery/helpers/gallery.php | 27 ++++++++++++++++++++++ .../gallery/views/admin_block_log_entries.html.php | 2 +- modules/gallery/views/admin_maintenance.html.php | 4 ++-- modules/info/views/info_block.html.php | 2 +- modules/user/views/admin_users.html.php | 2 +- 8 files changed, 38 insertions(+), 10 deletions(-) diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index d5aab84c..8b9634c5 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -7,7 +7,7 @@ alt="author_name()) ?>" width="32" height="32" /> - created) ?> + created) ?> %author_name said %comment_text", array("author_name" => p::clean($comment->author_name()), "comment_text" => text::limit_words(p::clean($comment->text), 50))); ?> diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 79bdb1f3..e749fde0 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -117,7 +117,7 @@ -

    created); ?>

    +

    created) ?>

    text) ?> diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php index 0337173b..ce52951b 100644 --- a/modules/comment/views/comment.html.php +++ b/modules/comment/views/comment.html.php @@ -8,8 +8,9 @@ width="40" height="40" /> - created) ?> - author_name()) ?> + gallery::date_time($comment->created), + "author_name" => p::clean($comment->author_name()))) ?>

    text) ?> diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 1686571c..e201fded 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -49,4 +49,31 @@ class gallery_Core { static function shutdown() { module::event("gallery_shutdown"); } + + /** + * Return a unix timestamp in a user specified format including date and time. + * @param $timestamp unix timestamp + * @return string + */ + static function date_time($timestamp) { + return date("Y-M-d H:i:s", $timestamp); + } + + /** + * Return a unix timestamp in a user specified format that's just the date. + * @param $timestamp unix timestamp + * @return string + */ + static function date($timestamp) { + return date("Y-M-d", $timestamp); + } + + /** + * Return a unix timestamp in a user specified format that's just the time. + * @param $timestamp unix timestamp + * @return string + */ + static function time($timestamp) { + return date("H:i:s", $timestamp); + } } \ No newline at end of file diff --git a/modules/gallery/views/admin_block_log_entries.html.php b/modules/gallery/views/admin_block_log_entries.html.php index 38070fe1..44c1657f 100644 --- a/modules/gallery/views/admin_block_log_entries.html.php +++ b/modules/gallery/views/admin_block_log_entries.html.php @@ -3,7 +3,7 @@
  • user_id") ?>">user->name) ?> - timestamp) ?> + timestamp) ?> message ?> html ?>
  • diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 66c4eea0..c47f77f8 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -69,7 +69,7 @@ "> - updated) ?> + updated) ?> name ?> @@ -139,7 +139,7 @@ "> - updated) ?> + updated) ?> name ?> diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index f8e5f35e..9f9ec5df 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -31,7 +31,7 @@ captured): ?> - captured)?> + captured) ?> owner): ?> diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index a99c9506..68486e6d 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -80,7 +80,7 @@ email) ?> - last_login == 0) ? "" : date("j-M-y", $user->last_login) ?> + last_login == 0) ? "" : gallery::date($user->last_login) ?> id") ?>" -- cgit v1.2.3 From 2afa437aa969d0fb0c238a694a8ea855b3e48978 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Jun 2009 14:04:34 +0800 Subject: Add a closing to the warning. Signed-off-by: --- modules/gallery/views/admin_advanced_settings.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php index b4dedaef..b37c1c73 100644 --- a/modules/gallery/views/admin_advanced_settings.html.php +++ b/modules/gallery/views/admin_advanced_settings.html.php @@ -6,7 +6,7 @@

    • - +
    -- cgit v1.2.3 From db321863a6d4448360521d0a3db642ee926e9a1c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Jun 2009 14:05:13 +0800 Subject: Move date/time format strings into a setting and bump the gallery module to version 2. First test of our upgrade code! Signed-off-by: --- modules/gallery/helpers/gallery.php | 6 +++--- modules/gallery/helpers/gallery_installer.php | 6 ++++++ modules/gallery/module.info | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index e201fded..e22cc17f 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -56,7 +56,7 @@ class gallery_Core { * @return string */ static function date_time($timestamp) { - return date("Y-M-d H:i:s", $timestamp); + return date(module::get_var("gallery", "date_time_format", "Y-M-d H:i:s"), $timestamp); } /** @@ -65,7 +65,7 @@ class gallery_Core { * @return string */ static function date($timestamp) { - return date("Y-M-d", $timestamp); + return date(module::get_var("gallery", "date_format", "Y-M-d"), $timestamp); } /** @@ -74,6 +74,6 @@ class gallery_Core { * @return string */ static function time($timestamp) { - return date("H:i:s", $timestamp); + return date(module::get_var("gallery", "time_format", "H:i:s"), $timestamp); } } \ No newline at end of file diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 242bb486..b2be63be 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -254,6 +254,12 @@ class gallery_installer { // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by
    Gallery %version"); + } else if ($version == 1) { + module::set_var("gallery", "date_format", "Y-M-d"); + module::set_var("gallery", "date_time_format", "Y-M-d H:i:s"); + module::set_var("gallery", "time_format", "H:i:s"); + module::set_var("gallery", "version", "3.0 pre beta 2 (git)"); + module::set_version("gallery", 2); } } diff --git a/modules/gallery/module.info b/modules/gallery/module.info index ff7da82d..3a5dd593 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = Gallery 3 description = Gallery core application -version = 1 +version = 2 -- cgit v1.2.3 From d95fcb189f7fb9709b5ee30cbeded611fc04a7a2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 13 Jun 2009 17:15:32 -0700 Subject: Add a warning about eAccelerator interfering with g2_import. --- modules/g2_import/views/admin_g2_import.html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index c0ee2b17..d5e29e12 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -3,7 +3,10 @@

    - Note: The importer is a work in progress and does not currently support permissions, and movie formats other than Flash video and MP4") ?> +
    + Note: The importer is a work in progress and does not currently support permissions, and movie formats other than Flash video and MP4") ?> +
    + Note: The importer has known issues with the eAccelerator PHP accelerator. If you're using eAccelerator, please disable it. One way to do that is to put php_value eaccelerator.enable 0 in gallery3/.htaccess") ?>

    -- cgit v1.2.3 From a89c871861d002a5a3174c01533919f7d12ff772 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 14 Jun 2009 08:06:34 +0800 Subject: Remap mysql_xx() functions to their mysqli counterparts if the mysql extension is unavailable. Fixes ticket #393. Signed-off-by: --- installer/installer.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/installer/installer.php b/installer/installer.php index 1a36ddb5..9ba88bea 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -17,7 +17,35 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +// We know that we have either mysql or mysqli. By default we use mysql functions, so if they're +// not defined then do the simplest thing which will work: remap them to their mysqli +// counterparts. +if (!function_exists("mysql_query")) { + function mysql_connect($host, $user, $pass) { + installer::$mysqli = new mysqli($host, $user, $pass); + // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of + // $mysqli->connect_error because of bugs before PHP 5.2.9 + $error = mysqli_connect_error(); + return empty($error); + } + function mysql_query($query) { + return installer::$mysqli->query($query); + } + function mysql_num_rows($result) { + return $result->num_rows; + } + function mysql_error() { + return installer::$mysqli->error; + } + function mysql_select_db($db) { + return installer::$mysqli->select_db($db); + } +} + class installer { + static $mysqli; + static function already_installed() { return file_exists(VARPATH . "database.php"); } -- cgit v1.2.3 From b86e657194c2abaf53eba3752d4c63af1e689f67 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Mon, 15 Jun 2009 00:42:14 +0800 Subject: Switch quick delete from JS confirm to jQuery UI dialog, closes ticket #355. Signed-off-by: --- modules/gallery/controllers/quick.php | 15 +++++++++++++++ modules/gallery/helpers/item.php | 18 ++++++++++++++++++ modules/gallery/js/quick.js | 4 ---- modules/gallery/views/quick_pane.html.php | 5 +---- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index d6f5213f..30383307 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -95,6 +95,21 @@ class Quick_Controller extends Controller { print json_encode(array("result" => "success", "reload" => 1)); } + public function form_delete($id) { + $item = model_cache::get("item", $id); + access::required("view", $item); + access::required("edit", $item); + + if ($item->is_album()) { + print t("Delete the album %title? All items within the album will also be deleted.", array("title" => $item->title)); + } else { + print t("Are you sure you want to delete %title?", array("title" => $item->title)); + } + + $form = item::get_delete_form($item); + print $form; + } + public function delete($id) { access::verify_csrf(); $item = model_cache::get("item", $id); diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 09870b45..f40b5c97 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -119,4 +119,22 @@ class item_Core { $title = preg_replace("/ +/", " ", $title); return $title; } + + /** + * Display delete confirmation message and form + * @param object $item + * @return string form + */ + static function get_delete_form($item) { + if (Input::instance()->get("page_type") == "album") { + $page_type = "album"; + } else { + $page_type = "item"; + } + $form = new Forge("quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "gConfirmDelete")); + $form->hidden("_method")->value("put"); + $group = $form->group("confirm_delete")->label(t("Confirm Deletion")); + $group->submit("")->value(t("Delete")); + return $form; + } } \ No newline at end of file diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 8a87ed07..4ebdac47 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -39,10 +39,6 @@ var show_quick = function() { ); $("#gQuickPane a:not(.options)").click(function(e) { e.preventDefault(); - if ($(this).attr("id") == "gQuickDelete" && - !confirm($(this).attr("ref"))) { - return; - } quick_do(cont, $(this), img); }); $("#gQuickPane a.options").click(function(e) { diff --git a/modules/gallery/views/quick_pane.html.php b/modules/gallery/views/quick_pane.html.php index 95de972b..f50e1abe 100644 --- a/modules/gallery/views/quick_pane.html.php +++ b/modules/gallery/views/quick_pane.html.php @@ -67,15 +67,12 @@ type == "photo"): ?> - type == "movie"): ?> - type == "album"): ?> - -id?csrf=$csrf&page_type=$page_type") ?>" ref="" id="gQuickDelete" title=""> +id?page_type=$page_type") ?>" id="gQuickDelete" title=""> -- cgit v1.2.3 From aaa215a285845b6dbfcb1eed86593dee1f557b43 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 14 Jun 2009 10:41:34 -0700 Subject: Get rid of the word "items" in the delete confirmation dialog. --- modules/gallery/controllers/quick.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 30383307..cff6686b 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -101,7 +101,9 @@ class Quick_Controller extends Controller { access::required("edit", $item); if ($item->is_album()) { - print t("Delete the album %title? All items within the album will also be deleted.", array("title" => $item->title)); + print t( + "Delete the album %title? All photos and movies in the album will also be deleted.", + array("title" => $item->title)); } else { print t("Are you sure you want to delete %title?", array("title" => $item->title)); } -- cgit v1.2.3