From b9b68e09527f2680252bcba054019c45db07829a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 16:05:32 -0700 Subject: Add a new "show credits" check box in the theme options so that you can disable any module credits if you want. Update the theme to obey it. --- modules/gallery/controllers/admin_theme_options.php | 1 + modules/gallery/helpers/gallery_installer.php | 8 +++++++- modules/gallery/helpers/theme.php | 2 ++ modules/gallery/module.info | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php index 2716ed93..8970c3c9 100644 --- a/modules/gallery/controllers/admin_theme_options.php +++ b/modules/gallery/controllers/admin_theme_options.php @@ -56,6 +56,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller { module::set_var("gallery", "header_text", $form->edit_theme->header_text->value); module::set_var("gallery", "footer_text", $form->edit_theme->footer_text->value); + module::set_var("gallery", "show_credits", $form->edit_theme->show_credits->value); message::success(t("Updated theme details")); url::redirect("admin/theme_options"); diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 4f6342b4..df555d52 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -246,9 +246,10 @@ class gallery_installer { 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", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by Gallery %version"); - module::set_version("gallery", 2); + module::set_version("gallery", 3); } static function upgrade($version) { @@ -259,6 +260,11 @@ class gallery_installer { module::set_var("gallery", "version", "3.0 pre beta 2 (git)"); module::set_version("gallery", $version = 2); } + + if ($version == 2) { + module::set_var("gallery", "show_credits", 1); + module::set_version("gallery", $version = 3); + } } static function uninstall() { diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index 0a43f25c..b46a2c14 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -55,6 +55,8 @@ class theme_Core { ->value(module::get_var("gallery", "header_text")); $group->textarea("footer_text")->label(t("Footer text"))->id("gFooterText") ->value(module::get_var("gallery", "footer_text")); + $group->checkbox("show_credits")->label(t("Show site credits"))->id("gFooterText") + ->checked(module::get_var("gallery", "show_credits")); $group->submit("")->value(t("Save")); return $form; } diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 3a5dd593..e5b1f809 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = Gallery 3 description = Gallery core application -version = 2 +version = 3 -- cgit v1.2.3 From 2a190660baeff8cd708926cea79f94f1630418b7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 17:09:37 -0700 Subject: Gracefully handle the case when the gallery2 instances moves somewhere else (or gets deleted). Fixes ticket #458 --- modules/g2_import/controllers/admin_g2_import.php | 3 +++ modules/g2_import/helpers/g2_import_task.php | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index f2969f49..18d09363 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -21,6 +21,9 @@ class Admin_g2_import_Controller extends Admin_Controller { public function index() { if (g2_import::is_configured()) { g2_import::init(); + } + + if (class_exists("GalleryCoreApi")) { $g2_stats = g2_import::stats(); $g2_sizes = g2_import::common_sizes(); } diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 4cd95581..3961097d 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -21,15 +21,19 @@ class g2_import_task_Core { static function available_tasks() { if (g2_import::is_configured()) { g2_import::init(); + } + + + if (class_exists("GalleryCoreApi")) { return array(Task_Definition::factory() ->callback("g2_import_task::import") ->name(t("Import from Gallery 2")) ->description( t("Gallery %version detected", array("version" => g2_import::version()))) ->severity(log::SUCCESS)); - } else { - return array(); } + + return array(); } static function import($task) { -- cgit v1.2.3 From 9a0448e5d6f83d93f906e6fe1aec4bbb8d78912f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 17:25:59 -0700 Subject: Add gDialogLink to the delete button, since its got a jQuery confirmation dialog now. This was a regression in fa4bb5b7ac89bbbd0325e5c336c2e9b31f59d12b. Fixes ticket #459. --- modules/gallery/helpers/gallery_quick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_quick.php b/modules/gallery/helpers/gallery_quick.php index bb791c33..302a3144 100644 --- a/modules/gallery/helpers/gallery_quick.php +++ b/modules/gallery/helpers/gallery_quick.php @@ -118,7 +118,7 @@ class gallery_quick_Core { $elements["right"][] = (object)array( "title" => $delete_title, - "class" => "gButtonLink", + "class" => "gDialogLink gButtonLink", "icon" => "ui-icon-trash", "id" => "gQuickDelete", "href" => url::site("quick/form_delete/$item->id?csrf=$csrf&page_type=$page_type")); -- cgit v1.2.3 From 53284ec5b892915c5905ea4f1e3fe76b18d3b576 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 18:39:00 -0700 Subject: Add support for Gallery 2.2.2 style bootstrap syntax. --- modules/g2_import/helpers/g2_import.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 2eee564a..91ca1e63 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -113,11 +113,13 @@ class g2_import_Core { "require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');", "define('GALLERY_CONFIG_DIR', dirname(__FILE__));", "\$gallery =& new Gallery();", + "\$GLOBALS['gallery'] =& new Gallery();", "\$gallery = new Gallery();"), array("require_once(dirname(__FILE__) . '/Gallery.class');", "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');", "define('GALLERY_CONFIG_DIR', '$config_dir');", "\$gallery =& new G2_Gallery();", + "\$GLOBALS['gallery'] =& new G2_Gallery();", "\$gallery = new G2_Gallery();"), array_merge(array("\n"), file("$base_dir/bootstrap.inc")))); -- cgit v1.2.3 From d01c3d2373cc98a0d6abb1eb5a1f71491e1001e2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 21:27:17 -0700 Subject: Remove stray ? that was breaking ccw rotation. --- modules/gallery/helpers/gallery_quick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_quick.php b/modules/gallery/helpers/gallery_quick.php index 302a3144..9da0e082 100644 --- a/modules/gallery/helpers/gallery_quick.php +++ b/modules/gallery/helpers/gallery_quick.php @@ -89,7 +89,7 @@ class gallery_quick_Core { "title" => t("Rotate 90 degrees counter clockwise"), "class" => "gButtonLink", "icon" => "ui-icon-rotate-ccw", - "href" => url::site("quick/form_edit/$item->id/ccw?csrf=$csrf&?page_type=$page_type")); + "href" => url::site("quick/form_edit/$item->id/ccw?csrf=$csrf&page_type=$page_type")); $elements["left"][] = (object)array( "title" => t("Rotate 90 degrees clockwise"), -- cgit v1.2.3 From f9dbd4eb2feede5381d481f473bf7f0a77b49e4a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 21:31:58 -0700 Subject: Fix broken rotate urls. --- modules/gallery/helpers/gallery_quick.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_quick.php b/modules/gallery/helpers/gallery_quick.php index 9da0e082..d0ffc584 100644 --- a/modules/gallery/helpers/gallery_quick.php +++ b/modules/gallery/helpers/gallery_quick.php @@ -83,19 +83,20 @@ class gallery_quick_Core { "class" => "gDialogLink gButtonLink", "icon" => "ui-icon-pencil", "href" => url::site("quick/form_edit/$item->id?page_type=$page_type")); + if ($item->is_photo() && graphics::can("rotate")) { $elements["left"][] = (object)array( "title" => t("Rotate 90 degrees counter clockwise"), "class" => "gButtonLink", "icon" => "ui-icon-rotate-ccw", - "href" => url::site("quick/form_edit/$item->id/ccw?csrf=$csrf&page_type=$page_type")); + "href" => url::site("quick/rotate/$item->id/ccw?csrf=$csrf&page_type=$page_type")); $elements["left"][] = (object)array( "title" => t("Rotate 90 degrees clockwise"), "class" => "gButtonLink", "icon" => "ui-icon-rotate-cw", - "href" => url::site("quick/form_edit/$item->id/cw?csrf=$csrf&page_type=$page_type")); + "href" => url::site("quick/rotate/$item->id/cw?csrf=$csrf&page_type=$page_type")); } // Don't move photos from the photo page; we don't yet have a good way of redirecting after move -- cgit v1.2.3