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
This commit is contained in:
Ingo Schommer 2007-09-16 15:00:08 +00:00
parent 9fcd82f172
commit b456ca5829
3 changed files with 16 additions and 19 deletions

View File

@ -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();
}
}

View File

@ -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';

View File

@ -11,7 +11,6 @@
<ul id="TreeActions">
<li class="action" id="addpage"><button><% _t('CREATE','Create...',PR_HIGH); %></button></li>
<li class="action" id="deletepage"><button><% _t('DELETE','Delete...',PR_HIGH); %></button></li>
<li class="action" id="sortitems"><button><% _t('REORDER','Reorder...',PR_HIGH); %></button></li>
<!-- <li class="action" id="duplicate"><a href="#">Duplicate</a></li>
Sam: this should be put into the Create area, I think, so we don't stuff up the layout -->
</ul>
@ -34,6 +33,11 @@
<div>
<input class="action" type="submit" value="Go" />
</div>
<div class="field dropdown nolabel" style="margin-top: 4px;">
<span class="middleColumn">
<input type="checkbox" id="sortitems" /> <label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag &amp; drop reordering', PR_HIGH); %></label>
</span>
</div>
</form>
<% end_control %>
@ -45,10 +49,6 @@
<input type="submit" value="<% _t('DELETECONFIRM','Delete the selected pages'); %>" />
</div>
</form>
<form class="actionparams" id="sortitems_options" style="display: none">
<p id="sortitems_message" style="margin: 0"><% _t('DRAGPAGES','To reorganise your site, drag the pages around as desired.'); %></p>
</form>
<% control DuplicatePagesOptionsForm %>
<form class="actionparams" id="duplicate_options" style="display: none" action="admin/duplicateSiteTree">