summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-23 16:05:32 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-23 16:05:32 -0700
commitb9b68e09527f2680252bcba054019c45db07829a (patch)
tree9fd2ca11f0f9317086f62bc76961eb1b670f7b87
parentda09185a4baa739dd011804eb1301cdf2d126c11 (diff)
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.
-rw-r--r--modules/gallery/controllers/admin_theme_options.php1
-rw-r--r--modules/gallery/helpers/gallery_installer.php8
-rw-r--r--modules/gallery/helpers/theme.php2
-rw-r--r--modules/gallery/module.info2
-rw-r--r--themes/default/views/footer.html.php4
5 files changed, 14 insertions, 3 deletions
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 <a href=\"%url\">Gallery %version</a>");
- 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
diff --git a/themes/default/views/footer.html.php b/themes/default/views/footer.html.php
index d7111922..040a4062 100644
--- a/themes/default/views/footer.html.php
+++ b/themes/default/views/footer.html.php
@@ -2,7 +2,9 @@
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
-<? else: ?>
+<? endif ?>
+
+<? if (module::get_var("gallery", "show_credits")): ?>
<ul id="gCredits">
<?= $theme->credits() ?>
</ul>