From 51f6329a89be3382b7319b0add30283e9c9bce6a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 12 Sep 2009 17:11:10 -0700 Subject: Update version to "3.0 beta 3" --- modules/gallery/helpers/gallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/helpers/gallery.php') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 813134eb..a892287f 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0 git (pre-beta3)"; + const VERSION = "3.0 beta 3"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is -- cgit v1.2.3 From 8fa370c49fa28741d6ff1bd9ca4ccc1f70dc37af Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 13 Sep 2009 22:59:58 -0700 Subject: Set the version to "3.0 git (pre-RC1)" --- modules/gallery/helpers/gallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/helpers/gallery.php') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index a892287f..40e188e2 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0 beta 3"; + const VERSION = "3.0 git (pre-RC1)"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is -- cgit v1.2.3 From 4e6f2f1b4c489c21546c2ae685b814c42e689d71 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 18 Sep 2009 23:53:48 -0700 Subject: Don't display the add menu if the underlying operating system directory is not writable. THis should fix ticket #775 --- modules/gallery/helpers/gallery.php | 7 ++++++- modules/server_add/helpers/server_add_event.php | 13 ++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'modules/gallery/helpers/gallery.php') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 40e188e2..d5b2fed9 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -89,9 +89,11 @@ class gallery_Core { $item = $theme->item(); $can_edit = $item && access::can("edit", $item); + $is_album_writable = + is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path()); $can_add = $item && access::can("add", $item); - if ($can_add) { + if ($can_add && $is_album_writable) { $menu->append($add_menu = Menu::factory("submenu") ->id("add_menu") ->label(t("Add"))); @@ -105,6 +107,9 @@ class gallery_Core { ->label(t("Add an album")) ->url(url::site("form/add/albums/$item->id?type=album"))); } + } else if (!$is_album_writable) { + message::warning(t("The album '%album_name' is not writable.", + array("album_name" => $item->title))); } $menu->append($options_menu = Menu::factory("submenu") diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php index b9dd8c28..28996ee2 100644 --- a/modules/server_add/helpers/server_add_event.php +++ b/modules/server_add/helpers/server_add_event.php @@ -31,11 +31,14 @@ class server_add_event_Core { $paths = unserialize(module::get_var("server_add", "authorized_paths")); if ($item && user::active()->admin && $item->is_album() && !empty($paths)) { - $menu->get("add_menu") - ->append(Menu::factory("dialog") - ->id("server_add") - ->label(t("Server add")) - ->url(url::site("server_add/browse/$item->id"))); + $add_menu = $menu->get("add_menu"); + if ($add_menu) { + $add_menu + ->append(Menu::factory("dialog") + ->id("server_add") + ->label(t("Server add")) + ->url(url::site("server_add/browse/$item->id"))); + } } } } -- cgit v1.2.3 From cf89015a29f41321e49ea8024cc33bb0d6c68df1 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 19 Sep 2009 09:34:27 -0700 Subject: Change the fix for ticket #775 to always add the Add menu, but not add any items if the album directory is not writable. --- modules/gallery/helpers/gallery.php | 30 +++++++++++++------------ modules/server_add/helpers/server_add_event.php | 16 ++++++------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'modules/gallery/helpers/gallery.php') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index d5b2fed9..80ae65bd 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -89,27 +89,29 @@ class gallery_Core { $item = $theme->item(); $can_edit = $item && access::can("edit", $item); - $is_album_writable = - is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path()); $can_add = $item && access::can("add", $item); - if ($can_add && $is_album_writable) { + if ($can_add) { $menu->append($add_menu = Menu::factory("submenu") ->id("add_menu") ->label(t("Add"))); - $add_menu->append(Menu::factory("dialog") - ->id("add_photos_item") - ->label(t("Add photos")) - ->url(url::site("simple_uploader/app/$item->id"))); - if ($item->is_album()) { + $is_album_writable = + is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path()); + if ($is_album_writable) { $add_menu->append(Menu::factory("dialog") - ->id("add_album_item") - ->label(t("Add an album")) - ->url(url::site("form/add/albums/$item->id?type=album"))); + ->id("add_photos_item") + ->label(t("Add photos")) + ->url(url::site("simple_uploader/app/$item->id"))); + if ($item->is_album()) { + $add_menu->append(Menu::factory("dialog") + ->id("add_album_item") + ->label(t("Add an album")) + ->url(url::site("form/add/albums/$item->id?type=album"))); + } + } else { + message::warning(t("The album '%album_name' is not writable.", + array("album_name" => $item->title))); } - } else if (!$is_album_writable) { - message::warning(t("The album '%album_name' is not writable.", - array("album_name" => $item->title))); } $menu->append($options_menu = Menu::factory("submenu") diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php index 28996ee2..4db83f74 100644 --- a/modules/server_add/helpers/server_add_event.php +++ b/modules/server_add/helpers/server_add_event.php @@ -30,15 +30,13 @@ class server_add_event_Core { $item = $theme->item(); $paths = unserialize(module::get_var("server_add", "authorized_paths")); - if ($item && user::active()->admin && $item->is_album() && !empty($paths)) { - $add_menu = $menu->get("add_menu"); - if ($add_menu) { - $add_menu - ->append(Menu::factory("dialog") - ->id("server_add") - ->label(t("Server add")) - ->url(url::site("server_add/browse/$item->id"))); - } + if ($item && user::active()->admin && $item->is_album() && !empty($paths) && + is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path())) { + $menu->get("add_menu") + ->append(Menu::factory("dialog") + ->id("server_add") + ->label(t("Server add")) + ->url(url::site("server_add/browse/$item->id"))); } } } -- cgit v1.2.3