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-01-18 05:01:00 +00:00
|
|
|
class core_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-03-09 00:03:04 +00:00
|
|
|
if ($session->get("debug")) {
|
2009-01-03 05:36:16 +00:00
|
|
|
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
2009-01-01 00:16:08 +00:00
|
|
|
url::file("core/css/debug.css") . "\" />";
|
|
|
|
|
}
|
2009-03-31 05:14:40 +00:00
|
|
|
if (($theme->page_type == "album" || $theme->page_type == "photo")
|
|
|
|
|
&& access::can("edit", $theme->item())) {
|
2009-01-03 05:36:16 +00:00
|
|
|
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
2009-01-04 19:54:38 +00:00
|
|
|
url::file("core/css/quick.css") . "\" />";
|
|
|
|
|
$buf .= html::script("core/js/quick.js");
|
2009-01-03 05:36:16 +00:00
|
|
|
}
|
2009-02-05 18:12:33 +00:00
|
|
|
if ($theme->page_type == "photo" && access::can("view_full", $theme->item())) {
|
|
|
|
|
$buf .= "<script type=\"text/javascript\" >" .
|
|
|
|
|
" var fullsize_detail = { " .
|
2009-02-08 00:42:17 +00:00
|
|
|
" close: \"" . url::file("core/images/ico-close.png") . "\", " .
|
|
|
|
|
" url: \"" . $theme->item()->file_url() . "\", " .
|
|
|
|
|
" width: " . $theme->item()->width . ", " .
|
|
|
|
|
" height: " . $theme->item()->height . "};" .
|
2009-02-05 18:12:33 +00:00
|
|
|
"</script>";
|
|
|
|
|
$buf .= html::script("core/js/fullsize.js");
|
|
|
|
|
}
|
2009-02-09 07:29:24 +00:00
|
|
|
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-02-09 07:29:24 +00:00
|
|
|
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
|
|
|
|
url::file("core/css/l10n_client.css") . "\" />";
|
|
|
|
|
$buf .= html::script("lib/jquery.cookie.js");
|
|
|
|
|
$buf .= html::script("core/js/l10n_client.js");
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-03 05:36:16 +00:00
|
|
|
return $buf;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-31 05:14:40 +00:00
|
|
|
static function resize_top($theme, $item) {
|
|
|
|
|
if (access::can("edit", $item)) {
|
2009-04-06 08:10:42 +00:00
|
|
|
$edit_link = url::site("quick/pane/$item->id?page_type=photo");
|
2009-03-31 05:14:40 +00:00
|
|
|
return "<div class=\"gQuick\" href=\"$edit_link\">";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static function resize_bottom($theme, $item) {
|
|
|
|
|
if (access::can("edit", $item)) {
|
|
|
|
|
return "</div>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-14 04:12:02 +00:00
|
|
|
static function thumb_top($theme, $child) {
|
2009-01-20 07:11:14 +00:00
|
|
|
if (access::can("edit", $child)) {
|
2009-04-06 08:10:42 +00:00
|
|
|
$edit_link = url::site("quick/pane/$child->id?page_type=album");
|
2009-01-05 08:05:50 +00:00
|
|
|
return "<div class=\"gQuick\" href=\"$edit_link\">";
|
2009-01-03 05:36:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-14 04:12:02 +00:00
|
|
|
static function thumb_bottom($theme, $child) {
|
2009-01-20 07:11:14 +00:00
|
|
|
if (access::can("edit", $child)) {
|
2009-01-03 05:36:16 +00:00
|
|
|
return "</div>";
|
|
|
|
|
}
|
2009-01-01 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-14 04:12:02 +00:00
|
|
|
static function admin_head($theme) {
|
2009-03-09 00:03:04 +00:00
|
|
|
$session = Session::instance();
|
2009-02-10 05:12:31 +00:00
|
|
|
$buf = "";
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("debug")) {
|
2009-02-10 05:12:31 +00:00
|
|
|
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
2009-01-01 00:16:08 +00:00
|
|
|
url::file("core/css/debug.css") . "\" />";
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-09 00:03:04 +00:00
|
|
|
if ($session->get("l10n_mode", false)) {
|
2009-02-10 05:12:31 +00:00
|
|
|
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
|
|
|
|
url::file("core/css/l10n_client.css") . "\" />";
|
|
|
|
|
$buf .= html::script("lib/jquery.cookie.js");
|
|
|
|
|
$buf .= html::script("core/js/l10n_client.js");
|
2009-02-09 07:29:24 +00:00
|
|
|
}
|
2009-02-10 05:12:31 +00:00
|
|
|
|
|
|
|
|
return $buf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-03-09 00:03:04 +00:00
|
|
|
if ($session->get("after_install")) {
|
|
|
|
|
$session->delete("after_install");
|
2009-03-08 21:21:09 +00:00
|
|
|
return new View("after_install_loader.html");
|
|
|
|
|
}
|
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
|
|
|
}
|
2008-11-25 04:37:21 +00:00
|
|
|
}
|