Example #1
0
 static function head($theme)
 {
     $session = Session::instance();
     $buf = "";
     $buf .= $theme->css("gallery.css");
     if ($session->get("debug")) {
         $buf .= $theme->css("debug.css");
     }
     if (module::is_active("rss")) {
         if ($item = $theme->item()) {
             if ($item->is_album()) {
                 $buf .= rss::feed_link("gallery/album/{$item->id}");
             } else {
                 $buf .= rss::feed_link("gallery/album/{$item->parent()->id}");
             }
         } else {
             if ($tag = $theme->tag()) {
                 $buf .= rss::feed_link("tag/tag/{$tag->id}");
             }
         }
     }
     if (count(locales::installed())) {
         // Needed by the languages block
         $buf .= $theme->script("jquery.cookie.js");
     }
     if ($session->get("l10n_mode", false)) {
         $buf .= $theme->css("l10n_client.css") . $theme->script("jquery.cookie.js") . $theme->script("l10n_client.js");
     }
     $buf .= $theme->css("uploadify/uploadify.css");
     return $buf;
 }
Example #2
0
 static function head($theme)
 {
     $session = Session::instance();
     $buf = "";
     if ($session->get("debug")) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />";
     }
     if (($theme->page_type == "album" || $theme->page_type == "photo") && access::can("edit", $theme->item())) {
         $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/quick.css") . "\" />";
         $buf .= html::script("modules/gallery/js/quick.js");
     }
     if ($theme->page_type == "photo" && access::can("view_full", $theme->item())) {
         $buf .= "<script type=\"text/javascript\" >" . "  var fullsize_detail = { " . "    close: \"" . url::file("modules/gallery/images/ico-close.png") . "\", " . "    url: \"" . $theme->item()->file_url() . "\", " . "    width: " . $theme->item()->width . ", " . "    height: " . $theme->item()->height . "};" . "</script>";
         $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") . "\" />";
         $buf .= html::script("lib/jquery.cookie.js");
         $buf .= html::script("modules/gallery/js/l10n_client.js");
     }
     return $buf;
 }
Example #3
0
 static function head($theme)
 {
     $session = Session::instance();
     $buf = "";
     if ($session->get("debug")) {
         $theme->css("modules/gallery/css/debug.css");
     }
     if (($theme->page_type == "album" || $theme->page_type == "photo") && access::can("edit", $theme->item())) {
         $theme->css("modules/gallery/css/quick.css");
         $theme->script("modules/gallery/js/quick.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)) {
         $theme->css("modules/gallery/css/l10n_client.css");
         $theme->script("lib/jquery.cookie.js");
         $theme->script("modules/gallery/js/l10n_client.js");
     }
     return $buf;
 }
Example #4
0
 static function head($theme)
 {
     $session = Session::instance();
     $buf = "";
     if ($session->get("debug")) {
         $theme->css("debug.css");
     }
     if (module::is_active("rss")) {
         if ($item = $theme->item()) {
             if ($item->is_album()) {
                 $buf .= rss::feed_link("gallery/album/{$item->id}");
             } else {
                 $buf .= rss::feed_link("gallery/album/{$item->parent()->id}");
             }
         } else {
             if ($tag = $theme->tag()) {
                 $buf .= rss::feed_link("tag/tag/{$tag->id}");
             }
         }
     }
     if ($session->get("l10n_mode", false)) {
         $theme->css("l10n_client.css");
         $theme->script("jquery.cookie.js");
         $theme->script("l10n_client.js");
     }
     return $buf;
 }
 static function head($theme)
 {
     if (module::is_installed("rss") && ($theme->item() || $theme->tag())) {
         if ($item = $theme->item()) {
             $url = rss::feed_link("gallery/album/{$item->id}");
         } else {
             if ($tag = $theme->tag()) {
                 $url = rss::feed_link("tag/tag/{$tag->id}");
             }
         }
         // Polar Rose doesn't understand relative URLs.  Hack around that until they fix it.
         $url = url::abs_site(substr($url, strpos($url, "index.php") + 10));
         return "<script type=\"text/javascript\">" . "var polarroseconfig = {" . "partner: 'gallery3'," . "rss: '{$url}'," . "insert: 'g-polar-rose'," . "optin: ''," . "theme: 'dark'," . "progress: true" . "}</script>" . "<script type=\"text/javascript\" " . "src=\"http://cdn.widget.polarrose.com/polarrosewidget.js\">" . "</script>";
     }
 }