Added support for breadcrumbs and sidebar (enable via theme options)
This commit is contained in:
parent
fad0fe48aa
commit
7be51a8700
@ -96,6 +96,12 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
|
|||||||
->label(t("Background color"))
|
->label(t("Background color"))
|
||||||
->options(array("black" => t("Black (Default)"), "dkgrey" => t("Dark-Grey"), "ltgrey" => t("Light-Grey"), "white" => t("White")))
|
->options(array("black" => t("Black (Default)"), "dkgrey" => t("Dark-Grey"), "ltgrey" => t("Light-Grey"), "white" => t("White")))
|
||||||
->selected(module::get_var("th_pear4gallery3", "background"));
|
->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")
|
$group->input("ga_code")
|
||||||
->label(t("<a href=\"http://www.google.com/analytics/\">Google analytics</a> code."))
|
->label(t("<a href=\"http://www.google.com/analytics/\">Google analytics</a> code."))
|
||||||
->value(module::get_var("th_pear4gallery3", "ga_code"));
|
->value(module::get_var("th_pear4gallery3", "ga_code"));
|
||||||
@ -181,6 +187,8 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
|
|||||||
module::clear_var("th_pear4gallery3", "mainmenu_view");
|
module::clear_var("th_pear4gallery3", "mainmenu_view");
|
||||||
module::clear_var("th_pear4gallery3", "show_guest_menu");
|
module::clear_var("th_pear4gallery3", "show_guest_menu");
|
||||||
module::clear_var("th_pear4gallery3", "background");
|
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");
|
module::clear_var("th_pear4gallery3", "ga_code");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,6 +273,8 @@ 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("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("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("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);
|
$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 ***************************************
|
// * Advanced Options - Photo page ***************************************
|
||||||
|
13
js/pear.js
13
js/pear.js
@ -50,6 +50,16 @@ function getCookie(c_name) {
|
|||||||
}
|
}
|
||||||
return "";
|
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() {
|
function mosaicResize() {
|
||||||
if ($('#mosaicGridContainer').length === 0) {
|
if ($('#mosaicGridContainer').length === 0) {
|
||||||
@ -90,6 +100,9 @@ function mosaicResize() {
|
|||||||
if ($('#g-movie').length) {
|
if ($('#g-movie').length) {
|
||||||
myHeight += 18;
|
myHeight += 18;
|
||||||
}
|
}
|
||||||
|
/*Sidebar*/
|
||||||
|
if ($('#sidebar').is(':visible')) { myWidth = myWidth - 220; }
|
||||||
|
$('#sidebar').css('height', (myHeight + 53) + "px");
|
||||||
if (!mosaicView) {
|
if (!mosaicView) {
|
||||||
$('#mosaicGridContainer').css({'height': (myHeight + 33) + "px", 'width': myWidth + "px"});
|
$('#mosaicGridContainer').css({'height': (myHeight + 33) + "px", 'width': myWidth + "px"});
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name = ".Pear Theme"
|
name = ".Pear Theme"
|
||||||
description = "A theme with the intention to mimic Apples mobile me gallery."
|
description = "A theme with the intention to mimic Apples mobile me gallery."
|
||||||
version = 2.7
|
version = 2.7.1
|
||||||
author = "Fredrik Erlandsson <fredrik.e@gmail.com>"
|
author = "Fredrik Erlandsson <fredrik.e@gmail.com>"
|
||||||
site = 1
|
site = 1
|
||||||
admin = 0
|
admin = 0
|
||||||
|
@ -95,6 +95,14 @@ endif;
|
|||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
<? if (module::get_var("th_pear4gallery3", "show_sidebar")): ?>
|
||||||
|
</td><td>
|
||||||
|
<div id="sidebar" class="sidebar" style="width: 220px;">
|
||||||
|
<? if ($theme->page_subtype != "login"): ?>
|
||||||
|
<?= new View("sidebar.html") ?>
|
||||||
|
<? endif ?>
|
||||||
|
</div>
|
||||||
|
<? endif ?>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
<div id="pearFlowPadd" class="imageflow" style="display: none;"></div>
|
<div id="pearFlowPadd" class="imageflow" style="display: none;"></div>
|
||||||
<div id="pearImageFlow" class="imageflow" style="display: none;"> </div>
|
<div id="pearImageFlow" class="imageflow" style="display: none;"> </div>
|
||||||
|
@ -120,8 +120,11 @@
|
|||||||
<? if ($theme->item()): ?>
|
<? if ($theme->item()): ?>
|
||||||
<div class="lNavBar">
|
<div class="lNavBar">
|
||||||
<? if(!empty($parents)): ?>
|
<? if(!empty($parents)): ?>
|
||||||
<? $parent = end($parents) ?>
|
<? foreach ($parents as $parent): ?>
|
||||||
|
<? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) $parent = end($parents); ?>
|
||||||
<button class="large push large-with-push" onclick="window.location='<?= $parent->url($parent->id == $theme->item()->parent_id ? "show={$theme->item()->id}" : null) ?>' + '#viewMode=' + viewMode;"> <div class="outer"> <div class="label"> <?= html::purify(text::limit_chars($parent->title, module::get_var("gallery", "visible_title_length"))) ?></div> </div></button>
|
<button class="large push large-with-push" onclick="window.location='<?= $parent->url($parent->id == $theme->item()->parent_id ? "show={$theme->item()->id}" : null) ?>' + '#viewMode=' + viewMode;"> <div class="outer"> <div class="label"> <?= html::purify(text::limit_chars($parent->title, module::get_var("gallery", "visible_title_length"))) ?></div> </div></button>
|
||||||
|
<? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) break; ?>
|
||||||
|
<? endforeach ?>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="pearTitle" title="<?= $theme->item()->description ?>"> <?= html::purify(text::limit_chars($theme->item()->title, 40)) ?>
|
<div class="pearTitle" title="<?= $theme->item()->description ?>"> <?= html::purify(text::limit_chars($theme->item()->title, 40)) ?>
|
||||||
@ -183,7 +186,7 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
</div>
|
</div>
|
||||||
<? if (!module::get_var("th_pear4gallery3", "hide_logo")): ?><button id="logoButton"></button><?endif?>
|
<? if (!module::get_var("th_pear4gallery3", "hide_logo")): ?><button id="logoButton" onclick="toggleSidebar();"></button><? endif ?>
|
||||||
</div>
|
</div>
|
||||||
</div> <? /*class="pear"*/ ?>
|
</div> <? /*class="pear"*/ ?>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
|
Reference in New Issue
Block a user