From b456ca582965cb8096bd2587d148613bdda391dd Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 15:00:08 +0000 Subject: [PATCH] elofgren: Replace the 'Reorder...' button with a 'Allow drag & drop reordering' checkbox as per: http://www.silverstripe.com/google-summer-of-code-forum/flat/1636?showPost=1859#post1859 (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42078 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain_left.js | 18 ++++++++---------- lang/en_US.php | 7 +++---- templates/Includes/CMSMain_left.ss | 10 +++++----- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/javascript/LeftAndMain_left.js b/javascript/LeftAndMain_left.js index 4e8e6653..15d6da40 100755 --- a/javascript/LeftAndMain_left.js +++ b/javascript/LeftAndMain_left.js @@ -12,8 +12,7 @@ SiteTreeHandlers.controller_url = 'admin'; var _HANDLER_FORMS = { addpage : 'Form_AddPageOptionsForm', - deletepage : 'deletepage_options', - sortitems : 'sortitems_options' + deletepage : 'deletepage_options' }; @@ -437,24 +436,23 @@ function fixHeight_left() { SiteTree.applyTo('#sitetree'); /** - * Reorganise action + * Reorganise action checkbox */ ReorganiseAction = Class.create(); ReorganiseAction.applyTo('#sortitems'); ReorganiseAction.prototype = { initialize: function () { - this.getElementsByTagName('button')[0].onclick = returnFalse; - Observable.applyTo($(_HANDLER_FORMS[this.id])); + this.isDraggable = false; }, onclick : function() { - if(treeactions.toggleSelection(this)) { + if (this.isDraggable == false) { $('sitetree').makeDraggable(); + this.isDraggable = true; + } else { + $('sitetree').stopBeingDraggable(); + this.isDraggable = false; } - }, - - onclose : function() { - $('sitetree').stopBeingDraggable(); } } diff --git a/lang/en_US.php b/lang/en_US.php index 3b102d6f..35730588 100755 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -133,13 +133,12 @@ $lang['en_US']['CMSMain_left.ss']['DELETE'] = array( 'Delete...', PR_HIGH ); -$lang['en_US']['CMSMain_left.ss']['REORDER'] = array( - 'Reorder...', - PR_HIGH +$lang['en_US']['CMSMain_left.ss']['ENABLEDRAGGING'] = array( + 'Allow drag & drop reordering', + PR_HIGH ); $lang['en_US']['CMSMain_left.ss']['SELECTPAGESDEL'] = 'Select the pages that you want to delete and then click the button below'; $lang['en_US']['CMSMain_left.ss']['DELETECONFIRM'] = 'Delete the selected pages'; -$lang['en_US']['CMSMain_left.ss']['DRAGPAGES'] = 'To reorganise your site, drag the pages around as desired.'; $lang['en_US']['CMSMain_left.ss']['SELECTPAGESDUP'] = 'Select the pages that you want to duplicate, whether it\'s children should be included, and where you want the duplicates placed'; $lang['en_US']['CMSMain_left.ss']['KEY'] = 'Key:'; $lang['en_US']['CMSMain_left.ss']['ADDEDNOTPUB'] = 'Added to the draft site and not published yet'; diff --git a/templates/Includes/CMSMain_left.ss b/templates/Includes/CMSMain_left.ss index 61a4890b..4b346499 100755 --- a/templates/Includes/CMSMain_left.ss +++ b/templates/Includes/CMSMain_left.ss @@ -11,7 +11,6 @@ @@ -34,6 +33,11 @@
+ <% end_control %> @@ -45,10 +49,6 @@ - - <% control DuplicatePagesOptionsForm %>