diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-14 22:27:26 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-14 22:27:26 -0700 |
commit | 1b656be7135efe51ba0eb34d6ac76c2632ec193a (patch) | |
tree | 5c66209a366d5df80eca693cbc7c43a18338324e /modules | |
parent | 32ea4406c87049b25d3d82351097e69f13168311 (diff) |
Create a sidebar for tag pages
Move the <link> for the container feed (either gallery/album/<id> or
tag/tag/<id>) back into gallery_theme
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/helpers/gallery_menu.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 8 | ||||
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 17 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_menu.php | 11 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_theme.php | 12 | ||||
-rw-r--r-- | modules/tag/helpers/tag_theme.php | 6 |
6 files changed, 41 insertions, 16 deletions
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index fd4ec241..4499e50a 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -91,6 +91,9 @@ class gallery_menu_Core { static function album($menu, $theme) { } + static function tag($menu, $theme) { + } + static function photo($menu, $theme) { if (access::can("view_full", $theme->item())) { $menu diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index f955e8f7..c28c9040 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -42,6 +42,14 @@ class gallery_theme_Core { $buf .= html::script("modules/gallery/js/fullsize.js"); } + if (module::is_active("rss")) { + if ($item = $theme->item()) { + $buf = rss::feed_link("gallery/album/{$item->id}"); + } else if ($tag = $theme->tag()) { + $buf = rss::feed_link("tag/tag/{$tag->id}"); + } + } + if ($session->get("l10n_mode", false)) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />"; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 15baaeef..ebf0792c 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -124,6 +124,23 @@ class Theme_View_Core extends View { print $menu; } + public function tag_menu() { + $menu = Menu::factory("root"); + gallery_menu::tag($menu, $this); + + foreach (module::active() as $module) { + if ($module->name == "gallery") { + continue; + } + $class = "{$module->name}_menu"; + if (method_exists($class, "tag")) { + call_user_func_array(array($class, "tag"), array(&$menu, $this)); + } + } + + print $menu; + } + public function photo_menu() { $menu = Menu::factory("root"); gallery_menu::photo($menu, $this); diff --git a/modules/slideshow/helpers/slideshow_menu.php b/modules/slideshow/helpers/slideshow_menu.php index 799c9a76..ee975d88 100644 --- a/modules/slideshow/helpers/slideshow_menu.php +++ b/modules/slideshow/helpers/slideshow_menu.php @@ -37,4 +37,15 @@ class slideshow_menu_Core { "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") ->css_id("gSlideshowLink")); } + + static function tag($menu, $theme) { + $menu + ->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") + ->css_id("gSlideshowLink")); + } + } diff --git a/modules/slideshow/helpers/slideshow_theme.php b/modules/slideshow/helpers/slideshow_theme.php index 69acb113..125d175c 100644 --- a/modules/slideshow/helpers/slideshow_theme.php +++ b/modules/slideshow/helpers/slideshow_theme.php @@ -20,17 +20,7 @@ class slideshow_theme_Core { static function head($theme) { $proto = (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] === "off") ? "http" : "https"; - - if (module::is_active("rss")) { - if ($item = $theme->item()) { - $buf = rss::feed_link("gallery/album/{$item->id}"); - } else if ($tag = $theme->tag()) { - $buf = rss::feed_link("tag/{$tag->id}"); - } - } - - $buf .= "<script src=\"$proto://lite.piclens.com/current/piclens_optimized.js\"" . + return "<script src=\"$proto://lite.piclens.com/current/piclens_optimized.js\"" . "type=\"text/javascript\"></script>"; - return $buf; } } diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index 45f55986..a32d71b6 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -20,11 +20,7 @@ class tag_theme_Core { static function head($theme) { $url = url::file("modules/tag/js/tag.js"); - $head[] = "<script src=\"$url\" type=\"text/javascript\"></script>"; - if ($theme->tag() && module::is_active("rss")) { - $head[] = rss::feed_link("tags/{$theme->tag()->id}"); - } - return implode("\n", $head); + return "<script src=\"$url\" type=\"text/javascript\"></script>"; } static function sidebar_blocks($theme) { |