From 600e04b58cb19c53871e60abfe4a4d9deab6dc1e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 6 Jan 2011 12:02:01 -0800 Subject: Lock the drag zone if the album is not editable so that users don't start illegal drags. --- modules/organize/controllers/organize.php | 1 + modules/organize/views/organize_frame.html.php | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'modules/organize') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 82f74c9e..c53e7f66 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -55,6 +55,7 @@ class Organize_Controller extends Controller { $data = array( "sort_column" => $album->sort_column, "sort_order" => $album->sort_order, + "editable" => access::can("edit", $album), "children" => array()); foreach ($album->viewable()->children() as $child) { diff --git a/modules/organize/views/organize_frame.html.php b/modules/organize/views/organize_frame.html.php index cfc3933c..5516d7d8 100644 --- a/modules/organize/views/organize_frame.html.php +++ b/modules/organize/views/organize_frame.html.php @@ -53,6 +53,11 @@ thumb_data_view.bindStore(store); sort_column_combobox.setValue(album_info.sort_column); sort_order_combobox.setValue(album_info.sort_order); + if (album_info.editable) { + thumb_data_view.dragZone.unlock(); + } else { + thumb_data_view.dragZone.lock(); + } }, failure: show_generic_error }); -- cgit v1.2.3