From 7be51a8700eaefb4c5368f287b2d25d0f53c1153 Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Wed, 21 Dec 2011 15:20:26 +0100 Subject: [PATCH] Added support for breadcrumbs and sidebar (enable via theme options) --- admin/controllers/admin_theme_options.php | 26 ++++++++++++++++------- js/pear.js | 13 ++++++++++++ theme.info | 2 +- views/album.html.php | 8 +++++++ views/page.html.php | 7 ++++-- 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/admin/controllers/admin_theme_options.php b/admin/controllers/admin_theme_options.php index cd784e24..8cd09ab2 100644 --- a/admin/controllers/admin_theme_options.php +++ b/admin/controllers/admin_theme_options.php @@ -3,7 +3,7 @@ /* */ ?> -"g-theme-options-form")); -// Just commenting out, we might want rssmodule in future versions. +// Just commenting out, we might want rssmodule in future versions. // $rssmodulecheck = (module::is_active("rss") && module::info("rss")); /* Prerequisites ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ $group = $form->group("requirements")->label(t("Prerequisites")); $gallery_ver = module::get_version("gallery"); - $this->prerequisite_check($group, "vercheck", $gallery_ver >= $this->min_gallery_ver, + $this->prerequisite_check($group, "vercheck", $gallery_ver >= $this->min_gallery_ver, t("Gallery 3 Core v.") . $this->min_gallery_ver . "+", t("Installed"), t("Required"), FALSE, sprintf(t("Check Failed. Minimum Required Version is %s. Found %s."), $this->min_gallery_ver, $gallery_ver)); - $this->prerequisite_check($group, "square_thumbs", (module::is_active("square_thumbs") and module::info("square_thumbs")), + $this->prerequisite_check($group, "square_thumbs", (module::is_active("square_thumbs") and module::info("square_thumbs")), t("Square Thumbnails"), t("Found"), t("Required"), FALSE, t("Install Square Thumbnails to display Thumbs correctly.")); if (!module::get_var("th_pear4gallery3", "hide_thumbmeta")): - $this->prerequisite_check($group, "info", (module::is_active("info") and module::info("info")), + $this->prerequisite_check($group, "info", (module::is_active("info") and module::info("info")), t("Info Module"), t("Found"), t("Required"), FALSE, t("Check Failed. Module is required to display Thumb metadata.")); endif; - + /* General Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ $group = $form->group("edit_theme")->label(t("General Settings")); @@ -96,6 +96,12 @@ class Admin_Theme_Options_Controller extends Admin_Controller { ->label(t("Background color")) ->options(array("black" => t("Black (Default)"), "dkgrey" => t("Dark-Grey"), "ltgrey" => t("Light-Grey"), "white" => t("White"))) ->selected(module::get_var("th_pear4gallery3", "background")); + $group->checkbox("show_breadcrumbs") + ->label(t("Show breadcrumbs for navigation.")) + ->checked(module::get_var("th_pear4gallery3", "show_breadcrumbs")); + $group->checkbox("show_sidebar") + ->label(t("Show Sidebar")) + ->checked(module::get_var("th_pear4gallery3", "show_sidebar")); $group->input("ga_code") ->label(t("Google analytics code.")) ->value(module::get_var("th_pear4gallery3", "ga_code")); @@ -139,7 +145,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller { module::event("theme_edit_form", $form); $form->submit("g-theme-options-save")->value(t("Save Changes")); - + return $form; } @@ -181,6 +187,8 @@ class Admin_Theme_Options_Controller extends Admin_Controller { module::clear_var("th_pear4gallery3", "mainmenu_view"); module::clear_var("th_pear4gallery3", "show_guest_menu"); module::clear_var("th_pear4gallery3", "background"); + module::clear_var("th_pear4gallery3", "show_breadcrumbs"); + module::clear_var("th_pear4gallery3", "show_sidebar"); module::clear_var("th_pear4gallery3", "ga_code"); } @@ -265,10 +273,12 @@ class Admin_Theme_Options_Controller extends Admin_Controller { $this->save_item_state("mainmenu_view", $form->edit_theme_adv_main->mainmenu_view->value != "grid", $form->edit_theme_adv_main->mainmenu_view->value); $this->save_item_state("show_guest_menu",$form->edit_theme_adv_main->show_guest_menu->value, TRUE); $this->save_item_state("background", $form->edit_theme_adv_main->background->value != "black", $form->edit_theme_adv_main->background->value); + $this->save_item_state("show_breadcrumbs",$form->edit_theme_adv_main->show_breadcrumbs->value, TRUE); + $this->save_item_state("show_sidebar",$form->edit_theme_adv_main->show_sidebar->value, TRUE); $this->save_item_state("ga_code", $form->edit_theme_adv_main->ga_code->value, $form->edit_theme_adv_main->ga_code->value); // * Advanced Options - Photo page *************************************** - /* + /* $this->save_item_state("photo_descmode", $photo_descmode != "overlay_top", $photo_descmode); $this->save_item_state("photo_popupbox", $photo_popupbox != "default", $photo_popupbox); $this->save_item_state("thumb_inpage", $form->edit_theme_adv_photo->thumb_inpage->value, TRUE); diff --git a/js/pear.js b/js/pear.js index 41791684..417d9631 100644 --- a/js/pear.js +++ b/js/pear.js @@ -50,6 +50,16 @@ function getCookie(c_name) { } return ""; } +function toggleSidebar() { + if ($('#sidebar').length === 0) { return; } + if ($('#sidebar').is(':visible')) { + $('#sidebar').hide('slide', { direction: 'right'}, 1000); + $('#mosaicGridContainer').animate( { width: '+=220' }, 1000, function () { mosaicResize(); }); + } else { + $('#sidebar').show('slide', { direction: 'right'}, 1000); + $('#mosaicGridContainer').animate( { width: '-=220' }, 1000, function () { mosaicResize(); }); + } +} function mosaicResize() { if ($('#mosaicGridContainer').length === 0) { @@ -90,6 +100,9 @@ function mosaicResize() { if ($('#g-movie').length) { myHeight += 18; } + /*Sidebar*/ + if ($('#sidebar').is(':visible')) { myWidth = myWidth - 220; } + $('#sidebar').css('height', (myHeight + 53) + "px"); if (!mosaicView) { $('#mosaicGridContainer').css({'height': (myHeight + 33) + "px", 'width': myWidth + "px"}); } else { diff --git a/theme.info b/theme.info index c94543d2..bdc88fe7 100644 --- a/theme.info +++ b/theme.info @@ -1,6 +1,6 @@ name = ".Pear Theme" description = "A theme with the intention to mimic Apples mobile me gallery." -version = 2.7 +version = 2.7.1 author = "Fredrik Erlandsson " site = 1 admin = 0 diff --git a/views/album.html.php b/views/album.html.php index 3140be79..1abfdf20 100644 --- a/views/album.html.php +++ b/views/album.html.php @@ -95,6 +95,14 @@ endif; + + + + diff --git a/views/page.html.php b/views/page.html.php index 8d34fd7e..cfcb3fd0 100644 --- a/views/page.html.php +++ b/views/page.html.php @@ -120,8 +120,11 @@ item()): ?>
item()->title, 40)) ?>   @@ -183,7 +186,7 @@
- +