summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Theme_View.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-17 13:42:51 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-17 14:04:45 -0800
commit1067e68292852f524fceda4c6cf7cd5f7110b234 (patch)
treeb42d9d2814a4a96bbdc63b5280cc22572402c0bb /modules/gallery/libraries/Theme_View.php
parentade642cff4a4ca810f468723b04efc6f229916d8 (diff)
Redesign the way that we consider page types to create buckets of page
types, and a subtype for specifics. Currently the top level bucket collection, item, other Here are the core subtypes so far: collection: album, search, tag item: movie, photo other: login, reset, comment-fragment, comment It's legal to create new page_subtypes whenever you want. Use the appropriate page_type to get the coarse grain behavior that you want.
Diffstat (limited to 'modules/gallery/libraries/Theme_View.php')
-rw-r--r--modules/gallery/libraries/Theme_View.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index e98914c4..07ba3bbf 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -23,11 +23,12 @@ class Theme_View_Core extends Gallery_View {
*
* @throws Kohana_Exception if the requested view cannot be found
* @param string $name view name
- * @param string $page_type page type: album, photo, tags, etc
+ * @param string $page_type page type: collection, item, or other
+ * @param string $page_subtype page sub type: album, photo, tags, etc
* @param string $theme_name view name
* @return void
*/
- public function __construct($name, $page_type) {
+ public function __construct($name, $page_type, $page_subtype) {
$theme_name = module::get_var("gallery", "active_site_theme");
if (!file_exists(THEMEPATH . $theme_name)) {
module::set_var("gallery", "active_site_theme", "wind");
@@ -45,8 +46,9 @@ class Theme_View_Core extends Gallery_View {
$this->set_global("theme", $this);
$this->set_global("user", identity::active_user());
$this->set_global("page_type", $page_type);
+ $this->set_global("page_subtype", $page_subtype);
$this->set_global("page_title", null);
- if ($page_type == "album") {
+ if ($page_type == "collection") {
$this->set_global("thumb_proportion", $this->thumb_proportion());
}
@@ -78,6 +80,10 @@ class Theme_View_Core extends Gallery_View {
return $this->page_type;
}
+ public function page_subtype() {
+ return $this->page_subtype;
+ }
+
public function user_menu() {
$menu = Menu::factory("root")
->css_id("g-login-menu")
@@ -143,12 +149,13 @@ class Theme_View_Core extends Gallery_View {
public function paginator() {
$v = new View("paginator.html");
$v->page_type = $this->page_type;
+ $v->page_subtype = $this->page_subtype;
$v->first_page_url = null;
$v->previous_page_url = null;
$v->next_page_url = null;
$v->last_page_url = null;
- if ($this->page_type == "album" || $this->page_type == "tag") {
+ if ($this->page_type == "collection") {
$v->page = $this->page;
$v->max_pages = $this->max_pages;
$v->total = $this->children_count;