summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-15 13:27:26 +0800
committer <unostar@danalan.info>2009-06-15 17:31:24 +0800
commit2a5ffaae7e656636bf8c9411358bf4f33c31dde8 (patch)
treed175e8f30bdfa9cec87f42aa8d7de15d84f71097 /modules
parent0051c2c89b71128ff0aefaaa4a77df91dd078016 (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 Signed-off-by: <unostar@danalan.info>
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_menu.php3
-rw-r--r--modules/gallery/helpers/gallery_theme.php8
-rw-r--r--modules/gallery/libraries/Theme_View.php17
-rw-r--r--modules/slideshow/helpers/slideshow_menu.php11
-rw-r--r--modules/slideshow/helpers/slideshow_theme.php12
-rw-r--r--modules/tag/helpers/tag_theme.php6
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) {