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.php3
-rw-r--r--modules/gallery/helpers/item.php45
2 files changed, 2 insertions, 46 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 301432d4..0303c9cb 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -109,6 +109,7 @@ class gallery_event_Core {
->label(t("Login")));
} else {
$csrf = access::csrf_token();
+ $item = $theme->item();
$menu->append(Menu::factory("dialog")
->id("user_menu_edit_profile")
->css_id("g-user-profile-link")
@@ -119,7 +120,7 @@ class gallery_event_Core {
->id("user_menu_logout")
->css_id("g-logout-link")
->url(url::site("logout?csrf=$csrf&continue=" .
- urlencode(url::current(true))))
+ urlencode($item->url())))
->label(t("Logout")));
}
}
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index fc390e70..f6181f8a 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -96,51 +96,6 @@ class item_Core {
}
}
-
- static function update($item, $fields) {
- $dirty = false;
- if ($item->id != 1 && !empty($fields["name"]) && $fields["name"] != $item->name) {
- $item->rename($fields["name"]);
- unset($fields["name"]);
- $dirty = true;
- }
- foreach ($fields as $field => $value) {
- if ($value !== $item->$field) {
- $item->$field = $value;
- $dirty = true;
- }
- }
-
- if ($dirty) {
- $item->save();
- }
- }
-
- static function check_for_conflicts($item, $new_name, $new_slug) {
- $errors = array();
-
- if ($row = db::build()
- ->select(array("name", "slug"))
- ->from("items")
- ->where("parent_id", "=", $item->parent_id)
- ->where("id", "<>", $item->id)
- ->and_open()
- ->where("name", "=", $new_name)
- ->or_where("slug", "=", $new_slug)
- ->close()
- ->execute()
- ->current()) {
- if ($row->name == $new_name) {
- $errors["name_conflict"] = 1;
- }
- if ($row->slug == $new_slug) {
- $errors["slug_conflict"] = 1;
- }
- }
-
- return $errors;
- }
-
/**
* Sanitize a filename into something presentable as an item title
* @param string $filename