1
0

Get rid of the specialized photos_3nids controller and use the base

photos controller.  Override photo.html.php to do the simplified
rendering of the image in a lightbox.
This commit is contained in:
Bharat Mediratta 2009-11-27 15:34:48 -08:00
parent 7f3c8db181
commit 481da56ead
4 changed files with 15 additions and 79 deletions

View File

@ -1,36 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* 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 Photo_3nids_Controller extends Items_Controller {
public function show($item_id) {
$item = ORM::factory("item", $item_id);
access::required("view", $item);
$view = new Theme_View("photo_3nids.html", "other", "page");
$view->item = $item;
$photo_size = module::get_var("3nids","photo_size");
if ($photo_size == "full"){
$view->item_url = $item->file_url();
} else {
$view->item_url = $item->resize_url();
}
print $view;
}
}

View File

@ -1,4 +1,9 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? if ($page_subtype == "photo"): ?>
<? print new View("photo.html") ?>
<? return ?>
<? endif ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@ -28,7 +33,7 @@
<?= $theme->css("superfish/css/superfish.css") ?>
<?= $theme->css("themeroller/ui.base.css") ?>
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<!--[if lt IE 8]>
@ -39,7 +44,7 @@
<? if ($thumb_proportion != 1): ?>
<? $new_width = $thumb_proportion * 180 ?>
<? $new_height = $thumb_proportion * 230 ?>
<style type="text/css">
<style type="text/css">
/*#g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;*/
@ -91,7 +96,7 @@
</a>
<? endif ?>
<div id="g-site-menu">
<? if ($user->admin): ?>
<? if ($user->admin): ?>
<?= $theme->site_menu() ?>
<? endif ?>
</div>
@ -132,7 +137,7 @@
</li>
</ul>
<? endif ?>
<? if (module::is_active("tagsmap")): ?>
<ul class="g-map-head">
<a href="<?= url::site("tagsmap/googlemap") ?>"><img src="<?= $theme->url("images/map.png") ?>"></a>

View File

@ -30,7 +30,12 @@
</head>
<body class="g-fancy-iframe-body">
<div id="g-item-box">
<img src="<?=$item_url?>" id="g-item-img"/>
<? if (module::get_var("3nids", "photo_size") == "full"): ?>
<img src="<?= $item->file_url() ?>" id="g-item-img"/>
<? else: ?>
<img src="<?= $item->resize_url() ?>" id="g-item-img"/>
<? endif ?>
<?= $theme->context_menu($item, "#g-item-id-{$item->id}") ?>
</div>
</body>

View File

@ -1,38 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<?= $theme->css("yui/reset-fonts-grids.css") ?>
<?= $theme->css("superfish/css/superfish.css") ?>
<?= $theme->css("themeroller/ui.base.css") ?>
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<?= $theme->script("jquery.easing.js") ?>
<?= $theme->script("jquery.fancybox.js") ?>
<?= $theme->script("ui.init.js") ?>
<?= $theme->head() ?>
</head>
<body class="g-fancy-iframe-body">
<div id="g-item-box">
<img src="<?=$item_url?>" id="g-item-img">
<?= $theme->context_menu($item, "#g-item-id-{$item->id}") ?>
</div>
</body>
</html>