From c693a2ba728493dde3fa16cde1022ef026baeb13 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 12 Nov 2009 15:57:13 -0500 Subject: [PATCH] Updated for new sidebar code. --- .../controllers/latestupdates.php | 18 +++++---- ...ates_theme.php => latestupdates_block.php} | 40 +++++++++++-------- modules/latestupdates/views/updates.html.php | 33 --------------- 3 files changed, 34 insertions(+), 57 deletions(-) rename modules/latestupdates/helpers/{latestupdates_theme.php => latestupdates_block.php} (52%) delete mode 100644 modules/latestupdates/views/updates.html.php diff --git a/modules/latestupdates/controllers/latestupdates.php b/modules/latestupdates/controllers/latestupdates.php index 7ccd7ef1..f68a3cb4 100644 --- a/modules/latestupdates/controllers/latestupdates.php +++ b/modules/latestupdates/controllers/latestupdates.php @@ -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; } diff --git a/modules/latestupdates/helpers/latestupdates_theme.php b/modules/latestupdates/helpers/latestupdates_block.php similarity index 52% rename from modules/latestupdates/helpers/latestupdates_theme.php rename to modules/latestupdates/helpers/latestupdates_block.php index 69f3d72e..0bd7157d 100644 --- a/modules/latestupdates/helpers/latestupdates_theme.php +++ b/modules/latestupdates/helpers/latestupdates_block.php @@ -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 { - - static function sidebar_blocks($theme) { - if (!$theme->item()) { - return; - } - $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") - ); +class latestupdates_block_Core { + static function get_site_list() { + return array("latestupdates" => t("Latest Updates")); + } + 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; + } return $block; } } diff --git a/modules/latestupdates/views/updates.html.php b/modules/latestupdates/views/updates.html.php deleted file mode 100644 index a7929a0a..00000000 --- a/modules/latestupdates/views/updates.html.php +++ /dev/null @@ -1,33 +0,0 @@ - - - -
-

- html::clean($q)) ?> - - - pager() ?> - - -

- - -