diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-11-17 13:42:51 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-17 14:04:45 -0800 |
commit | 1067e68292852f524fceda4c6cf7cd5f7110b234 (patch) | |
tree | b42d9d2814a4a96bbdc63b5280cc22572402c0bb /modules/gallery/helpers/gallery_event.php | |
parent | ade642cff4a4ca810f468723b04efc6f229916d8 (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/helpers/gallery_event.php')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index cd72d01e..3139951f 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -98,7 +98,7 @@ class gallery_event_Core { } static function user_menu($menu, $theme) { - if ($theme->page_type != "login") { + if ($theme->page_subtype != "login") { $user = identity::active_user(); if ($user->guest) { $menu->append(Menu::factory("dialog") @@ -125,7 +125,7 @@ class gallery_event_Core { } static function site_menu($menu, $theme) { - if ($theme->page_type != "login") { + if ($theme->page_subtype != "login") { $menu->append(Menu::factory("link") ->id("home") ->label(t("Home")) @@ -271,6 +271,7 @@ class gallery_event_Core { if (access::can("edit", $item)) { $page_type = $theme->page_type(); + $page_subtype = $theme->page_subtype(); switch ($item->type) { case "movie": $edit_title = t("Edit this movie"); @@ -298,7 +299,6 @@ class gallery_event_Core { ->css_class("ui-icon-pencil") ->url(url::site("quick/form_edit/$item->id?page_type=$page_type"))); - if ($item->is_photo() && graphics::can("rotate")) { $options_menu ->append( @@ -319,9 +319,9 @@ class gallery_event_Core { ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&page_type=$page_type"))); } - // @todo Don't move photos from the photo page; we don't yet have a good way of redirecting after - // move - if ($page_type == "album") { + // @todo Don't move photos from the photo page; we don't yet have a good way of redirecting + // after move + if ($page_subtype == "album") { $options_menu ->append(Menu::factory("dialog") ->id("move") |