diff --git a/javascript/CMSMain_left.js b/javascript/CMSMain_left.js
index 6da820f6..edec030e 100755
--- a/javascript/CMSMain_left.js
+++ b/javascript/CMSMain_left.js
@@ -114,21 +114,7 @@ search.prototype = {
},
popupClosed : function() {
$(_HANDLER_FORMS.search).stopObserving(this.o2);
- // Reload the site tree if it has been filtered
- if ($('SiteTreeIsFiltered').value == 1) {
- // Show all items in Site Tree again
- new Ajax.Request( 'admin/SiteTreeAsUL' + '&ajax=1', {
- onSuccess: function( response ) {
- $('sitetree_ul').innerHTML = response.responseText;
- Behaviour.apply();
- $('SiteTreeIsFiltered').value = 0;
- statusMessage('Unfiltered tree','good');
- },
- onFailure : function(response) {
- errorMessage('Could not unfilter site tree
' + response.responseText);
- }
- });
- }
+ batchActionGlobals.unfilterSiteTree();
}
}
@@ -174,6 +160,33 @@ batchactions.prototype = {
}
}
+/**
+ * Show only drafts checkbox click action
+ */
+showonlydrafts = Class.create();
+showonlydrafts.applyTo('#publishpage_show_drafts');
+showonlydrafts.prototype = {
+ onclick : function() {
+ if (0 == $('SiteTreeIsFiltered').value) {
+ // Show all items in Site Tree again
+ new Ajax.Request( 'admin/filterSiteTree?Status=Saved&ajax=1', {
+ onSuccess: function( response ) {
+ $('sitetree_ul').innerHTML = response.responseText;
+ Behaviour.apply();
+ $('SiteTreeIsFiltered').value = 1;
+ statusMessage('Filtered tree to only show changed pages','good');
+ },
+ onFailure : function(response) {
+ errorMessage('Could not filter tree to only show changed pages
' + response.responseText);
+ }
+ });
+ } else {
+ batchActionGlobals.unfilterSiteTree();
+ }
+ }
+}
+
+
// batchActionGlobals is needed because calls to observeMethod doesn't seem to preserve instance variables so a Prototype can't be used
batchActionGlobals = {
selectedNodes: { },
@@ -240,6 +253,23 @@ batchActionGlobals = {
}
}
return csvIDs;
+ },
+ unfilterSiteTree : function() {
+ // Reload the site tree if it has been filtered
+ if ($('SiteTreeIsFiltered').value == 1) {
+ // Show all items in Site Tree again
+ new Ajax.Request( 'admin/SiteTreeAsUL' + '&ajax=1', {
+ onSuccess: function( response ) {
+ $('sitetree_ul').innerHTML = response.responseText;
+ Behaviour.apply();
+ $('SiteTreeIsFiltered').value = 0;
+ statusMessage('Unfiltered tree','good');
+ },
+ onFailure : function(response) {
+ errorMessage('Could not unfilter site tree
' + response.responseText);
+ }
+ });
+ }
}
}
diff --git a/lang/en_US.php b/lang/en_US.php
index 254cad8d..d9934bb6 100755
--- a/lang/en_US.php
+++ b/lang/en_US.php
@@ -155,6 +155,7 @@ $lang['en_US']['CMSMain_left.ss']['EDITEDSINCE'] = 'Edited Since';
$lang['en_US']['CMSMain_left.ss']['ADDSEARCHCRITERIA'] = 'Add Criteria...';
$lang['en_US']['CMSMain_left.ss']['SELECTPAGESACTIONS'] = 'Select the pages that you want to change & then click an action:';
$lang['en_US']['CMSMain_left.ss']['DELETECONFIRM'] = 'Delete the selected pages';
+$lang['en_US']['CMSMain_left.ss']['SHOWONLYCHANGED'] = 'Show only changed pages';
$lang['en_US']['CMSMain_left.ss']['PUBLISHCONFIRM'] = 'Publish the selected pages';
$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:';
diff --git a/templates/Includes/CMSMain_left.ss b/templates/Includes/CMSMain_left.ss
index 207d34ff..56007c40 100755
--- a/templates/Includes/CMSMain_left.ss
+++ b/templates/Includes/CMSMain_left.ss
@@ -73,6 +73,7 @@