diff options
author | Chad Kieffer <chad@2tbsp.com> | 2009-01-04 03:43:12 +0000 |
---|---|---|
committer | Chad Kieffer <chad@2tbsp.com> | 2009-01-04 03:43:12 +0000 |
commit | f7f2fa10cd7f12364e06d8e0276528c8dda26a0f (patch) | |
tree | a19b618eefb5d73ba5f305a7c1c97874ac0d687e /core | |
parent | 2c274694127f5127fef311c13d265a9099dd629d (diff) |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/helpers/core_menu.php | 28 | ||||
-rw-r--r-- | core/libraries/Menu.php | 20 | ||||
-rw-r--r-- | core/libraries/Theme_View.php | 14 |
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( |