summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/helpers/core_menu.php28
-rw-r--r--core/libraries/Menu.php20
-rw-r--r--core/libraries/Theme_View.php14
3 files changed, 60 insertions, 2 deletions
diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php
index 3131c1e8..8a17d030 100644
--- a/core/helpers/core_menu.php
+++ b/core/helpers/core_menu.php
@@ -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")
diff --git a/core/libraries/Menu.php b/core/libraries/Menu.php
index 21d94284..aa41dc95 100644
--- a/core/libraries/Menu.php
+++ b/core/libraries/Menu.php
@@ -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>";
}
}
diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php
index 794cb2fb..37629f3d 100644
--- a/core/libraries/Theme_View.php
+++ b/core/libraries/Theme_View.php
@@ -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(