diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-08-29 16:26:27 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-08-29 16:27:32 -0700 |
commit | 4c8445852d0657d8c598d38096852b49e4672638 (patch) | |
tree | 5aad3abee73329babc069046f0288895025da0b4 | |
parent | 24b511b44a0f2a7bce575a6dad9c88f9ef257648 (diff) |
Bump gallery module to v36 and add a favicon_url variable, which we
expose in Admin > Appearance > Theme Options and defaults to
lib/images/favicon.ico.
Thix fixes ticket #1312.
-rw-r--r-- | installer/install.sql | 5 | ||||
-rw-r--r-- | modules/gallery/controllers/admin_theme_options.php | 4 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 8 | ||||
-rw-r--r-- | modules/gallery/module.info | 2 | ||||
-rw-r--r-- | themes/admin_wind/views/admin.html.php | 2 | ||||
-rw-r--r-- | themes/wind/views/page.html.php | 2 |
6 files changed, 17 insertions, 6 deletions
diff --git a/installer/install.sql b/installer/install.sql index 3e67a07a..e08c4128 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',35,1); +INSERT INTO {modules} VALUES (1,1,'gallery',36,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',2,4); @@ -395,7 +395,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=44 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=45 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind'); INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind'); @@ -414,6 +414,7 @@ INSERT INTO {vars} VALUES (NULL,'gallery','maintenance_mode','0'); INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); INSERT INTO {vars} VALUES (NULL,'gallery','visible_title_length','15'); INSERT INTO {vars} VALUES (NULL,'gallery','date_time_format','Y-M-d H:i:s'); +INSERT INTO {vars} VALUES (NULL,'gallery','favicon_url','lib/images/favicon.ico'); INSERT INTO {vars} VALUES (NULL,'gallery','date_format','Y-M-d'); INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}'); INSERT INTO {vars} VALUES (NULL,'gallery','choose_default_tookit','1'); diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php index 781d6e62..58ed723e 100644 --- a/modules/gallery/controllers/admin_theme_options.php +++ b/modules/gallery/controllers/admin_theme_options.php @@ -58,6 +58,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); + module::set_var("gallery", "favicon_url", $form->edit_theme->favicon_url->value); module::event("theme_edit_form_completed", $form); @@ -89,6 +90,9 @@ class Admin_Theme_Options_Controller extends Admin_Controller { ->error_messages("required", t("You must enter a number")) ->error_messages("valid_digit", t("You must enter a number")) ->value(module::get_var("gallery", "resize_size")); + $group->input("favicon_url")->label(t("URL (or relative path) to your favicon.ico")) + ->id("g-favicon") + ->value(module::get_var("gallery", "favicon_url")); $group->textarea("header_text")->label(t("Header text"))->id("g-header-text") ->value(module::get_var("gallery", "header_text")); $group->textarea("footer_text")->label(t("Footer text"))->id("g-footer-text") diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 9aabf22b..d1bfa656 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -301,7 +301,8 @@ class gallery_installer { module::set_var("gallery", "admin_area_timeout", 90 * 60); module::set_var("gallery", "maintenance_mode", 0); module::set_var("gallery", "visible_title_length", 15); - module::set_version("gallery", 35); + module::set_var("gallery", "favicon_url", "lib/images/favicon.ico"); + module::set_version("gallery", 36); } static function upgrade($version) { @@ -590,6 +591,11 @@ class gallery_installer { module::set_var("gallery", "visible_title_length", 15); module::set_version("gallery", $version = 35); } + + if ($version == 35) { + module::set_var("gallery", "favicon_url", "lib/images/favicon.ico"); + module::set_version("gallery", $version = 36); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 94942840..44da9f2f 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 35 +version = 36 diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php index 6b0c3fe5..c4b51f41 100644 --- a/themes/admin_wind/views/admin.html.php +++ b/themes/admin_wind/views/admin.html.php @@ -11,7 +11,7 @@ <?= t("Admin dashboard") ?> <? endif ?> </title> - <link rel="shortcut icon" href="<?= url::file("lib/images/favicon.ico") ?>" type="image/x-icon" /> + <link rel="shortcut icon" href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>" type="image/x-icon" /> <?= $theme->css("yui/reset-fonts-grids.css") ?> <?= $theme->css("themeroller/ui.base.css") ?> diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index 3c4f6ef5..4938ed60 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -23,7 +23,7 @@ <? endif ?> <? endif ?> </title> - <link rel="shortcut icon" href="<?= url::file("lib/images/favicon.ico") ?>" type="image/x-icon" /> + <link rel="shortcut icon" href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>" type="image/x-icon" /> <?= $theme->css("yui/reset-fonts-grids.css") ?> <?= $theme->css("superfish/css/superfish.css") ?> <?= $theme->css("themeroller/ui.base.css") ?> |