summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_event.php12
-rw-r--r--modules/gallery/helpers/item.php6
-rw-r--r--modules/gallery/helpers/theme.php3
3 files changed, 9 insertions, 12 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")
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index b3b6d0bb..8f96c3d9 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -124,11 +124,7 @@ class item_Core {
* @return string form
*/
static function get_delete_form($item) {
- if (Input::instance()->get("page_type") == "album") {
- $page_type = "album";
- } else {
- $page_type = "photo";
- }
+ $page_type = Input::instance()->get("page_type");
$form = new Forge(
"quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "g-confirm-delete"));
$form->hidden("_method")->value("put");
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php
index da57a37e..5a3a328a 100644
--- a/modules/gallery/helpers/theme.php
+++ b/modules/gallery/helpers/theme.php
@@ -38,7 +38,8 @@ class theme_Core {
if (!(identity::active_user()->admin && $theme_name = $input->get("theme"))) {
$theme_name = module::get_var(
"gallery",
- !strncmp($path, "/admin", 6) ? "active_admin_theme" : "active_site_theme");
+ $path == "/admin" || !strncmp($path, "/admin/", 7) ?
+ "active_admin_theme" : "active_site_theme");
}
$modules = Kohana::config("core.modules");
array_unshift($modules, THEMEPATH . $theme_name);