summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhilden <jakobhilden@gmail.com>2009-06-02 19:31:11 -0400
committerjhilden <jakobhilden@gmail.com>2009-06-02 19:31:11 -0400
commitdde5fb96ee9db5a67b286ea4ac4f35190453a6ef (patch)
treeeb0e52aa07335eeb20a2d1d4eee9f8e2065e12a2
parent01c577479420997508b2600138d60eff88781ac7 (diff)
made "Add photos" its own site menu item
* open for suggestions on the submenu item labels * @bharat: not sure about the add photos menu item id in the dropdown case
-rw-r--r--modules/gallery/helpers/gallery_menu.php13
-rw-r--r--modules/server_add/helpers/server_add_menu.php25
2 files changed, 22 insertions, 16 deletions
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php
index 09c2d91a..d28e71c9 100644
--- a/modules/gallery/helpers/gallery_menu.php
+++ b/modules/gallery/helpers/gallery_menu.php
@@ -30,7 +30,14 @@ class gallery_menu_Core {
$can_edit = $item && access::can("edit", $item) || $is_admin;
$can_add = $item && (access::can("add", $item) || $is_admin);
-
+
+ if ($can_add) {
+ $menu->append(Menu::factory("dialog")
+ ->id("add_photos_item")
+ ->label(t("Add photos"))
+ ->url(url::site("simple_uploader/app/$item->id")));
+ }
+
if ($item && $can_edit || $can_add) {
$menu->append($options_menu = Menu::factory("submenu")
->id("options_menu")
@@ -49,10 +56,6 @@ class gallery_menu_Core {
if ($can_add) {
$options_menu
->append(Menu::factory("dialog")
- ->id("add_item")
- ->label(t("Add a photo"))
- ->url(url::site("simple_uploader/app/$item->id")))
- ->append(Menu::factory("dialog")
->id("add_album")
->label(t("Add an album"))
->url(url::site("form/add/albums/$item->id?type=album")));
diff --git a/modules/server_add/helpers/server_add_menu.php b/modules/server_add/helpers/server_add_menu.php
index a97a6cee..f02223f7 100644
--- a/modules/server_add/helpers/server_add_menu.php
+++ b/modules/server_add/helpers/server_add_menu.php
@@ -40,22 +40,25 @@ class server_add_menu_Core {
->label(t("Add from server"))
->url(url::site("server_add/index/$item->id"));
$options_menu = $menu->get("options_menu");
- $add_item = $options_menu->get("add_item");
- $add_menu = $options_menu->get("add_menu");
+ $add_photos_item = $menu->get("add_photos_item");
+ $add_photos_menu = $menu->get("add_photos_menu");
- if ($add_item && !$add_menu) {
+ if ($add_photos_item && !$add_photos_menu) {
// Assuming that $add_menu is unset, create add_menu and add our item
- $options_menu->add_after(
- "add_item",
+ $menu->add_after(
+ "home",
Menu::factory("submenu")
- ->id("add_menu")
- ->label(t("Add"))
- ->append($add_item)
+ ->id("add_photos_menu")
+ ->label(t("Add Photos"))
+ ->append(Menu::factory("dialog")
+ ->id("add_photos_submenu_item")
+ ->label(t("via Simple Uploader"))
+ ->url(url::site("simple_uploader/app/$item->id")))
->append($server_add));
- $options_menu->remove("add_item");
- } else if ($add_menu) {
+ $menu->remove("add_photos_item");
+ } else if ($add_photos_menu) {
// Append to the existing sub-menu
- $add_menu->append($server_add);
+ $add_photos_menu->append($server_add);
} else {
// Else just add it in at the end of Options
$options_menu->append($server_add);