mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-18 21:05:01 -04:00
Started to wire up album and photo view menus. Need photo's parent album link added. Also need add the slideshow link to the menu.
This commit is contained in:
@@ -71,6 +71,34 @@ class core_menu_Core {
|
||||
}
|
||||
}
|
||||
|
||||
public static function album($menu, $theme) {
|
||||
$menu
|
||||
->append(Menu::factory("link")
|
||||
->id("hybrid")
|
||||
->label(_("View album hybrid mode"))
|
||||
->url("#")
|
||||
->css_id("gHybridLink"));
|
||||
}
|
||||
|
||||
public static function photo($menu, $theme) {
|
||||
$menu
|
||||
->append(Menu::factory("link")
|
||||
->id("fullsize")
|
||||
->label(_("View full size image"))
|
||||
->url("#")
|
||||
->css_id("gFullsizeLink"))
|
||||
->append(Menu::factory("link")
|
||||
->id("comments")
|
||||
->label(_("View comments on this item"))
|
||||
->url("#comments")
|
||||
->css_id("gCommentsLink"))
|
||||
->append(Menu::factory("link")
|
||||
->id("album")
|
||||
->label(_("View album hybrid mode"))
|
||||
->url("#")
|
||||
->css_id("gAlbumLink"));
|
||||
}
|
||||
|
||||
public static function admin($menu, $theme) {
|
||||
$menu
|
||||
->append(Menu::factory("link")
|
||||
|
||||
+18
-2
@@ -20,8 +20,9 @@
|
||||
class Menu_Element {
|
||||
public $label;
|
||||
public $url;
|
||||
public $css_id;
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* Set the id
|
||||
* @chainable
|
||||
@@ -48,6 +49,16 @@ class Menu_Element {
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the css id
|
||||
* @chainable
|
||||
*/
|
||||
public function css_id($css_id) {
|
||||
$this->css_id = $css_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +66,12 @@ class Menu_Element {
|
||||
*/
|
||||
class Menu_Element_Link extends Menu_Element {
|
||||
public function __toString() {
|
||||
return "<li><a class=\"gMenuElement\" href=\"$this->url\">$this->label</a></li>";
|
||||
if (isset($this->css_id) && !empty($this->css_id)) {
|
||||
$css_id = " id=\"$this->css_id\"";
|
||||
} else {
|
||||
$css_id = "";
|
||||
}
|
||||
return "<li><a$css_id class=\"gMenuElement\" href=\"$this->url\">$this->label</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,20 @@ class Theme_View_Core extends View {
|
||||
print $menu;
|
||||
}
|
||||
|
||||
public function album_menu() {
|
||||
$menu = new Menu(true);
|
||||
core_menu::album($menu, $this);
|
||||
|
||||
print $menu;
|
||||
}
|
||||
|
||||
public function photo_menu() {
|
||||
$menu = new Menu(true);
|
||||
core_menu::photo($menu, $this);
|
||||
|
||||
print $menu;
|
||||
}
|
||||
|
||||
public function pager() {
|
||||
$this->pagination = new Pagination();
|
||||
$this->pagination->initialize(
|
||||
|
||||
@@ -34,7 +34,7 @@ $(document).ready(function() {
|
||||
|
||||
// Apply Superfish menus
|
||||
$("ul.gMenu").addClass("sf-menu");
|
||||
$("ul#gViewMenu").addClass("sf-menu");
|
||||
$("#gViewMenu ul.gMenu").addClass("sf-menu");
|
||||
|
||||
// Superfish menu options
|
||||
$('ul.sf-menu').superfish({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<ul id="gViewMenu" class="sf-menu">
|
||||
<li><a href="#" id="gFullsizeLink" title="<?= _("View full size image") ?>"><?= _("View full size image") ?></a></li>
|
||||
<li><a href="#comments" id="gCommentsLink" title="<?= _("View this item's comments") ?>"><?= _("View this item's comments") ?></a></li>
|
||||
<li><a href="#" id="gAlbumLink" title="<?= _("View album") ?>"><?= _("Album view") ?></a></li>
|
||||
<li><a href="#" id="gHybridLink" title="<?= _("View album in hybrid mode") ?>"><?= _("Hybrid view") ?></a></li>
|
||||
<li><?= $theme->sidebar_top() ?></li>
|
||||
</ul>
|
||||
<div id="gViewMenu">
|
||||
<? if ($page_type == "album"):?>
|
||||
<?= $theme->album_menu() ?>
|
||||
<? elseif ($page_type == "photo") : ?>
|
||||
<?= $theme->photo_menu() ?>
|
||||
<? endif ?>
|
||||
</div>
|
||||
|
||||
<?= $theme->sidebar_blocks() ?>
|
||||
<?= $theme->sidebar_bottom() ?>
|
||||
|
||||
Reference in New Issue
Block a user