1
0

Subsume movie_3nids controller into the standard movies controller,

and have page.html.php just render the movie content directly instead
of wrapping it in the page chrome.
This commit is contained in:
Bharat Mediratta 2009-11-27 16:12:59 -08:00
parent d8807a7ad8
commit bbd14d449d
5 changed files with 54 additions and 141 deletions

View File

@ -1,33 +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 Movie_3nids_Controller extends Items_Controller {
public function show($item_id) {
$item = ORM::factory("item", $item_id);
access::required("view", $item);
$view = new Theme_View("movie_3nids.html", "other", "page");
$view->item = $item;
$view->attrs = array(
"class" => "g-movie", "id" => "g-movie-id-{$item->id}",
"style" => "display:block;width:{$item->width}px;height:{$item->height}px");
print $view;
}
}

View File

@ -26,7 +26,7 @@ class theme_3nids_Core {
access::required("view", $item);
$photo_size = module::get_var("3nids", "photo_size");
if ($photo_size == "full"){
if ($photo_size == "full" || $item->is_movie()){
$width = $item->width;
$height = $item->height;
}else{
@ -79,6 +79,12 @@ class theme_3nids_Core {
}
} else if ($item->is_album() && $view_type != "header") {
$link .= "<a href=\"" . $item->url() . "\">";
} else {
// NOTE: we don't want to open an <a> here because $view_type is "header", but lower down
// we're going to close one, so that's going to generate a mismatch. For now, just open a
// link anyway.
// @todo: figure out what we really should be doing here.
$link .= "<a href=\"" . $item->url() . "\">";
}
if ($view_type != "header") {

View File

@ -1,39 +1,45 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-item">
<?= $theme->photo_top() ?>
<? /*
<ul class="g-pager">
<li>
<? if ($previous_item): ?>
<a href="<?= $previous_item->url() ?>" class="g-button ui-icon-left ui-state-default ui-corner-all">
<span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
<? else: ?>
<a class="g-button ui-icon-left ui-state-disabled ui-corner-all">
<span class="ui-icon ui-icon-triangle-1-w"></span><?= t("previous") ?></a>
<? endif; ?>
</li>
<li class="g-info"><?= t("%position of %total", array("position" => $position, "total" => $sibling_count)) ?></li>
<li class="g-text-right">
<? if ($next_item): ?>
<a href="<?= $next_item->url() ?>" class="g-button ui-icon-right ui-state-default ui-corner-all">
<span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
<? else: ?>
<a class="g-button ui-icon-right ui-state-disabled ui-corner-all">
<span class="ui-icon ui-icon-triangle-1-e"></span><?= t("next") ?></a>
<? endif ?>
</li>
</ul>
*/ ?>
<?= $item->movie_img(array("class" => "g-movie", "id" => "g-movie-id-{$item->id}")) ?>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
<?= $theme->photo_bottom() ?>
<?= $theme->context_menu($item, "#g-movie-id-{$item->id}") ?>
</div>
<!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->script("flowplayer.js") ?>
<?= $theme->head() ?>
</head>
<body class="g-fancy-iframe-body">
<center>
<div id="g-item-box" width="<?=20+($item->width)?>" height="<?=50+($item->height)?>">
<?= $item->movie_img(
array("class" => "g-movie", "id" => "g-movie-id-{$item->id}",
"style" => "display:block;width:{$item->width}px;height:{$item->height}px")) ?>
<?= $theme->context_menu($item, "#g-movie-id-{$item->id}") ?>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
</div>
</body>
</html>

View File

@ -1,67 +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->script("flowplayer.js") ?>
<?= $theme->head() ?>
</head>
<body class="g-fancy-iframe-body">
<center>
<div id="g-item-box" width="<?=20+($item->width)?>" height="<?=50+($item->height)?>">
<?= html::anchor($item->file_url(true), "", $attrs) ?>
<script>
flowplayer(
"<?= $attrs["id"] ?>",
{
src: "<?= url::abs_file("lib/flowplayer.swf") ?>",
wmode: "transparent"
},
{
plugins: {
h264streaming: {
url: "<?= url::abs_file("lib/flowplayer.h264streaming.swf") ?>"
},
controls: {
autoHide: 'always',
hideDelay: 2000
}
}
}
)
</script>
<?= $theme->context_menu($item, "#g-movie-id-{$item->id}") ?>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
</div>
</body>
</html>

View File

@ -1,6 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? if ($page_subtype == "photo"): ?>
<? print new View("photo.html") ?>
<? /* Don't show the extra chrome for photo and movie pages */ ?>
<? if ($page_subtype == "photo" || $page_subtype == "movie"): ?>
<?= $content ?>
<? return ?>
<? endif ?>