2008-11-25 04:37:21 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
|
/**
|
|
|
|
|
* Gallery - a web based photo album viewer and editor
|
2009-05-13 20:04:58 +00:00
|
|
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
2008-11-25 04:37:21 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
|
* your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
2009-05-27 16:15:00 -07:00
|
|
|
class gallery_theme_Core {
|
2009-01-14 04:12:02 +00:00
|
|
|
static function head($theme) {
|
2009-03-09 00:03:04 +00:00
|
|
|
$session = Session::instance();
|
2009-01-03 05:36:16 +00:00
|
|
|
$buf = "";
|
2009-10-25 16:53:54 -06:00
|
|
|
$theme->css("gallery.css");
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("debug")) {
|
2009-07-22 14:27:57 -07:00
|
|
|
$theme->css("debug.css");
|
2009-01-01 00:16:08 +00:00
|
|
|
}
|
2009-02-09 07:29:24 +00:00
|
|
|
|
2009-06-14 22:27:26 -07:00
|
|
|
if (module::is_active("rss")) {
|
|
|
|
|
if ($item = $theme->item()) {
|
2009-07-21 11:25:03 -07:00
|
|
|
if ($item->is_album()) {
|
|
|
|
|
$buf .= rss::feed_link("gallery/album/{$item->id}");
|
|
|
|
|
} else {
|
|
|
|
|
$buf .= rss::feed_link("gallery/album/{$item->parent()->id}");
|
|
|
|
|
}
|
2009-06-14 22:27:26 -07:00
|
|
|
} else if ($tag = $theme->tag()) {
|
2009-06-16 23:51:18 -07:00
|
|
|
$buf .= rss::feed_link("tag/tag/{$tag->id}");
|
2009-06-14 22:27:26 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-13 12:46:27 -07:00
|
|
|
if (count(locales::installed())) {
|
|
|
|
|
// Needed by the languages block
|
|
|
|
|
$theme->script("jquery.cookie.js");
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-07-22 14:27:57 -07:00
|
|
|
$theme->css("l10n_client.css");
|
|
|
|
|
$theme->script("jquery.cookie.js");
|
|
|
|
|
$theme->script("l10n_client.js");
|
2009-02-09 07:29:24 +00:00
|
|
|
}
|
|
|
|
|
|
2009-11-09 13:54:55 -08:00
|
|
|
$theme->css("uploadify/uploadify.css");
|
2009-01-03 05:36:16 +00:00
|
|
|
return $buf;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-14 04:12:02 +00:00
|
|
|
static function admin_head($theme) {
|
2009-11-05 21:35:40 -08:00
|
|
|
$theme->css("gallery.css");
|
2009-08-06 22:22:24 +08:00
|
|
|
$theme->script("gallery.panel.js");
|
2009-03-09 00:03:04 +00:00
|
|
|
$session = Session::instance();
|
|
|
|
|
if ($session->get("debug")) {
|
2009-07-22 14:27:57 -07:00
|
|
|
$theme->css("debug.css");
|
2009-01-01 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-07-22 14:27:57 -07:00
|
|
|
$theme->css("l10n_client.css");
|
|
|
|
|
$theme->script("jquery.cookie.js");
|
|
|
|
|
$theme->script("l10n_client.js");
|
2009-02-09 07:29:24 +00:00
|
|
|
}
|
2009-02-10 05:12:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static function page_bottom($theme) {
|
2009-03-09 00:03:04 +00:00
|
|
|
$session = Session::instance();
|
|
|
|
|
if ($session->get("profiler", false)) {
|
2008-12-10 04:23:48 +00:00
|
|
|
$profiler = new Profiler();
|
|
|
|
|
$profiler->render();
|
|
|
|
|
}
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-02-10 05:12:31 +00:00
|
|
|
return L10n_Client_Controller::l10n_form();
|
|
|
|
|
}
|
2009-03-08 21:21:09 +00:00
|
|
|
|
2009-09-10 21:12:15 -07:00
|
|
|
if ($session->get("after_install")) {
|
2009-03-09 00:03:04 +00:00
|
|
|
$session->delete("after_install");
|
2009-09-10 21:10:20 -07:00
|
|
|
return new View("welcome_message_loader.html");
|
2009-03-08 21:21:09 +00:00
|
|
|
}
|
2008-11-25 04:37:21 +00:00
|
|
|
}
|
2008-12-20 00:52:20 +00:00
|
|
|
|
2009-01-14 04:12:02 +00:00
|
|
|
static function admin_page_bottom($theme) {
|
2009-03-09 00:03:04 +00:00
|
|
|
$session = Session::instance();
|
|
|
|
|
if ($session->get("profiler", false)) {
|
2008-12-22 03:53:36 +00:00
|
|
|
$profiler = new Profiler();
|
|
|
|
|
$profiler->render();
|
|
|
|
|
}
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-02-10 05:12:31 +00:00
|
|
|
return L10n_Client_Controller::l10n_form();
|
|
|
|
|
}
|
2008-12-22 03:53:36 +00:00
|
|
|
}
|
2009-05-21 02:00:17 +00:00
|
|
|
|
|
|
|
|
static function credits() {
|
2009-10-26 23:08:05 -06:00
|
|
|
return "<li class=\"g-first\">" .
|
2009-05-29 20:24:42 -07:00
|
|
|
t(module::get_var("gallery", "credits"),
|
2009-07-14 10:56:10 -07:00
|
|
|
array("url" => "http://gallery.menalto.com", "version" => gallery::VERSION)) .
|
2009-05-21 02:00:17 +00:00
|
|
|
"</li>";
|
|
|
|
|
}
|
2009-05-21 02:03:21 +00:00
|
|
|
|
|
|
|
|
static function admin_credits() {
|
2009-05-27 16:15:00 -07:00
|
|
|
return gallery_theme::credits();
|
2009-05-21 02:03:21 +00:00
|
|
|
}
|
2009-07-29 17:25:53 -07:00
|
|
|
|
2009-07-30 09:54:59 -07:00
|
|
|
static function body_attributes() {
|
2009-07-29 17:25:53 -07:00
|
|
|
if (locales::is_rtl()) {
|
|
|
|
|
return 'class="rtl"';
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-11-25 04:37:21 +00:00
|
|
|
}
|