Skip to content

Commit

Permalink
Bump gallery module to v36 and add a favicon_url variable, which we
Browse files Browse the repository at this point in the history
expose in Admin > Appearance > Theme Options and defaults to
lib/images/favicon.ico.

Thix fixes ticket #1312.
  • Loading branch information
bharat committed Aug 29, 2010
1 parent 24b511b commit 4c84458
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
5 changes: 3 additions & 2 deletions installer/install.sql
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions modules/gallery/controllers/admin_theme_options.php
Expand Up @@ -58,6 +58,7 @@ public function save() {
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);

Expand Down Expand Up @@ -89,6 +90,9 @@ private function _get_edit_form_admin() {
->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")
Expand Down
8 changes: 7 additions & 1 deletion modules/gallery/helpers/gallery_installer.php
Expand Up @@ -301,7 +301,8 @@ static function install() {
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) {
Expand Down Expand Up @@ -590,6 +591,11 @@ static function upgrade($version) {
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() {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/module.info
@@ -1,3 +1,3 @@
name = "Gallery 3"
description = "Gallery core application"
version = 35
version = 36
2 changes: 1 addition & 1 deletion themes/admin_wind/views/admin.html.php
Expand Up @@ -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") ?>
Expand Down
2 changes: 1 addition & 1 deletion themes/wind/views/page.html.php
Expand Up @@ -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") ?>
Expand Down

0 comments on commit 4c84458

Please sign in to comment.