1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/modules/downloadfullsize/helpers/downloadfullsize_theme.php

58 lines
1.9 KiB
PHP
Raw Normal View History

<?php defined("SYSPATH") or die("No direct script access.");
/**
2009-06-20 20:52:47 +00:00
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 Bharat Mediratta
*
* 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.
*/
class downloadfullsize_theme {
2009-09-16 23:08:16 +00:00
static function head($theme) {
if (!$theme->item()) {
return;
}
return new View("downloadfullsize_header_block.html");
}
2009-06-20 20:52:47 +00:00
static function sidebar_blocks($theme) {
$item = $theme->item();
2009-09-16 23:08:16 +00:00
if ($item && $item->is_movie() && access::can("view_full", $item)) {
if (module::get_var("downloadfullsize", "tButton")) {
$block = new Block();
$block->css_id = "g-download-fullsize";
2009-09-16 23:08:16 +00:00
$block->title = t("Download");
$block->content = new View("downloadfullsize_block.html");
$block->content->item = ORM::factory("item", 1);
return $block;
}
}
if ($item && $item->is_photo() && access::can("view_full", $item)) {
if (module::get_var("downloadfullsize", "tButton")) {
$block = new Block();
$block->css_id = "g-download-fullsize";
$block->title = t("Download");
$block->content = new View("downloadfullsize_block.html");
$block->content->item = ORM::factory("item", 1);
return $block;
}
}
}
2009-06-20 20:52:47 +00:00
}