mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-12 07:39:07 -04:00
Minor tweaks to the way that we turn the add photos item into a menu
to make it a little more robust.
This commit is contained in:
@@ -39,29 +39,25 @@ class server_add_menu_Core {
|
||||
->id("server_add")
|
||||
->label(t("Add from server"))
|
||||
->url(url::site("server_add/index/$item->id"));
|
||||
$options_menu = $menu->get("options_menu");
|
||||
$add_photos_item = $menu->get("add_photos_item");
|
||||
$add_photos_menu = $menu->get("add_photos_menu");
|
||||
|
||||
if ($add_photos_item && !$add_photos_menu) {
|
||||
// Assuming that $add_menu is unset, create add_menu and add our item
|
||||
$menu->add_after(
|
||||
"home",
|
||||
"add_photos_item",
|
||||
Menu::factory("submenu")
|
||||
->id("add_photos_menu")
|
||||
->label(t("Add Photos"))
|
||||
->label($add_photos_item->label)
|
||||
->append(Menu::factory("dialog")
|
||||
->id("add_photos_submenu_item")
|
||||
->label(t("via Simple Uploader"))
|
||||
->url(url::site("simple_uploader/app/$item->id")))
|
||||
->label(t("Simple Uploader"))
|
||||
->url($add_photos_item->url))
|
||||
->append($server_add));
|
||||
$menu->remove("add_photos_item");
|
||||
} else if ($add_photos_menu) {
|
||||
// Append to the existing sub-menu
|
||||
$add_photos_menu->append($server_add);
|
||||
} else {
|
||||
// Else just add it in at the end of Options
|
||||
$options_menu->append($server_add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user