Updated for new sidebar code.
This commit is contained in:
parent
4a3fd9b1b6
commit
c693a2ba72
@ -70,12 +70,13 @@ class latestupdates_Controller extends Controller {
|
||||
}
|
||||
|
||||
// Set up and display the actual page.
|
||||
$template = new Theme_View("page.html", "updates");
|
||||
$template = new Theme_View("page.html", "LatestUpdates");
|
||||
$template->page_title = t("Gallery :: Latest Updates");
|
||||
$template->set_global("page_size", $itemsPerPage);
|
||||
$template->set_global("children", $children);
|
||||
$template->set_global("children_count", $count);
|
||||
$template->content = new View("updates.html");
|
||||
$template->content->items = $children;
|
||||
$template->content->q = count($children);
|
||||
$template->content = new View("dynamic.html");
|
||||
$template->content->title = t("Latest Updates");
|
||||
print $template;
|
||||
}
|
||||
|
||||
@ -127,12 +128,13 @@ class latestupdates_Controller extends Controller {
|
||||
}
|
||||
|
||||
// Set up and display the actual page.
|
||||
$template = new Theme_View("page.html", "updates");
|
||||
$template = new Theme_View("page.html", "LatestUpdates");
|
||||
$template->page_title = t("Gallery :: Latest Updates");
|
||||
$template->set_global("page_size", $itemsPerPage);
|
||||
$template->set_global("children", $items);
|
||||
$template->set_global("children_count", $count);
|
||||
$template->content = new View("updates.html");
|
||||
$template->content->items = $items;
|
||||
$template->content->q = count($items);
|
||||
$template->content = new View ("dynamic.html");
|
||||
$template->content->title = t("Latest Updates");
|
||||
print $template;
|
||||
}
|
||||
|
||||
|
@ -17,23 +17,31 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
class latestupdates_theme_Core {
|
||||
class latestupdates_block_Core {
|
||||
static function get_site_list() {
|
||||
return array("latestupdates" => t("Latest Updates"));
|
||||
}
|
||||
|
||||
static function sidebar_blocks($theme) {
|
||||
if (!$theme->item()) {
|
||||
return;
|
||||
static function get($block_id, $theme) {
|
||||
$block = "";
|
||||
|
||||
switch ($block_id) {
|
||||
case "latestupdates":
|
||||
// Determine the ID# of the current album.
|
||||
$albumID = $theme->item->is_album() ? $theme->item->id : $theme->item->parent_id;
|
||||
|
||||
// Make a new sidebar block.
|
||||
$block = new Block();
|
||||
$block->css_id = "g-latest-updates";
|
||||
$block->title = t("Latest Updates");
|
||||
$block->content = new View("latestupdates_block.html");
|
||||
$block->content->batch_tag_form = $form;
|
||||
$block->content->update_links = array(
|
||||
"Entire Gallery" => url::site("latestupdates/updates"),
|
||||
"This Album" => url::site("latestupdates/albums/$albumID")
|
||||
);
|
||||
break;
|
||||
}
|
||||
$albumID = $theme->item->is_album() ? $theme->item->id : $theme->item->parent_id;
|
||||
|
||||
$block = new Block();
|
||||
$block->css_id = "g-updates-block";
|
||||
$block->title = t("Updates");
|
||||
$block->content = new View("latestupdates_block.html");
|
||||
$block->content->update_links = array(
|
||||
"Entire Gallery" => url::site("latestupdates/updates"),
|
||||
"This Album" => url::site("latestupdates/albums/$albumID")
|
||||
);
|
||||
|
||||
return $block;
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<? // @todo Set hover on AlbumGrid list items ?>
|
||||
|
||||
<div id="g-latest-updates">
|
||||
<h1><?= t("Latest Updates") ?></h1>
|
||||
<? array("term" => html::clean($q)) ?>
|
||||
<? if (count($items)): ?>
|
||||
<ul id="g-album-grid">
|
||||
<? foreach ($items as $item): ?>
|
||||
<? $item_class = "g-photo"; ?>
|
||||
<? if ($item->is_album()): ?>
|
||||
<? $item_class = "g-album"; ?>
|
||||
<? endif ?>
|
||||
<li class="g-item <?= $item_class ?>">
|
||||
<a href="<?= url::site("items/$item->id") ?>">
|
||||
<?= $item->thumb_img() ?>
|
||||
<p>
|
||||
<?= html::clean($item->title) ?>
|
||||
</p>
|
||||
<div>
|
||||
<?= html::clean($item->description) ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
</ul>
|
||||
<?= $theme->pager() ?>
|
||||
|
||||
<? else: ?>
|
||||
<p><?= t("There are no items to display.") ?></p>
|
||||
|
||||
<? endif; ?>
|
||||
</div>
|
Reference in New Issue
Block a user