mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1590 from open-sausages/pulls/4.0/remove-asset-admin
API Remove AssetAdmin (moved to asset-admin module)
This commit is contained in:
commit
9493d9a104
@ -4,8 +4,6 @@ mappings:
|
||||
CMSBatchAction_Archive: SilverStripe\CMS\BatchActions\CMSBatchAction_Archive
|
||||
CMSBatchAction_Restore: SilverStripe\CMS\BatchActions\CMSBatchAction_Restore
|
||||
CMSBatchAction_Delete: SilverStripe\CMS\BatchActions\CMSBatchAction_Delete
|
||||
AssetAdmin: SilverStripe\CMS\Controllers\AssetAdmin
|
||||
AssetAdmin_DeleteBatchAction: SilverStripe\CMS\Controllers\AssetAdmin_DeleteBatchAction
|
||||
CMSMain: SilverStripe\CMS\Controllers\CMSMain
|
||||
CMSPageAddController: SilverStripe\CMS\Controllers\CMSPageAddController
|
||||
CMSPageEditController: SilverStripe\CMS\Controllers\CMSPageEditController
|
||||
|
107
client/dist/js/AssetAdmin.js
vendored
107
client/dist/js/AssetAdmin.js
vendored
@ -1,107 +0,0 @@
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define('ss.AssetAdmin', ['jQuery', 'i18n'], factory);
|
||||
} else if (typeof exports !== "undefined") {
|
||||
factory(require('jQuery'), require('i18n'));
|
||||
} else {
|
||||
var mod = {
|
||||
exports: {}
|
||||
};
|
||||
factory(global.jQuery, global.i18n);
|
||||
global.ssAssetAdmin = mod.exports;
|
||||
}
|
||||
})(this, function (_jQuery, _i18n) {
|
||||
'use strict';
|
||||
|
||||
var _jQuery2 = _interopRequireDefault(_jQuery);
|
||||
|
||||
var _i18n2 = _interopRequireDefault(_i18n);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
$('.AssetAdmin.cms-edit-form .ss-gridfield-item').entwine({
|
||||
onclick: function onclick(e) {
|
||||
if ($(e.target).closest('.action').length) {
|
||||
this._super(e);
|
||||
return;
|
||||
}
|
||||
|
||||
var grid = this.closest('.grid-field');
|
||||
if (this.data('class') == 'Folder') {
|
||||
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
|
||||
$('.cms-container').loadPanel(url);
|
||||
return false;
|
||||
}
|
||||
|
||||
this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form .grid-field .grid-field__col-compact .action.gridfield-button-delete, .AssetAdmin.cms-edit-form .btn-toolbar button.action.action-delete').entwine({
|
||||
onclick: function onclick(e) {
|
||||
var msg;
|
||||
if (this.closest('.ss-gridfield-item').data('class') == 'Folder') {
|
||||
msg = _i18n2.default._t('AssetAdmin.ConfirmDelete');
|
||||
} else {
|
||||
msg = _i18n2.default._t('TABLEFIELD.DELETECONFIRMMESSAGE');
|
||||
}
|
||||
if (!confirm(msg)) return false;
|
||||
|
||||
this.getGridField().reload({ data: [{ name: this.attr('name'), value: this.val() }] });
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form :submit[name=action_delete]').entwine({
|
||||
onclick: function onclick(e) {
|
||||
if (!confirm(_i18n2.default._t('AssetAdmin.ConfirmDelete'))) return false;else this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin .cms-add-folder-link').entwine({
|
||||
onclick: function onclick(e) {
|
||||
var name = prompt(_i18n2.default._t('Folder.Name'));
|
||||
if (!name) return false;
|
||||
|
||||
this.closest('.cms-container').loadPanel(this.data('url') + '&Name=' + name);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#Form_SyncForm').entwine({
|
||||
onsubmit: function onsubmit(e) {
|
||||
var button = jQuery(this).find(':submit:first');
|
||||
button.addClass('loading');
|
||||
$.ajax({
|
||||
url: jQuery(this).attr('action'),
|
||||
data: this.serializeArray(),
|
||||
success: function success() {
|
||||
button.removeClass('loading');
|
||||
|
||||
var currNode = $('.cms-tree')[0].firstSelected();
|
||||
if (currNode) {
|
||||
var url = $(currNode).find('a').attr('href');
|
||||
$('.cms-content').loadPanel(url);
|
||||
}
|
||||
$('.cms-tree')[0].setCustomURL('admin/assets/getsubtree');
|
||||
$('.cms-tree')[0].reload({ onSuccess: function onSuccess() {} });
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form .ss-uploadfield-item-progress').entwine({
|
||||
onunmatch: function onunmatch() {
|
||||
$('.AssetAdmin.cms-edit-form .grid-field').reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
34
client/dist/js/CMSMain.Tree.js
vendored
34
client/dist/js/CMSMain.Tree.js
vendored
@ -60,8 +60,8 @@
|
||||
'items': function items(node) {
|
||||
|
||||
var menuitems = {
|
||||
'edit': {
|
||||
'label': _i18n2.default._t('Tree.EditPage', 'Edit page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree'),
|
||||
edit: {
|
||||
'label': node.hasClass('edit-disabled') ? _i18n2.default._t('Tree.EditPage', 'Edit page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree') : _i18n2.default._t('Tree.ViewPage', 'View page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(_i18n2.default.sprintf(self.data('urlEditpage'), obj.data('id')));
|
||||
}
|
||||
@ -101,20 +101,22 @@
|
||||
};
|
||||
}
|
||||
|
||||
menuitems['duplicate'] = {
|
||||
'label': _i18n2.default._t('Tree.Duplicate'),
|
||||
'submenu': [{
|
||||
'label': _i18n2.default._t('Tree.ThisPageOnly'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel($.path.addSearchParams(_i18n2.default.sprintf(self.data('urlDuplicate'), obj.data('id')), self.data('extraParams')));
|
||||
}
|
||||
}, {
|
||||
'label': _i18n2.default._t('Tree.ThisPageAndSubpages'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel($.path.addSearchParams(_i18n2.default.sprintf(self.data('urlDuplicatewithchildren'), obj.data('id')), self.data('extraParams')));
|
||||
}
|
||||
}]
|
||||
};
|
||||
if (!node.hasClass('edit-disabled')) {
|
||||
menuitems['duplicate'] = {
|
||||
'label': _i18n2.default._t('Tree.Duplicate'),
|
||||
'submenu': [{
|
||||
'label': _i18n2.default._t('Tree.ThisPageOnly'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel($.path.addSearchParams(_i18n2.default.sprintf(self.data('urlDuplicate'), obj.data('id')), self.data('extraParams')));
|
||||
}
|
||||
}, {
|
||||
'label': _i18n2.default._t('Tree.ThisPageAndSubpages'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel($.path.addSearchParams(_i18n2.default.sprintf(self.data('urlDuplicatewithchildren'), obj.data('id')), self.data('extraParams')));
|
||||
}
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
||||
return menuitems;
|
||||
}
|
||||
|
2
client/dist/js/bundle-legacy.js
vendored
2
client/dist/js/bundle-legacy.js
vendored
@ -1,2 +1,2 @@
|
||||
!function t(e,n,i){function a(r,s){if(!n[r]){if(!e[r]){var d="function"==typeof require&&require;if(!s&&d)return d(r,!0);if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[r]={exports:{}};e[r][0].call(c.exports,function(t){var n=e[r][1][t];return a(n?n:t)},c,c.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)a(i[r]);return a}({1:[function(t,e,n){"use strict";t("../legacy/CMSMain.AddForm.js"),t("../legacy/CMSMain.EditForm.js"),t("../legacy/CMSMain.js"),t("../legacy/CMSMain.Tree.js"),t("../legacy/CMSPageHistoryController.js"),t("../legacy/RedirectorPage.js"),t("../legacy/SilverStripeNavigator.js"),t("../legacy/SiteTreeURLSegmentField.js")},{"../legacy/CMSMain.AddForm.js":2,"../legacy/CMSMain.EditForm.js":3,"../legacy/CMSMain.Tree.js":4,"../legacy/CMSMain.js":5,"../legacy/CMSPageHistoryController.js":6,"../legacy/RedirectorPage.js":7,"../legacy/SilverStripeNavigator.js":8,"../legacy/SiteTreeURLSegmentField.js":9}],2:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".cms-add-form .parent-mode :input").entwine({onclick:function(t){if("top"==this.val()){var e=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");e.setValue(""),e.setTitle("")}}}),t(".cms-add-form").entwine({ParentID:0,ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",function(){t.updateTypeList()}),this.find(".SelectionGroup.parent-mode").bind("change",function(){t.updateTypeList()}),this.updateTypeList()},loadCachedChildren:function(t){var e=this.getParentCache();return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function(t,e){var n=this.getParentCache();n[t]=e,this.setParentCache(n)},updateTypeList:function(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),i=this.find("input[name=ParentModeField]:checked").val(),a=n.data("metadata"),o=a&&"child"===i?n.getValue()||this.getParentID():null,r=a?a.ClassName:null,s=r&&"child"===i?r:"Root",d="undefined"!=typeof e[s]?e[s]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[];if(o){if(this.hasClass("loading"))return;return this.addClass("loading"),this.setParentID(o),n.getValue()||n.setValue(o),u=this.loadCachedChildren(o),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),data:{ParentID:o},success:function(t){l.saveCachedChildren(o,t),l.updateSelectionFilter(t,c)},complete:function(){l.removeClass("loading")}}),!1)}u=d&&"undefined"!=typeof d.disallowedChildren?d.disallowedChildren:[],this.updateSelectionFilter(u,c)},updateSelectionFilter:function(e,n){var i=null;if(this.find("#Form_AddForm_PageType div.radio").each(function(){var n=t(this).find("input").val(),a=-1===t.inArray(n,e);t(this).setEnabled(a),a||t(this).setSelected(!1),i=null===i?a:i&&a}),n)var a=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first");else var a=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1);var o=this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?"enable":"disable";this.find("button[name=action_doAdd]").button(o),this.find(".message-restricted")[i?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function(t){this.setSelected(!0)},setSelected:function(t){var e=this.find("input");t&&!e.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),e.prop("checked",!0)):(this.toggleClass("selected",!1),e.prop("checked",!1))},setEnabled:function(e){t(this).toggleClass("disabled",!e),e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-content-addpage-button").entwine({onclick:function(e){var n,i=t(".cms-tree"),a=t(".cms-list"),o=0;if(i.is(":visible")){var r=i.jstree("get_selected");o=r?t(r[0]).data("id"):null}else{var s=a.find('input[name="Page[GridState]"]').val();s&&(o=parseInt(JSON.parse(s).ParentID,10))}var d,l={selector:this.data("targetPanel"),pjax:this.data("pjax")};o?(n=this.data("extraParams")?this.data("extraParams"):"",d=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),o),n)):d=this.attr("href"),t(".cms-container").loadPanel(d,null,l),e.preventDefault(),this.blur()}})})},{jQuery:"jQuery"}],3:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function(){alert(s["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var e=this;e.data("OrigVal",e.val());var n=e.closest("form"),i=t("input:text[name=URLSegment]",n),a=t("input[name=LiveLink]",n);i.length>0&&(e._addActions(),this.bind("change",function(n){var o=e.data("OrigVal"),r=e.val();e.data("OrigVal",r),0===i.val().indexOf(i.data("defaultUrl"))&&""==a.val()?e.updateURLSegment(r):t(".update",e.parent()).show(),e.updateRelatedFields(r,o),e.updateBreadcrumbLabel(r)})),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var i=t(this);i.val()==n&&(i.val(e),i.updatedRelatedFields&&i.updatedRelatedFields())})},updateURLSegment:function(e){var n=t("input:text[name=URLSegment]",this.closest("form")),i=n.closest(".field.urlsegment"),a=t(".update",this.parent());i.update(e),a.is(":visible")&&a.hide()},updateBreadcrumbLabel:function(e){var n=(t(".cms-edit-form input[name=ID]").val(),t("span.cms-panel-link.crumb"));e&&""!=e&&n.text(e)},_addActions:function(){var e,n=this;e=t("<button />",{"class":"update ss-ui-button-small",text:s["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function(t){t.preventDefault(),n.updateURLSegment(n.val())}}),e.insertAfter(n),e.hide()}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function(){var t=this;this.find(":input[name=ParentType]").bind("click",function(e){t._toggleSelection(e)}),this.find(".TreeDropdownField").bind("change",function(e){t._changeParentId(e)}),this._changeParentId(),this._toggleSelection(),this._super()},onunmatch:function(){this._super()},_toggleSelection:function(e){var n=this.find(":input[name=ParentType]:checked").val(),i=this.find("#Form_EditForm_ParentID_Holder");"root"==n?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),"root"!=n?i.slideDown(400,function(){t(this).css("overflow","visible")}):i.slideUp()},_changeParentId:function(t){var e=this.find(":input[name=ParentID]").val();this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue",e)}}),t(".cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType").entwine({onmatch:function(){var e;"CanViewType"==this.attr("id")?e=t("#Form_EditForm_ViewerGroups_Holder"):"CanEditType"==this.attr("id")?e=t("#Form_EditForm_EditorGroups_Holder"):"CanCreateTopLevelType"==this.attr("id")&&(e=t("#Form_EditForm_CreateTopLevelGroups_Holder")),this.find(".optionset :input").bind("change",function(n){var i=t(this).closest(".middleColumn").parent("div");"OnlyTheseUsers"==n.target.value?(i.addClass("remove-splitter"),e.show()):(i.removeClass("remove-splitter"),e.hide())});var n=this.find("input[name="+this.attr("id")+"]:checked").val();e["OnlyTheseUsers"==n?"show":"hide"](),this._super()},onunmatch:function(){this._super()}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_print").entwine({onclick:function(e){var n=t(this[0].form).attr("action").replace(/\?.*$/,"")+"/printable/"+t(":input[name=ID]",this[0].form).val();return"http://"!=n.substr(0,7)&&(n=t("base").attr("href")+n),window.open(n,"printable"),!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_rollback").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=n?s["default"].sprintf(s["default"]._t("CMSMain.RollbackToVersion"),n):s["default"]._t("CMSMain.ConfirmRestoreFromLive"),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_archive").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Archive"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_restore").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="",a=this.data("toRoot");return i=s["default"].sprintf(s["default"]._t(a?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_delete").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.DeleteFromDraft"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_unpublish").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Unpublish"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form.changed").entwine({onmatch:function(t){this.find("button[name=action_save]").button("option","showingAlternate",!0),this.find("button[name=action_publish]").button("option","showingAlternate",!0),this._super(t)},onunmatch:function(t){var e=this.find("button[name=action_save]");e.data("button")&&e.button("option","showingAlternate",!1);var n=this.find("button[name=action_publish]");n.data("button")&&n.button("option","showingAlternate",!1),this._super(t)}}),t(".cms-edit-form .btn-toolbar button[name=action_publish]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t(".cms-edit-form .btn-toolbar button[name=action_save]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function(){this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder");"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()})},{i18n:"i18n",jQuery:"jQuery"}],4:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function(t){this.adjustContextClass()}},adjustContextClass:function(){var e=t("#vakata-contextmenu").find("ul ul");e.each(function(n){var i="1",a=t(e[n]).find("li").length;a>20?i="3":a>10&&(i="2"),t(e[n]).addClass("col-"+i).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function(){var e=this,n=this._super();this.getHints();return n.plugins.push("contextmenu"),n.contextmenu={items:function(n){var i={edit:{label:s["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(s["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}};n.hasClass("nochildren")||(i.showaslist={label:s["default"]._t("Tree.ShowAsList"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}});var a=(n.data("pagetype"),n.data("id")),o=n.find(">a .item").data("allowedchildren"),r={},d=!1;return t.each(o,function(n,i){d=!0,r["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+i,_class:"class-"+n,action:function(i){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlAddpage"),a,n),e.data("extraParams")))}}}),d&&(i.addsubpage={label:s["default"]._t("Tree.AddSubPage","Add page under this page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),submenu:r}),i.duplicate={label:s["default"]._t("Tree.Duplicate"),submenu:[{label:s["default"]._t("Tree.ThisPageOnly"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))}},{label:s["default"]._t("Tree.ThisPageAndSubpages"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))}}]},i}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function(){var t,e=this,n=e.parents(".cms-panel-content");(e.offset().top<0||e.offset().top>n.height()-e.height())&&(t=n.scrollTop()+e.offset().top+n.height()/2,n.animate({scrollTop:t},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function(){window.location=location.protocol+"//"+location.host+location.pathname}}),t(".cms-tree-filtered").entwine({onmatch:function(){var e=this,n=function(){var n=t(".cms-content-tools .cms-panel-content").height()-e.parent().siblings(".cms-content-toolbar").outerHeight(!0);e.css("height",n+"px")};n(),t(window).on("resize",window.ss.debounce(n,300))}})})},{i18n:"i18n",jQuery:"jQuery"}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".cms-content-header-info").entwine({"from .cms-panel":{ontoggle:function(t){var e=this.closest(".cms-content").find(t.target);0!==e.length&&this.parent()[e.hasClass("collapsed")?"addClass":"removeClass"]("collapsed")}}}),t(".cms-content-toolbar").entwine({onmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this),i=n.data("toolid");n.hasClass("active");void 0!==i&&(n.data("active",!1).removeClass("active"),t("#"+i).hide(),e.bindActionButtonEvents(n))})},onunmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this);e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function(t){var e=this;t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function(t){t.off(".cmsContentToolbar")},showHideTool:function(e){var n=e.data("active"),i=e.data("toolid"),a=t("#"+i);t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"));e.data("toolid")!==i&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),a[n?"hide":"show"](),e.data("active",!n)}})})},{jQuery:"jQuery"}],6:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function(){this._super()},onunmatch:function(){this._super()},onsubmit:function(e,n){e.preventDefault();var i;if(i=this.find(":input[name=ID]").val(),!i)return!1;var a,o,r,d,l,c;if(c=this.find(":input[name=CompareMode]").is(":checked"),r=this.find("table input[type=checkbox]").filter(":checked"),c){if(2!=r.length)return!1;d=r.eq(0).val(),l=r.eq(1).val(),a=this.find(":submit[name=action_doCompare]"),o=s["default"].sprintf(this.data("linkTmplCompare"),i,l,d)}else d=r.eq(0).val(),a=this.find(":submit[name=action_doShowVersion]"),o=s["default"].sprintf(this.data("linkTmplShow"),i,d);t(".cms-container").loadPanel(o,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function(){this.toggle(),this._super()},onunmatch:function(){this._super()},onchange:function(){this.toggle()},toggle:function(){var e=t(this),n=e.parents("form");e.attr("checked")?n.find("tr[data-published=false]").show():n.find("tr[data-published=false]").hide()._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function(t){var e,n;return e=this.parents("form").find(":input[name=CompareMode]").attr("checked"),n=this.siblings(".active"),e&&this.hasClass("active")?void this._unselect():e?n.length>1?alert(s["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(),void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)},_select:function(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},{i18n:"i18n",jQuery:"jQuery"}],7:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t("#Form_EditForm_RedirectionType input").entwine({onmatch:function(){var e=t(this);e.attr("checked")&&this.toggle(),this._super()},onunmatch:function(){this._super()},onclick:function(){this.toggle()},toggle:function(){"Internal"==t(this).attr("value")?(t("#Form_EditForm_ExternalURL_Holder").hide(),t("#Form_EditForm_LinkToID_Holder").show()):(t("#Form_EditForm_ExternalURL_Holder").show(),t("#Form_EditForm_LinkToID_Holder").hide())}})})},{jQuery:"jQuery"}],8:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(t){var e=document.getElementsByTagName("base")[0].href.replace("http://","").replace(/\//g,"_").replace(/\./g,"_");return e+t}var o=t("jQuery"),r=i(o);(0,r["default"])(document).ready(function(){(0,r["default"])("#switchView a.newWindow").on("click",function(t){var e=window.open(this.href,a(this.target));return e.focus(),!1}),(0,r["default"])("#SilverStripeNavigatorLink").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").toggle(),!1}),(0,r["default"])("#SilverStripeNavigatorLinkPopup a.close").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").hide(),!1}),(0,r["default"])("#SilverStripeNavigatorLinkPopup input").on("focus",function(t){this.select()})})},{jQuery:"jQuery"}],9:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".field.urlsegment:not(.readonly)").entwine({MaxPreviewLength:55,Ellipsis:"...",onmatch:function(){this.find(":text").length&&this.toggleEdit(!1),this.redraw(),this._super()},redraw:function(){var t=this.find(":text"),e=decodeURI(t.data("prefix")+t.val()),n=e;e.length>this.getMaxPreviewLength()&&(n=this.getEllipsis()+e.substr(e.length-this.getMaxPreviewLength(),e.length)),this.find(".preview").attr("href",encodeURI(e+t.data("suffix"))).text(n)},toggleEdit:function(t){var e=this.find(":text");this.find(".preview-holder")[t?"hide":"show"](),this.find(".edit-holder")[t?"show":"hide"](),t&&(e.data("origval",e.val()),e.focus())},update:function(){var t=this,e=this.find(":text"),n=e.data("origval"),i=arguments[0],a=i&&""!==i?i:e.val();n!=a?(this.addClass("loading"),this.suggest(a,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function(){var t=this.find(":text");t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function(e,n){var i=this,a=i.find(":text"),o=t.path.parseUrl(i.closest("form").attr("action")),r=o.hrefNoSearch+"/field/"+a.attr("name")+"/suggest/?value="+encodeURIComponent(e);o.search&&(r+="&"+o.search.replace(/^\?/,"")),t.ajax({url:r,success:function(t){n.apply(this,arguments)},error:function(t,e){t.statusText=t.responseText},complete:function(){i.removeClass("loading")}})}}),t(".field.urlsegment .edit").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").cancel()}})})},{jQuery:"jQuery"}]},{},[1]);
|
||||
!function t(e,n,i){function a(r,s){if(!n[r]){if(!e[r]){var d="function"==typeof require&&require;if(!s&&d)return d(r,!0);if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[r]={exports:{}};e[r][0].call(c.exports,function(t){var n=e[r][1][t];return a(n?n:t)},c,c.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)a(i[r]);return a}({1:[function(t,e,n){"use strict";t("../legacy/CMSMain.AddForm.js"),t("../legacy/CMSMain.EditForm.js"),t("../legacy/CMSMain.js"),t("../legacy/CMSMain.Tree.js"),t("../legacy/CMSPageHistoryController.js"),t("../legacy/RedirectorPage.js"),t("../legacy/SilverStripeNavigator.js"),t("../legacy/SiteTreeURLSegmentField.js")},{"../legacy/CMSMain.AddForm.js":2,"../legacy/CMSMain.EditForm.js":3,"../legacy/CMSMain.Tree.js":4,"../legacy/CMSMain.js":5,"../legacy/CMSPageHistoryController.js":6,"../legacy/RedirectorPage.js":7,"../legacy/SilverStripeNavigator.js":8,"../legacy/SiteTreeURLSegmentField.js":9}],2:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".cms-add-form .parent-mode :input").entwine({onclick:function(t){if("top"==this.val()){var e=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");e.setValue(""),e.setTitle("")}}}),t(".cms-add-form").entwine({ParentID:0,ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",function(){t.updateTypeList()}),this.find(".SelectionGroup.parent-mode").bind("change",function(){t.updateTypeList()}),this.updateTypeList()},loadCachedChildren:function(t){var e=this.getParentCache();return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function(t,e){var n=this.getParentCache();n[t]=e,this.setParentCache(n)},updateTypeList:function(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),i=this.find("input[name=ParentModeField]:checked").val(),a=n.data("metadata"),o=a&&"child"===i?n.getValue()||this.getParentID():null,r=a?a.ClassName:null,s=r&&"child"===i?r:"Root",d="undefined"!=typeof e[s]?e[s]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[];if(o){if(this.hasClass("loading"))return;return this.addClass("loading"),this.setParentID(o),n.getValue()||n.setValue(o),u=this.loadCachedChildren(o),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),data:{ParentID:o},success:function(t){l.saveCachedChildren(o,t),l.updateSelectionFilter(t,c)},complete:function(){l.removeClass("loading")}}),!1)}u=d&&"undefined"!=typeof d.disallowedChildren?d.disallowedChildren:[],this.updateSelectionFilter(u,c)},updateSelectionFilter:function(e,n){var i=null;if(this.find("#Form_AddForm_PageType div.radio").each(function(){var n=t(this).find("input").val(),a=-1===t.inArray(n,e);t(this).setEnabled(a),a||t(this).setSelected(!1),i=null===i?a:i&&a}),n)var a=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first");else var a=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1);var o=this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?"enable":"disable";this.find("button[name=action_doAdd]").button(o),this.find(".message-restricted")[i?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function(t){this.setSelected(!0)},setSelected:function(t){var e=this.find("input");t&&!e.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),e.prop("checked",!0)):(this.toggleClass("selected",!1),e.prop("checked",!1))},setEnabled:function(e){t(this).toggleClass("disabled",!e),e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-content-addpage-button").entwine({onclick:function(e){var n,i=t(".cms-tree"),a=t(".cms-list"),o=0;if(i.is(":visible")){var r=i.jstree("get_selected");o=r?t(r[0]).data("id"):null}else{var s=a.find('input[name="Page[GridState]"]').val();s&&(o=parseInt(JSON.parse(s).ParentID,10))}var d,l={selector:this.data("targetPanel"),pjax:this.data("pjax")};o?(n=this.data("extraParams")?this.data("extraParams"):"",d=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),o),n)):d=this.attr("href"),t(".cms-container").loadPanel(d,null,l),e.preventDefault(),this.blur()}})})},{jQuery:"jQuery"}],3:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function(){alert(s["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var e=this;e.data("OrigVal",e.val());var n=e.closest("form"),i=t("input:text[name=URLSegment]",n),a=t("input[name=LiveLink]",n);i.length>0&&(e._addActions(),this.bind("change",function(n){var o=e.data("OrigVal"),r=e.val();e.data("OrigVal",r),0===i.val().indexOf(i.data("defaultUrl"))&&""==a.val()?e.updateURLSegment(r):t(".update",e.parent()).show(),e.updateRelatedFields(r,o),e.updateBreadcrumbLabel(r)})),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var i=t(this);i.val()==n&&(i.val(e),i.updatedRelatedFields&&i.updatedRelatedFields())})},updateURLSegment:function(e){var n=t("input:text[name=URLSegment]",this.closest("form")),i=n.closest(".field.urlsegment"),a=t(".update",this.parent());i.update(e),a.is(":visible")&&a.hide()},updateBreadcrumbLabel:function(e){var n=(t(".cms-edit-form input[name=ID]").val(),t("span.cms-panel-link.crumb"));e&&""!=e&&n.text(e)},_addActions:function(){var e,n=this;e=t("<button />",{"class":"update ss-ui-button-small",text:s["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function(t){t.preventDefault(),n.updateURLSegment(n.val())}}),e.insertAfter(n),e.hide()}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function(){var t=this;this.find(":input[name=ParentType]").bind("click",function(e){t._toggleSelection(e)}),this.find(".TreeDropdownField").bind("change",function(e){t._changeParentId(e)}),this._changeParentId(),this._toggleSelection(),this._super()},onunmatch:function(){this._super()},_toggleSelection:function(e){var n=this.find(":input[name=ParentType]:checked").val(),i=this.find("#Form_EditForm_ParentID_Holder");"root"==n?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),"root"!=n?i.slideDown(400,function(){t(this).css("overflow","visible")}):i.slideUp()},_changeParentId:function(t){var e=this.find(":input[name=ParentID]").val();this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue",e)}}),t(".cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType").entwine({onmatch:function(){var e;"CanViewType"==this.attr("id")?e=t("#Form_EditForm_ViewerGroups_Holder"):"CanEditType"==this.attr("id")?e=t("#Form_EditForm_EditorGroups_Holder"):"CanCreateTopLevelType"==this.attr("id")&&(e=t("#Form_EditForm_CreateTopLevelGroups_Holder")),this.find(".optionset :input").bind("change",function(n){var i=t(this).closest(".middleColumn").parent("div");"OnlyTheseUsers"==n.target.value?(i.addClass("remove-splitter"),e.show()):(i.removeClass("remove-splitter"),e.hide())});var n=this.find("input[name="+this.attr("id")+"]:checked").val();e["OnlyTheseUsers"==n?"show":"hide"](),this._super()},onunmatch:function(){this._super()}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_print").entwine({onclick:function(e){var n=t(this[0].form).attr("action").replace(/\?.*$/,"")+"/printable/"+t(":input[name=ID]",this[0].form).val();return"http://"!=n.substr(0,7)&&(n=t("base").attr("href")+n),window.open(n,"printable"),!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_rollback").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=n?s["default"].sprintf(s["default"]._t("CMSMain.RollbackToVersion"),n):s["default"]._t("CMSMain.ConfirmRestoreFromLive"),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_archive").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Archive"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_restore").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="",a=this.data("toRoot");return i=s["default"].sprintf(s["default"]._t(a?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_delete").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.DeleteFromDraft"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_unpublish").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Unpublish"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form.changed").entwine({onmatch:function(t){this.find("button[name=action_save]").button("option","showingAlternate",!0),this.find("button[name=action_publish]").button("option","showingAlternate",!0),this._super(t)},onunmatch:function(t){var e=this.find("button[name=action_save]");e.data("button")&&e.button("option","showingAlternate",!1);var n=this.find("button[name=action_publish]");n.data("button")&&n.button("option","showingAlternate",!1),this._super(t)}}),t(".cms-edit-form .btn-toolbar button[name=action_publish]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t(".cms-edit-form .btn-toolbar button[name=action_save]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function(){this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder");"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()})},{i18n:"i18n",jQuery:"jQuery"}],4:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function(t){this.adjustContextClass()}},adjustContextClass:function(){var e=t("#vakata-contextmenu").find("ul ul");e.each(function(n){var i="1",a=t(e[n]).find("li").length;a>20?i="3":a>10&&(i="2"),t(e[n]).addClass("col-"+i).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function(){var e=this,n=this._super();this.getHints();return n.plugins.push("contextmenu"),n.contextmenu={items:function(n){var i={edit:{label:n.hasClass("edit-disabled")?s["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"):s["default"]._t("Tree.ViewPage","View page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(s["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}};n.hasClass("nochildren")||(i.showaslist={label:s["default"]._t("Tree.ShowAsList"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}});var a=(n.data("pagetype"),n.data("id")),o=n.find(">a .item").data("allowedchildren"),r={},d=!1;return t.each(o,function(n,i){d=!0,r["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+i,_class:"class-"+n,action:function(i){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlAddpage"),a,n),e.data("extraParams")))}}}),d&&(i.addsubpage={label:s["default"]._t("Tree.AddSubPage","Add page under this page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),submenu:r}),n.hasClass("edit-disabled")||(i.duplicate={label:s["default"]._t("Tree.Duplicate"),submenu:[{label:s["default"]._t("Tree.ThisPageOnly"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))}},{label:s["default"]._t("Tree.ThisPageAndSubpages"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))}}]}),i}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function(){var t,e=this,n=e.parents(".cms-panel-content");(e.offset().top<0||e.offset().top>n.height()-e.height())&&(t=n.scrollTop()+e.offset().top+n.height()/2,n.animate({scrollTop:t},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function(){window.location=location.protocol+"//"+location.host+location.pathname}}),t(".cms-tree-filtered").entwine({onmatch:function(){var e=this,n=function(){var n=t(".cms-content-tools .cms-panel-content").height()-e.parent().siblings(".cms-content-toolbar").outerHeight(!0);e.css("height",n+"px")};n(),t(window).on("resize",window.ss.debounce(n,300))}})})},{i18n:"i18n",jQuery:"jQuery"}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".cms-content-header-info").entwine({"from .cms-panel":{ontoggle:function(t){var e=this.closest(".cms-content").find(t.target);0!==e.length&&this.parent()[e.hasClass("collapsed")?"addClass":"removeClass"]("collapsed")}}}),t(".cms-content-toolbar").entwine({onmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this),i=n.data("toolid");n.hasClass("active");void 0!==i&&(n.data("active",!1).removeClass("active"),t("#"+i).hide(),e.bindActionButtonEvents(n))})},onunmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this);e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function(t){var e=this;t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function(t){t.off(".cmsContentToolbar")},showHideTool:function(e){var n=e.data("active"),i=e.data("toolid"),a=t("#"+i);t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"));e.data("toolid")!==i&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),a[n?"hide":"show"](),e.data("active",!n)}})})},{jQuery:"jQuery"}],6:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a),r=t("i18n"),s=i(r);o["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function(){this._super()},onunmatch:function(){this._super()},onsubmit:function(e,n){e.preventDefault();var i;if(i=this.find(":input[name=ID]").val(),!i)return!1;var a,o,r,d,l,c;if(c=this.find(":input[name=CompareMode]").is(":checked"),r=this.find("table input[type=checkbox]").filter(":checked"),c){if(2!=r.length)return!1;d=r.eq(0).val(),l=r.eq(1).val(),a=this.find(":submit[name=action_doCompare]"),o=s["default"].sprintf(this.data("linkTmplCompare"),i,l,d)}else d=r.eq(0).val(),a=this.find(":submit[name=action_doShowVersion]"),o=s["default"].sprintf(this.data("linkTmplShow"),i,d);t(".cms-container").loadPanel(o,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function(){this.toggle(),this._super()},onunmatch:function(){this._super()},onchange:function(){this.toggle()},toggle:function(){var e=t(this),n=e.parents("form");e.attr("checked")?n.find("tr[data-published=false]").show():n.find("tr[data-published=false]").hide()._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function(t){var e,n;return e=this.parents("form").find(":input[name=CompareMode]").attr("checked"),n=this.siblings(".active"),e&&this.hasClass("active")?void this._unselect():e?n.length>1?alert(s["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(),void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)},_select:function(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},{i18n:"i18n",jQuery:"jQuery"}],7:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t("#Form_EditForm_RedirectionType input").entwine({onmatch:function(){var e=t(this);e.attr("checked")&&this.toggle(),this._super()},onunmatch:function(){this._super()},onclick:function(){this.toggle()},toggle:function(){"Internal"==t(this).attr("value")?(t("#Form_EditForm_ExternalURL_Holder").hide(),t("#Form_EditForm_LinkToID_Holder").show()):(t("#Form_EditForm_ExternalURL_Holder").show(),t("#Form_EditForm_LinkToID_Holder").hide())}})})},{jQuery:"jQuery"}],8:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(t){var e=document.getElementsByTagName("base")[0].href.replace("http://","").replace(/\//g,"_").replace(/\./g,"_");return e+t}var o=t("jQuery"),r=i(o);(0,r["default"])(document).ready(function(){(0,r["default"])("#switchView a.newWindow").on("click",function(t){var e=window.open(this.href,a(this.target));return e.focus(),!1}),(0,r["default"])("#SilverStripeNavigatorLink").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").toggle(),!1}),(0,r["default"])("#SilverStripeNavigatorLinkPopup a.close").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").hide(),!1}),(0,r["default"])("#SilverStripeNavigatorLinkPopup input").on("focus",function(t){this.select()})})},{jQuery:"jQuery"}],9:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["default"].entwine("ss",function(t){t(".field.urlsegment:not(.readonly)").entwine({MaxPreviewLength:55,Ellipsis:"...",onmatch:function(){this.find(":text").length&&this.toggleEdit(!1),this.redraw(),this._super()},redraw:function(){var t=this.find(":text"),e=decodeURI(t.data("prefix")+t.val()),n=e;e.length>this.getMaxPreviewLength()&&(n=this.getEllipsis()+e.substr(e.length-this.getMaxPreviewLength(),e.length)),this.find(".preview").attr("href",encodeURI(e+t.data("suffix"))).text(n)},toggleEdit:function(t){var e=this.find(":text");this.find(".preview-holder")[t?"hide":"show"](),this.find(".edit-holder")[t?"show":"hide"](),t&&(e.data("origval",e.val()),e.focus())},update:function(){var t=this,e=this.find(":text"),n=e.data("origval"),i=arguments[0],a=i&&""!==i?i:e.val();n!=a?(this.addClass("loading"),this.suggest(a,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function(){var t=this.find(":text");t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function(e,n){var i=this,a=i.find(":text"),o=t.path.parseUrl(i.closest("form").attr("action")),r=o.hrefNoSearch+"/field/"+a.attr("name")+"/suggest/?value="+encodeURIComponent(e);o.search&&(r+="&"+o.search.replace(/^\?/,"")),t.ajax({url:r,success:function(t){n.apply(this,arguments)},error:function(t,e){t.statusText=t.responseText},complete:function(){i.removeClass("loading")}})}}),t(".field.urlsegment .edit").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").cancel()}})})},{jQuery:"jQuery"}]},{},[1]);
|
||||
//# sourceMappingURL=bundle-legacy.js.map
|
||||
|
4
client/dist/styles/bundle.css
vendored
4
client/dist/styles/bundle.css
vendored
@ -1,3 +1,3 @@
|
||||
#cms-page-history-versions tr.loading{color:#999}#cms-page-history-versions tr.loading td:hover{cursor:none}#cms-page-history-versions td:hover{cursor:pointer}.CMSPageHistoryController ins{background-color:#DFD;padding:2px;text-decoration:none}.CMSPageHistoryController del{background-color:#FDD;padding:2px;color:#f44}#cms-content-treeview .cms-tree-expand-trigger,#cms-content-listview .cms-tree-expand-trigger{display:none}.cms-content-tools #cms-content-treeview .cms-content-toolbar{border-bottom:none;box-shadow:none;margin-bottom:0}.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger{display:block;float:left;margin:0 0 2px 0}.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger span.ui-button-text{padding-right:8px}.cms-content-tools #cms-content-treeview .cms-tree .badge{display:none}.cms-content-tools #cms-content-treeview .cms-tree a:hover>.text>.badge,.cms-content-tools #cms-content-treeview .cms-tree .jstree-clicked>.text>.badge{display:inline-block}.field.urlsegment.loading{background:url(../images/loading.gif) no-repeat 162px 8px}.field.urlsegment .preview{padding-top:8px;display:inline-block}.field.urlsegment input.text{width:250px;float:left}.field.urlsegment input.text,.field.urlsegment .cancel,.field.urlsegment .update,.field.urlsegment .edit{margin-right:8px}.field.urlsegment .help{margin-left:0}.field.urlsegment .edit-holder{display:none}.field.urlsegment .edit-holder .form__field-description{clear:both}#Form_EditForm #Title .update{margin-left:7px}.cms .AssetAdmin .cms-content-fields{overflow-x:hidden}.cms .AssetAdmin .cms-content-fields .cms-edit-form.AssetAdmin{width:100%}.cms .AssetAdmin .cms-content-fields .cms-content-tools .cms-panel-content{overflow:hidden}.cms .AssetAdmin .cms-content-fields .cms-content-tools .cms-panel-content .cms-search-form{height:100%}.cms .AssetAdmin .cms-content-toolbar{float:left}.cms .AssetAdmin .cms-content-toolbar .cms-actions-row .ss-ui-button{z-index:1}.cms .AssetAdmin .cms-content-toolbar .cms-actions-row .ss-ui-button::before{font-size:23px}.cms .AssetAdmin .cms-content-toolbar .cms-actions-row .grid-levelup{margin:0}.cms .AssetAdmin .cms-content-toolbar .cms-page-add-button{background-image:linear-gradient(#f3f3f3, #d9d9d9);border-color:#c0c0c2}.cms .AssetAdmin .cms-content-toolbar .cms-page-add-button span.btn-icon-add{height:17px}.cms .AssetAdmin .cms-content-toolbar .cms-page-add-button span.ui-button-text{color:#393939;text-shadow:white 0 1px 1px}.cms .AssetAdmin #Root_TreeView .cms-tree ul .class-Folder a span.text span.jstree-foldericon{background:url(../images/blue-folder-horizontal.png) no-repeat;width:16px;height:16px;float:left;display:block;margin-right:4px}
|
||||
#cms-page-history-versions tr.loading{color:#999}#cms-page-history-versions tr.loading td:hover{cursor:none}#cms-page-history-versions td:hover{cursor:pointer}.CMSPageHistoryController ins{background-color:#DFD;padding:2px;text-decoration:none}.CMSPageHistoryController del{background-color:#FDD;padding:2px;color:#f44}#cms-content-treeview .cms-tree-expand-trigger,#cms-content-listview .cms-tree-expand-trigger{display:none}.cms-content-tools #cms-content-treeview .cms-content-toolbar{border-bottom:none;box-shadow:none;margin-bottom:0}.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger{display:block;float:left;margin:0 0 2px 0}.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger span.ui-button-text{padding-right:8px}.cms-content-tools #cms-content-treeview .cms-tree .badge{display:none}.cms-content-tools #cms-content-treeview .cms-tree a:hover>.text>.badge,.cms-content-tools #cms-content-treeview .cms-tree .jstree-clicked>.text>.badge{display:inline-block}.field.urlsegment.loading{background:url(../images/loading.gif) no-repeat 162px 8px}.field.urlsegment .preview{padding-top:8px;display:inline-block}.field.urlsegment input.text{width:250px;float:left}.field.urlsegment input.text,.field.urlsegment .cancel,.field.urlsegment .update,.field.urlsegment .edit{margin-right:8px}.field.urlsegment .help{margin-left:0}.field.urlsegment .edit-holder{display:none}.field.urlsegment .edit-holder .form__field-description{clear:both}#Form_EditForm #Title .update{margin-left:7px}
|
||||
|
||||
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmNzcyIsInNvdXJjZXMiOlsiYnVuZGxlLnNjc3MiLCJsZWdhY3kvX0NNU01haW4uc2NzcyIsImxlZ2FjeS9fQXNzZXRBZG1pbi5zY3NzIiwibGVnYWN5L19SZXBvcnRBZG1pbi5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIFRoaXMgZmlsZSBpcyB0aGUgY2VudHJhbCBjb2xsZWN0aW9uIG9mIGluY2x1ZGVkIG1vZHVsZXMsIGxpbmtzIHRvIGN1c3RvbSBTQ1NTIGZpbGVzLFxuLy8gYW5kIGFueSBnbG9iYWwgU0NTUyB2YXJpYWJsZSBkZWZpbml0aW9ucy5cbi8vIERPIE5PVCBBREQgc3R5bGVzaGVldCBydWxlcyB0byB0aGlzIGZpbGUgZGlyZWN0bHkhXG4vLyBOb3RlOiBCeSBw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sQ0FXaEIsS0FBSyxBQUFBLEtBQUssQUFBQyxDQUNWLEtBQUssQ0FBRSxLQUFNLENBQ1gsS0FBSyxDQUFFLElBQUssQ0FDZCxBQWRGLE1BQU0sQUFBQSxXQUFXLENBZ0JoQixLQUFLLEFBQUEsS0FBSyxDQWhCWCxNQUFNLEFBQUEsV0FBVyxDQWdCSixPQUFPLENBaEJwQixNQUFNLEFBQUEsV0FBVyxDQWdCSyxPQUFPLENBaEI3QixNQUFNLEFBQUEsV0FBVyxDQWdCYyxLQUFLLEFBQUMsQ0FDbkMsWUFBWSxDQUFFLEdBQUksQ0FDbEIsQUFsQkYsTUFBTSxBQUFBLFdBQVcsQ0FvQmhCLEtBQUssQUFBQyxDQUNMLFdBQVcsQ0FBRSxDQUFFLENBQ2YsQUF0QkYsTUFBTSxBQUFBLFdBQVcsQ0F3QmhCLFlBQVksQUFBQyxDQUNaLE9BQU8sQ0FBRSxJQUFLLENBS2QsQUE5QkYsTUFBTSxBQUFBLFdBQVcsQ0F3QmhCLFlBQVksQ0FHVCx3QkFBd0IsQUFBQyxDQUN2QixLQUFLLENBQUUsSUFBSyxDQUNiLEFBSUwsY0FBYyxDQUFDLE1BQU0sQ0FBQyxPQUFPLEFBQUMsQ0FDN0IsV0FBVyxDQUFFLEdBQUksQ0FDakIiLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 */
|
||||
|
@ -1,136 +0,0 @@
|
||||
/**
|
||||
* File: AssetAdmin.js
|
||||
*/
|
||||
|
||||
import $ from 'jQuery';
|
||||
import i18n from 'i18n';
|
||||
|
||||
$.entwine('ss', function($){
|
||||
/**
|
||||
* Delete selected folders through "batch actions" tab.
|
||||
*/
|
||||
/* assets don't currently have batch actions; disabling for now
|
||||
$(document).ready(function() {
|
||||
$('#Form_BatchActionsForm').entwine('.ss.tree').register(
|
||||
// TODO Hardcoding of base URL
|
||||
'admin/assets/batchactions/delete',
|
||||
function(ids) {
|
||||
var confirmed = confirm(
|
||||
i18n.sprintf(
|
||||
i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'),
|
||||
ids.length
|
||||
)
|
||||
);
|
||||
return (confirmed) ? ids : false;
|
||||
}
|
||||
);
|
||||
});
|
||||
*/
|
||||
|
||||
/**
|
||||
* Load folder detail view via controller methods
|
||||
* rather than built-in GridField view (which is only geared towards showing files).
|
||||
*/
|
||||
$('.AssetAdmin.cms-edit-form .ss-gridfield-item').entwine({
|
||||
onclick: function(e) {
|
||||
// Let actions do their own thing
|
||||
if($(e.target).closest('.action').length) {
|
||||
this._super(e);
|
||||
return;
|
||||
}
|
||||
|
||||
var grid = this.closest('.grid-field');
|
||||
if(this.data('class') == 'Folder') {
|
||||
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
|
||||
$('.cms-container').loadPanel(url);
|
||||
return false;
|
||||
}
|
||||
|
||||
this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form .grid-field .grid-field__col-compact .action.gridfield-button-delete, .AssetAdmin.cms-edit-form .btn-toolbar button.action.action-delete').entwine({
|
||||
onclick: function(e) {
|
||||
var msg;
|
||||
if(this.closest('.ss-gridfield-item').data('class') == 'Folder') {
|
||||
msg = i18n._t('AssetAdmin.ConfirmDelete');
|
||||
} else {
|
||||
msg = i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE');
|
||||
}
|
||||
if(!confirm(msg)) return false;
|
||||
|
||||
this.getGridField().reload({data: [{name: this.attr('name'), value: this.val()}]});
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form :submit[name=action_delete]').entwine({
|
||||
onclick: function(e) {
|
||||
if(!confirm(i18n._t('AssetAdmin.ConfirmDelete'))) return false;
|
||||
else this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Prompt for a new foldername, rather than using dedicated form.
|
||||
* Better usability, but less flexibility in terms of inputs and validation.
|
||||
* Mainly necessary because AssetAdmin->AddForm() returns don't play nicely
|
||||
* with the nested AssetAdmin->EditForm() DOM structures.
|
||||
*/
|
||||
$('.AssetAdmin .cms-add-folder-link').entwine({
|
||||
onclick: function(e) {
|
||||
var name = prompt(i18n._t('Folder.Name'));
|
||||
if(!name) return false;
|
||||
|
||||
this.closest('.cms-container').loadPanel(this.data('url') + '&Name=' + name);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: #Form_SyncForm
|
||||
*/
|
||||
$('#Form_SyncForm').entwine({
|
||||
|
||||
/**
|
||||
* Function: onsubmit
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onsubmit: function(e) {
|
||||
var button = jQuery(this).find(':submit:first');
|
||||
button.addClass('loading');
|
||||
$.ajax({
|
||||
url: jQuery(this).attr('action'),
|
||||
data: this.serializeArray(),
|
||||
success: function() {
|
||||
button.removeClass('loading');
|
||||
// reload current form and tree
|
||||
var currNode = $('.cms-tree')[0].firstSelected();
|
||||
if(currNode) {
|
||||
var url = $(currNode).find('a').attr('href');
|
||||
$('.cms-content').loadPanel(url);
|
||||
}
|
||||
$('.cms-tree')[0].setCustomURL('admin/assets/getsubtree');
|
||||
$('.cms-tree')[0].reload({onSuccess: function() {
|
||||
// TODO Reset current tree node
|
||||
}});
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Reload the gridfield to show the user the file has been added
|
||||
*/
|
||||
$('.AssetAdmin.cms-edit-form .ss-uploadfield-item-progress').entwine({
|
||||
onunmatch: function () {
|
||||
$('.AssetAdmin.cms-edit-form .grid-field').reload();
|
||||
}
|
||||
});
|
||||
});
|
@ -4,5 +4,4 @@
|
||||
// Note: By prefixing files with an underscore, they won't create individual CSS files.
|
||||
|
||||
@import "legacy/CMSMain";
|
||||
@import "legacy/AssetAdmin";
|
||||
@import "legacy/ReportAdmin";
|
||||
|
@ -1,62 +0,0 @@
|
||||
.cms .AssetAdmin {
|
||||
.cms-content-fields {
|
||||
overflow-x: hidden; //hides 'allowed extensions' sidebar
|
||||
|
||||
.cms-edit-form.AssetAdmin {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED:
|
||||
* .cms-content-tools will be removed in 4.0
|
||||
* Use .cms-content-filters instead.
|
||||
*/
|
||||
.cms-content-tools .cms-panel-content {
|
||||
overflow:hidden; //removes scollbar from search field in filter
|
||||
.cms-search-form {
|
||||
height:100%; //increases height of search form to accomodate dropdown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cms-content-toolbar {
|
||||
float: left;
|
||||
|
||||
.cms-actions-row {
|
||||
.ss-ui-button {
|
||||
z-index: 1;
|
||||
|
||||
&::before {
|
||||
font-size: 23px;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-levelup {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cms-page-add-button {
|
||||
background-image: linear-gradient(lighten(#e6e6e6, 5%), darken(#e6e6e6, 5%));
|
||||
border-color:#c0c0c2;
|
||||
span.btn-icon-add {
|
||||
height:17px;
|
||||
}
|
||||
span.ui-button-text {
|
||||
color:#393939;
|
||||
text-shadow: white 0 1px 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Root_TreeView {
|
||||
.cms-tree ul .class-Folder a span.text span.jstree-foldericon {
|
||||
background: url(../images/blue-folder-horizontal.png) no-repeat;
|
||||
width:16px;
|
||||
height:16px;
|
||||
float:left;
|
||||
display:block;
|
||||
margin-right:4px;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,699 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\CMS\Controllers;
|
||||
|
||||
use SearchContext;
|
||||
use SearchFilter;
|
||||
use SilverStripe\Filesystem\Storage\AssetNameGenerator;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
||||
use SilverStripe\ORM\Versioning\Versioned;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\Security\Security;
|
||||
use SilverStripe\Security\PermissionProvider;
|
||||
use SilverStripe\Admin\CMSBatchAction;
|
||||
use SilverStripe\Admin\CMSBatchActionHandler;
|
||||
use SilverStripe\Admin\LeftAndMain;
|
||||
use Session;
|
||||
use Requirements;
|
||||
use File;
|
||||
use DateField;
|
||||
use HiddenField;
|
||||
use GridFieldConfig;
|
||||
use GridFieldToolbarHeader;
|
||||
use GridFieldSortableHeader;
|
||||
use GridFieldFilterHeader;
|
||||
use GridFieldDataColumns;
|
||||
use GridFieldPaginator;
|
||||
use GridFieldEditButton;
|
||||
use GridFieldDeleteAction;
|
||||
use GridFieldDetailForm;
|
||||
use GridFieldLevelup;
|
||||
use GridField;
|
||||
use Controller;
|
||||
use LiteralField;
|
||||
use SS_HTTPRequest;
|
||||
use TabSet;
|
||||
use Tab;
|
||||
use CompositeField;
|
||||
use UploadField;
|
||||
use FormField;
|
||||
use SS_HTTPResponse;
|
||||
use Convert;
|
||||
use SS_HTTPResponse_Exception;
|
||||
use HeaderField;
|
||||
use FieldGroup;
|
||||
use DropdownField;
|
||||
use CheckboxField;
|
||||
use FieldList;
|
||||
use FormAction;
|
||||
use Object;
|
||||
use Form;
|
||||
use TextField;
|
||||
use Folder;
|
||||
use Injector;
|
||||
use Director;
|
||||
use ArrayData;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AssetAdmin is the 'file store' section of the CMS.
|
||||
* It provides an interface for manipulating the File and Folder objects in the system.
|
||||
*
|
||||
* @package cms
|
||||
* @subpackage assets
|
||||
*/
|
||||
class AssetAdmin extends LeftAndMain implements PermissionProvider{
|
||||
|
||||
private static $url_segment = 'assets';
|
||||
|
||||
private static $url_rule = '/$Action/$ID';
|
||||
|
||||
private static $menu_title = 'Files';
|
||||
|
||||
private static $tree_class = 'Folder';
|
||||
|
||||
/**
|
||||
* Amount of results showing on a single page.
|
||||
*
|
||||
* @config
|
||||
* @var int
|
||||
*/
|
||||
private static $page_length = 15;
|
||||
|
||||
/**
|
||||
* @config
|
||||
* @see Upload->allowedMaxFileSize
|
||||
* @var int
|
||||
*/
|
||||
private static $allowed_max_file_size;
|
||||
|
||||
private static $allowed_actions = array(
|
||||
'addfolder',
|
||||
'delete',
|
||||
'AddForm',
|
||||
'SearchForm',
|
||||
'getsubtree'
|
||||
);
|
||||
|
||||
private static $required_permission_codes = 'CMS_ACCESS_AssetAdmin';
|
||||
|
||||
/**
|
||||
* Return fake-ID "root" if no ID is found (needed to upload files into the root-folder)
|
||||
*/
|
||||
public function currentPageID() {
|
||||
if(is_numeric($this->getRequest()->requestVar('ID'))) {
|
||||
return $this->getRequest()->requestVar('ID');
|
||||
} elseif (isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) {
|
||||
return $this->urlParams['ID'];
|
||||
} elseif(Session::get("{$this->class}.currentPage")) {
|
||||
return Session::get("{$this->class}.currentPage");
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the controller
|
||||
*/
|
||||
public function init() {
|
||||
parent::init();
|
||||
|
||||
Versioned::set_stage(Versioned::DRAFT);
|
||||
|
||||
Requirements::javascript(CMS_DIR . "/client/dist/js/AssetAdmin.js");
|
||||
Requirements::add_i18n_javascript(CMS_DIR . '/client/lang', false, true);
|
||||
Requirements::css(CMS_DIR . '/client/dist/styles/bundle.css');
|
||||
CMSBatchActionHandler::register('delete', 'SilverStripe\\CMS\\Controllers\\AssetAdmin_DeleteBatchAction', 'Folder');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the files and subfolders contained in the currently selected folder,
|
||||
* defaulting to the root node. Doubles as search results, if any search parameters
|
||||
* are set through {@link SearchForm()}.
|
||||
*
|
||||
* @return SS_List
|
||||
*/
|
||||
public function getList() {
|
||||
$folder = $this->currentPage();
|
||||
$context = $this->getSearchContext();
|
||||
// Overwrite name filter to search both Name and Title attributes
|
||||
$context->removeFilterByName('Name');
|
||||
$params = $this->getRequest()->requestVar('q');
|
||||
/** @var DataList $list */
|
||||
$list = $context->getResults($params);
|
||||
|
||||
// Don't filter list when a detail view is requested,
|
||||
// to avoid edge cases where the filtered list wouldn't contain the requested
|
||||
// record due to faulty session state (current folder not always encoded in URL, see #7408).
|
||||
if(!$folder->ID
|
||||
&& $this->getRequest()->requestVar('ID') === null
|
||||
&& ($this->getRequest()->param('ID') == 'field')
|
||||
) {
|
||||
return $list;
|
||||
}
|
||||
|
||||
// Re-add previously removed "Name" filter as combined filter
|
||||
// TODO Replace with composite SearchFilter once that API exists
|
||||
if(!empty($params['Name'])) {
|
||||
$list = $list->filterAny(array(
|
||||
'Name:PartialMatch' => $params['Name'],
|
||||
'Title:PartialMatch' => $params['Name']
|
||||
));
|
||||
}
|
||||
|
||||
// Always show folders at the top
|
||||
$list = $list->sort('(CASE WHEN "File"."ClassName" = \'Folder\' THEN 0 ELSE 1 END), "Name"');
|
||||
|
||||
// If a search is conducted, check for the "current folder" limitation.
|
||||
// Otherwise limit by the current folder as denoted by the URL.
|
||||
if(empty($params) || !empty($params['CurrentFolderOnly'])) {
|
||||
$list = $list->filter('ParentID', $folder->ID);
|
||||
}
|
||||
|
||||
// Category filter
|
||||
if(!empty($params['AppCategory'])
|
||||
&& !empty(File::config()->app_categories[$params['AppCategory']])
|
||||
) {
|
||||
$exts = File::config()->app_categories[$params['AppCategory']];
|
||||
$list = $list->filter('Name:PartialMatch', $exts);
|
||||
}
|
||||
|
||||
// Date filter
|
||||
if(!empty($params['CreatedFrom'])) {
|
||||
$fromDate = new DateField(null, null, $params['CreatedFrom']);
|
||||
$list = $list->filter("Created:GreaterThanOrEqual", $fromDate->dataValue().' 00:00:00');
|
||||
}
|
||||
if(!empty($params['CreatedTo'])) {
|
||||
$toDate = new DateField(null, null, $params['CreatedTo']);
|
||||
$list = $list->filter("Created:LessThanOrEqual", $toDate->dataValue().' 23:59:59');
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getEditForm($id = null, $fields = null) {
|
||||
Requirements::javascript(FRAMEWORK_DIR . '/client/dist/js/AssetUploadField.js');
|
||||
Requirements::css(FRAMEWORK_DIR . '/client/dist/styles/AssetUploadField.css');
|
||||
|
||||
$form = parent::getEditForm($id, $fields);
|
||||
$folder = ($id && is_numeric($id)) ? DataObject::get_by_id('Folder', $id, false) : $this->currentPage();
|
||||
$fields = $form->Fields();
|
||||
$title = ($folder && $folder->isInDB()) ? $folder->Title : _t('AssetAdmin.FILES', 'Files');
|
||||
$fields->push(new HiddenField('ID', false, $folder ? $folder->ID : null));
|
||||
|
||||
// Remove legacy previewable behaviour.
|
||||
$form->removeExtraClass('cms-previewable');
|
||||
/** @skipUpgrade */
|
||||
$form->Fields()->removeByName('SilverStripeNavigator');
|
||||
|
||||
// File listing
|
||||
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
||||
new GridFieldToolbarHeader(),
|
||||
new GridFieldSortableHeader(),
|
||||
new GridFieldFilterHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPaginator(self::config()->page_length),
|
||||
new GridFieldEditButton(),
|
||||
new GridFieldDeleteAction(),
|
||||
new GridFieldDetailForm(),
|
||||
GridFieldLevelup::create($folder->ID)->setLinkSpec($this->Link('show') . '/%d')
|
||||
);
|
||||
|
||||
$gridField = GridField::create('File', $title, $this->getList(), $gridFieldConfig);
|
||||
/** @var GridFieldDataColumns $columns */
|
||||
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
|
||||
$columns->setDisplayFields(array(
|
||||
'StripThumbnail' => '',
|
||||
'Title' => _t('File.Title', 'Title'),
|
||||
'Created' => _t('AssetAdmin.CREATED', 'Date'),
|
||||
'Size' => _t('AssetAdmin.SIZE', 'Size'),
|
||||
));
|
||||
$columns->setFieldCasting(array(
|
||||
'Created' => 'DBDatetime->Nice'
|
||||
));
|
||||
$gridField->setAttribute(
|
||||
'data-url-folder-template',
|
||||
Controller::join_links($this->Link('show'), '%s')
|
||||
);
|
||||
|
||||
if(!$folder->hasMethod('canAddChildren') || ($folder->hasMethod('canAddChildren') && $folder->canAddChildren())) {
|
||||
// TODO Will most likely be replaced by GridField logic
|
||||
$addFolderBtn = new LiteralField(
|
||||
'AddFolderButton',
|
||||
sprintf(
|
||||
'<a class="ss-ui-button font-icon-folder-add no-text cms-add-folder-link" title="%s" data-icon="add" data-url="%s" href="%s"></a>',
|
||||
_t('Folder.AddFolderButton', 'Add folder'),
|
||||
Controller::join_links($this->Link('AddForm'), '?' . http_build_query(array(
|
||||
'action_doAdd' => 1,
|
||||
'ParentID' => $folder->ID,
|
||||
'SecurityID' => $form->getSecurityToken()->getValue()
|
||||
))),
|
||||
Controller::join_links($this->Link('addfolder'), '?ParentID=' . $folder->ID)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$addFolderBtn = '';
|
||||
}
|
||||
|
||||
// Move existing fields to a "details" tab, unless they've already been tabbed out through extensions.
|
||||
// Required to keep Folder->getCMSFields() simple and reuseable,
|
||||
// without any dependencies into AssetAdmin (e.g. useful for "add folder" views).
|
||||
if(!$fields->hasTabSet()) {
|
||||
$tabs = new TabSet('Root',
|
||||
$tabList = new Tab('ListView', _t('AssetAdmin.ListView', 'List View')),
|
||||
$tabTree = new Tab('TreeView', _t('AssetAdmin.TreeView', 'Tree View'))
|
||||
);
|
||||
$tabList->addExtraClass("content-listview cms-tabset-icon list");
|
||||
$tabTree->addExtraClass("content-treeview cms-tabset-icon tree");
|
||||
if($fields->count() && $folder && $folder->isInDB()) {
|
||||
$tabs->push($tabDetails = new Tab('DetailsView', _t('AssetAdmin.DetailsView', 'Details')));
|
||||
$tabDetails->addExtraClass("content-galleryview cms-tabset-icon edit");
|
||||
foreach($fields as $field) {
|
||||
$fields->removeByName($field->getName());
|
||||
$tabDetails->push($field);
|
||||
}
|
||||
}
|
||||
$fields->push($tabs);
|
||||
}
|
||||
|
||||
// we only add buttons if they're available. User might not have permission and therefore
|
||||
// the button shouldn't be available. Adding empty values into a ComposteField breaks template rendering.
|
||||
$actionButtonsComposite = CompositeField::create()->addExtraClass('cms-actions-row');
|
||||
if($addFolderBtn) $actionButtonsComposite->push($addFolderBtn);
|
||||
|
||||
// Add the upload field for new media
|
||||
if($currentPageID = $this->currentPageID()){
|
||||
Session::set("{$this->class}.currentPage", $currentPageID);
|
||||
}
|
||||
|
||||
$folder = $this->currentPage();
|
||||
|
||||
$uploadField = UploadField::create('AssetUploadField', '');
|
||||
$uploadField->setConfig('previewMaxWidth', 40);
|
||||
$uploadField->setConfig('previewMaxHeight', 30);
|
||||
$uploadField->setConfig('changeDetection', false);
|
||||
$uploadField->addExtraClass('ss-assetuploadfield');
|
||||
$uploadField->removeExtraClass('ss-uploadfield');
|
||||
$uploadField->setTemplate('AssetUploadField');
|
||||
|
||||
if($folder->exists()) {
|
||||
$path = $folder->getFilename();
|
||||
$uploadField->setFolderName($path);
|
||||
} else {
|
||||
$uploadField->setFolderName('/'); // root of the assets
|
||||
}
|
||||
|
||||
$exts = $uploadField->getValidator()->getAllowedExtensions();
|
||||
asort($exts);
|
||||
$uploadField->Extensions = implode(', ', $exts);
|
||||
|
||||
// List view
|
||||
$fields->addFieldsToTab('Root.ListView', array(
|
||||
$actionsComposite = CompositeField::create(
|
||||
$actionButtonsComposite
|
||||
)->addExtraClass('cms-content-toolbar field'),
|
||||
$uploadField,
|
||||
new HiddenField('ID'),
|
||||
$gridField
|
||||
));
|
||||
|
||||
// Tree view
|
||||
$fields->addFieldsToTab('Root.TreeView', array(
|
||||
clone $actionsComposite,
|
||||
// TODO Replace with lazy loading on client to avoid performance hit of rendering potentially unused views
|
||||
new LiteralField(
|
||||
'Tree',
|
||||
FormField::create_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'cms-tree',
|
||||
'data-url-tree' => $this->Link('getsubtree'),
|
||||
'data-url-savetreenode' => $this->Link('savetreenode')
|
||||
),
|
||||
$this->SiteTreeAsUL()
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
// Move actions to "details" tab (they don't make sense on list/tree view)
|
||||
$actions = $form->Actions();
|
||||
$saveBtn = $actions->fieldByName('action_save');
|
||||
$deleteBtn = $actions->fieldByName('action_delete');
|
||||
$actions->removeByName('action_save');
|
||||
$actions->removeByName('action_delete');
|
||||
if(($saveBtn || $deleteBtn) && $fields->fieldByName('Root.DetailsView')) {
|
||||
$fields->addFieldToTab(
|
||||
'Root.DetailsView',
|
||||
CompositeField::create($saveBtn,$deleteBtn)->addExtraClass('Actions')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$fields->setForm($form);
|
||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||
// TODO Can't merge $FormAttributes in template at the moment
|
||||
$form->addExtraClass('cms-edit-form ' . $this->BaseCSSClasses());
|
||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
||||
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||
|
||||
// Optionally handle form submissions with 'X-Formschema-Request'
|
||||
// which rely on having validation errors returned as structured data
|
||||
$form->setValidationResponseCallback(function() use ($form) {
|
||||
$request = $this->getRequest();
|
||||
if($request->getHeader('X-Formschema-Request')) {
|
||||
$data = $this->getSchemaForForm($form);
|
||||
$response = new SS_HTTPResponse(Convert::raw2json($data));
|
||||
$response->addHeader('Content-Type', 'application/json');
|
||||
return $response;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$this->extend('updateEditForm', $form);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SS_HTTPRequest $request
|
||||
* @return DBHTMLText
|
||||
*/
|
||||
public function addfolder($request) {
|
||||
$obj = $this->customise(array(
|
||||
'EditForm' => $this->AddForm()
|
||||
));
|
||||
|
||||
if($request->isAjax()) {
|
||||
// Rendering is handled by template, which will call EditForm() eventually
|
||||
$content = $obj->renderWith($this->getTemplatesWithSuffix('_Content'));
|
||||
} else {
|
||||
$content = $obj->renderWith($this->getViewer('show'));
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function delete($data, $form) {
|
||||
$className = $this->stat('tree_class');
|
||||
|
||||
$record = DataObject::get_by_id($className, $data['ID']);
|
||||
if($record && !$record->canDelete()) {
|
||||
return Security::permissionFailure();
|
||||
}
|
||||
if(!$record || !$record->ID) {
|
||||
throw new SS_HTTPResponse_Exception("Bad record ID #" . (int)$data['ID'], 404);
|
||||
}
|
||||
$parentID = $record->ParentID;
|
||||
$record->delete();
|
||||
$this->setCurrentPageID(null);
|
||||
|
||||
$this->getResponse()->addHeader('X-Status', rawurlencode(_t('LeftAndMain.DELETED', 'Deleted.')));
|
||||
$this->getResponse()->addHeader('X-Pjax', 'Content');
|
||||
return $this->redirect(Controller::join_links($this->Link('show'), $parentID ? $parentID : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the search context
|
||||
*
|
||||
* @return SearchContext
|
||||
*/
|
||||
public function getSearchContext() {
|
||||
$context = File::singleton()->getDefaultSearchContext();
|
||||
|
||||
// Namespace fields, for easier detection if a search is present
|
||||
/** @var FormField $field */
|
||||
foreach($context->getFields() as $field) {
|
||||
$field->setName(sprintf('q[%s]', $field->getName()));
|
||||
}
|
||||
/** @var SearchFilter $filter */
|
||||
foreach($context->getFilters() as $filter) {
|
||||
$filter->setFullName(sprintf('q[%s]', $filter->getFullName()));
|
||||
}
|
||||
|
||||
// Customize fields
|
||||
$dateHeader = HeaderField::create('q[Date]', _t('CMSSearch.FILTERDATEHEADING', 'Date'), 4);
|
||||
$dateFrom = DateField::create('q[CreatedFrom]', _t('CMSSearch.FILTERDATEFROM', 'From'))
|
||||
->setConfig('showcalendar', true);
|
||||
$dateTo = DateField::create('q[CreatedTo]',_t('CMSSearch.FILTERDATETO', 'To'))
|
||||
->setConfig('showcalendar', true);
|
||||
$dateGroup = FieldGroup::create(
|
||||
$dateHeader,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
);
|
||||
$context->addField($dateGroup);
|
||||
$appCategories = array(
|
||||
'archive' => _t('AssetAdmin.AppCategoryArchive', 'Archive', 'A collection of files'),
|
||||
'audio' => _t('AssetAdmin.AppCategoryAudio', 'Audio'),
|
||||
'document' => _t('AssetAdmin.AppCategoryDocument', 'Document'),
|
||||
'flash' => _t('AssetAdmin.AppCategoryFlash', 'Flash', 'The fileformat'),
|
||||
'image' => _t('AssetAdmin.AppCategoryImage', 'Image'),
|
||||
'video' => _t('AssetAdmin.AppCategoryVideo', 'Video'),
|
||||
);
|
||||
$context->addField(
|
||||
$typeDropdown = new DropdownField(
|
||||
'q[AppCategory]',
|
||||
_t('AssetAdmin.Filetype', 'File type'),
|
||||
$appCategories
|
||||
)
|
||||
);
|
||||
|
||||
$typeDropdown->setEmptyString(' ');
|
||||
|
||||
$context->addField(
|
||||
new CheckboxField('q[CurrentFolderOnly]', _t('AssetAdmin.CurrentFolderOnly', 'Limit to current folder?'))
|
||||
);
|
||||
$context->getFields()->removeByName('q[Title]');
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a form for filtering of files and assets gridfield.
|
||||
* Result filtering takes place in {@link getList()}.
|
||||
*
|
||||
* @return Form
|
||||
* @see AssetAdmin.js
|
||||
*/
|
||||
public function SearchForm() {
|
||||
$folder = $this->currentPage();
|
||||
$context = $this->getSearchContext();
|
||||
|
||||
$fields = $context->getSearchFields();
|
||||
$actions = new FieldList(
|
||||
FormAction::create('doSearch', _t('CMSMain_left_ss.APPLY_FILTER', 'Apply Filter'))
|
||||
->addExtraClass('ss-ui-action-constructive'),
|
||||
Object::create('ResetFormAction', 'clear', _t('CMSMain_left_ss.RESET', 'Reset'))
|
||||
);
|
||||
|
||||
$form = new Form($this, 'filter', $fields, $actions);
|
||||
$form->setFormMethod('GET');
|
||||
$form->setFormAction(Controller::join_links($this->Link('show'), $folder->ID));
|
||||
$form->addExtraClass('cms-search-form');
|
||||
$form->loadDataFrom($this->getRequest()->getVars());
|
||||
$form->disableSecurityToken();
|
||||
// This have to match data-name attribute on the gridfield so that the javascript selectors work
|
||||
$form->setAttribute('data-gridfield', 'File');
|
||||
return $form;
|
||||
}
|
||||
|
||||
public function AddForm() {
|
||||
$negotiator = $this->getResponseNegotiator();
|
||||
$form = Form::create(
|
||||
$this,
|
||||
'AddForm',
|
||||
new FieldList(
|
||||
new TextField("Name", _t('File.Name')),
|
||||
new HiddenField('ParentID', false, $this->getRequest()->getVar('ParentID'))
|
||||
),
|
||||
new FieldList(
|
||||
FormAction::create('doAdd', _t('AssetAdmin_left_ss.GO','Go'))
|
||||
->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')
|
||||
->setTitle(_t('AssetAdmin.ActionAdd', 'Add folder'))
|
||||
)
|
||||
)->setHTMLID('Form_AddForm');
|
||||
$form->setValidationResponseCallback(function() use ($negotiator, $form) {
|
||||
$request = $this->getRequest();
|
||||
if($request->isAjax() && $negotiator) {
|
||||
$form->setupFormErrors();
|
||||
$result = $form->forTemplate();
|
||||
|
||||
return $negotiator->respond($request, array(
|
||||
'CurrentForm' => function() use($result) {
|
||||
return $result;
|
||||
}
|
||||
));
|
||||
}
|
||||
});
|
||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||
// TODO Can't merge $FormAttributes in template at the moment
|
||||
$form->addExtraClass('add-form cms-add-form cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses());
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new group and return its details suitable for ajax.
|
||||
*
|
||||
* @todo Move logic into Folder class, and use LeftAndMain->doAdd() default implementation.
|
||||
*
|
||||
* @param array $data
|
||||
* @param Form $form
|
||||
* @return SS_HTTPResponse|string
|
||||
*/
|
||||
public function doAdd($data, $form) {
|
||||
$class = $this->stat('tree_class');
|
||||
|
||||
// check create permissions
|
||||
if(!singleton($class)->canCreate()) {
|
||||
return Security::permissionFailure($this);
|
||||
}
|
||||
|
||||
// check addchildren permissions
|
||||
/** @var File $parentRecord */
|
||||
if(
|
||||
singleton($class)->hasExtension('SilverStripe\ORM\Hierarchy\Hierarchy')
|
||||
&& isset($data['ParentID'])
|
||||
&& is_numeric($data['ParentID'])
|
||||
&& $data['ParentID']
|
||||
) {
|
||||
$parentRecord = DataObject::get_by_id($class, $data['ParentID']);
|
||||
if($parentRecord->hasMethod('canAddChildren') && !$parentRecord->canAddChildren()) {
|
||||
return Security::permissionFailure($this);
|
||||
}
|
||||
} else {
|
||||
$parentRecord = null;
|
||||
}
|
||||
|
||||
// Check parent
|
||||
$parentID = $parentRecord && $parentRecord->ID
|
||||
? (int)$parentRecord->ID
|
||||
: 0;
|
||||
// Build filename
|
||||
$filename = isset($data['Name'])
|
||||
? basename($data['Name'])
|
||||
: _t('AssetAdmin.NEWFOLDER',"NewFolder");
|
||||
if($parentRecord && $parentRecord->ID) {
|
||||
$filename = $parentRecord->getFilename() . '/' . $filename;
|
||||
}
|
||||
|
||||
// Get the folder to be created
|
||||
|
||||
// Ensure name is unique
|
||||
foreach($this->getNameGenerator($filename) as $filename) {
|
||||
if(! File::find($filename) ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Create record
|
||||
$record = Folder::create();
|
||||
$record->ParentID = $parentID;
|
||||
$record->Name = $record->Title = basename($filename);
|
||||
$record->write();
|
||||
|
||||
|
||||
if($parentRecord) {
|
||||
return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
|
||||
} else {
|
||||
return $this->redirect($this->Link());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an asset renamer for the given filename.
|
||||
*
|
||||
* @param string $filename Path name
|
||||
* @return AssetNameGenerator
|
||||
*/
|
||||
protected function getNameGenerator($filename){
|
||||
return Injector::inst()
|
||||
->createWithArgs('AssetNameGenerator', array($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom currentPage() method to handle opening the 'root' folder
|
||||
*/
|
||||
public function currentPage() {
|
||||
$id = $this->currentPageID();
|
||||
if($id && is_numeric($id) && $id > 0) {
|
||||
$folder = DataObject::get_by_id('Folder', $id);
|
||||
if($folder && $folder->isInDB()) {
|
||||
return $folder;
|
||||
}
|
||||
}
|
||||
$this->setCurrentPageID(null);
|
||||
return new Folder();
|
||||
}
|
||||
|
||||
public function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
||||
if (!$childrenMethod) $childrenMethod = 'ChildFolders';
|
||||
if (!$numChildrenMethod) $numChildrenMethod = 'numChildFolders';
|
||||
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $numChildrenMethod, $filterFunction, $minNodeCount);
|
||||
}
|
||||
|
||||
public function getCMSTreeTitle() {
|
||||
return Director::absoluteBaseURL() . "assets";
|
||||
}
|
||||
|
||||
public function SiteTreeAsUL() {
|
||||
return $this->getSiteTreeFor($this->stat('tree_class'), null, 'ChildFolders', 'numChildFolders');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $unlinked
|
||||
* @return ArrayList
|
||||
*/
|
||||
public function Breadcrumbs($unlinked = false) {
|
||||
$items = parent::Breadcrumbs($unlinked);
|
||||
|
||||
// The root element should explicitly point to the root node.
|
||||
// Uses session state for current record otherwise.
|
||||
$items[0]->Link = Controller::join_links($this->Link('show'), 0);
|
||||
|
||||
// If a search is in progress, don't show the path
|
||||
if($this->getRequest()->requestVar('q')) {
|
||||
$items = $items->limit(1);
|
||||
$items->push(new ArrayData(array(
|
||||
'Title' => _t('LeftAndMain.SearchResults', 'Search Results'),
|
||||
'Link' => Controller::join_links($this->Link(), '?' . http_build_query(array('q' => $this->getRequest()->requestVar('q'))))
|
||||
)));
|
||||
}
|
||||
|
||||
// If we're adding a folder, note that in breadcrumbs as well
|
||||
if($this->getRequest()->param('Action') == 'addfolder') {
|
||||
$items->push(new ArrayData(array(
|
||||
'Title' => _t('Folder.AddFolderButton', 'Add folder'),
|
||||
'Link' => false
|
||||
)));
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
public static function menu_title($class = null, $localised = true) {
|
||||
// Deprecate this menu title if installed alongside new asset admin
|
||||
if($localised && class_exists('SilverStripe\AssetAdmin\Controller\AssetAdmin')) {
|
||||
// Don't conflict with legacy translations
|
||||
return _t('AssetAdmin.CMSMENU_OLD', 'Files (old)');
|
||||
}
|
||||
return parent::menu_title(null, $localised);
|
||||
}
|
||||
|
||||
public function providePermissions() {
|
||||
$title = static::menu_title();
|
||||
return array(
|
||||
"CMS_ACCESS_AssetAdmin" => array(
|
||||
'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
|
||||
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\CMS\Controllers;
|
||||
|
||||
use Convert;
|
||||
use SilverStripe\Admin\CMSBatchAction;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
|
||||
/**
|
||||
* Delete multiple {@link Folder} records (and the associated filesystem nodes).
|
||||
* Usually used through the {@link AssetAdmin} interface.
|
||||
*
|
||||
* @package cms
|
||||
* @subpackage batchactions
|
||||
*/
|
||||
class AssetAdmin_DeleteBatchAction extends CMSBatchAction
|
||||
{
|
||||
public function getActionTitle()
|
||||
{
|
||||
// _t('AssetAdmin_left_ss.SELECTTODEL','Select the folders that you want to delete and then click the button below')
|
||||
return _t('AssetAdmin_DeleteBatchAction.TITLE', 'Delete folders');
|
||||
}
|
||||
|
||||
public function run(SS_List $records)
|
||||
{
|
||||
$status = array(
|
||||
'modified' => array(),
|
||||
'deleted' => array()
|
||||
);
|
||||
|
||||
foreach ($records as $record) {
|
||||
$id = $record->ID;
|
||||
|
||||
// Perform the action
|
||||
if ($record->canDelete()) {
|
||||
$record->delete();
|
||||
}
|
||||
|
||||
$status['deleted'][$id] = array();
|
||||
|
||||
$record->destroy();
|
||||
unset($record);
|
||||
}
|
||||
|
||||
return Convert::raw2json($status);
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<div id="assetadmin-cms-content" class="cms-content center cms-tabset ss-uploadfield-dropzone $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
|
||||
|
||||
<% with $EditForm %>
|
||||
<div class="cms-content-header north">
|
||||
<div class="cms-content-header-info">
|
||||
<% with $Controller %>
|
||||
<% include SilverStripe\\Admin\\CMSBreadcrumbs %>
|
||||
<% end_with %>
|
||||
</div>
|
||||
|
||||
<% if $Fields.hasTabset %>
|
||||
<% with $Fields.fieldByName('Root') %>
|
||||
<div class="cms-content-header-tabs">
|
||||
<button id="filters-button" class="icon-button font-icon-search no-text" title="<% _t('CMSPagesController_Tools_ss.FILTER', 'Filter') %>"></button>
|
||||
|
||||
<div class="icon-button-group">
|
||||
<ul class="cms-tabset-nav-primary ss-tabset">
|
||||
<% loop $Tabs %>
|
||||
<li<% if $extraClass %> class="$extraClass"<% end_if %>><a class="cms-panel-link icon-button <% if $Title == 'List View' %>font-icon-list<% else_if $Title == 'Tree View' %>font-icon-icon-tree<% else %>font-icon-pencil<% end_if %>" href="#$id" title="$Title"></a></li>
|
||||
<% end_loop %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end_with %>
|
||||
<% end_if %>
|
||||
</div>
|
||||
|
||||
<div class="cms-content-fields center ui-widget-content cms-panel-padded" data-layout-type="border">
|
||||
$Top.Tools
|
||||
|
||||
<div class="cms-content-view">
|
||||
$forTemplate
|
||||
</div>
|
||||
</div>
|
||||
<% end_with %>
|
||||
|
||||
</div>
|
@ -1,30 +0,0 @@
|
||||
<form $FormAttributes>
|
||||
|
||||
<% if $Message %>
|
||||
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
|
||||
<% else %>
|
||||
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
||||
<% end_if %>
|
||||
|
||||
<fieldset>
|
||||
<% if $Legend %><legend>$Legend</legend><% end_if %>
|
||||
<% loop $Fields %>
|
||||
$FieldHolder
|
||||
<% end_loop %>
|
||||
<div class="clear"><!-- --></div>
|
||||
</fieldset>
|
||||
|
||||
<% if $Actions %>
|
||||
<div class="btn-toolbar">
|
||||
<% loop $Actions %>
|
||||
$Field
|
||||
<% end_loop %>
|
||||
<% if $CurrentPage.LinkPreview %>
|
||||
<a href="$CurrentPage.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
|
||||
<% _t('LeftAndMain.PreviewButton', 'Preview') %> »
|
||||
</a>
|
||||
<% end_if %>
|
||||
</div>
|
||||
<% end_if %>
|
||||
|
||||
</form>
|
@ -1,3 +0,0 @@
|
||||
<div id="cms-content-filters-AssetAdmin" class="cms-content-filters">
|
||||
$SearchForm
|
||||
</div>
|
@ -1,28 +0,0 @@
|
||||
<div id="assetadmin-cms-content" class="cms-content center cms-tabset $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
|
||||
|
||||
<div class="cms-content-header north">
|
||||
<div class="cms-content-header-info">
|
||||
<h2><% _t('AssetAdmin.ADDFILES', 'Add Files') %></h2>
|
||||
</div>
|
||||
<div class="cms-content-header-tabs">
|
||||
<ul class="cms-tabset-nav-primary">
|
||||
<li>
|
||||
<a href="#cms-content-fromyourcomputer"><% _t('AssetAdmin.FROMYOURCOMPUTER', 'From your computer') %></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#cms-content-fromtheinternet"><% _t('AssetAdmin.FROMTHEINTERNET', 'From the internet') %></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cms-content-fields center">
|
||||
<div id="cms-content-fromyourcomputer">
|
||||
$UploadForm
|
||||
</div>
|
||||
<div id="cms-content-fromtheinternet">
|
||||
<i>Not implemented yet</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -1,82 +0,0 @@
|
||||
@javascript @assets
|
||||
Feature: Manage files
|
||||
As a cms author
|
||||
I want to upload and manage files within the CMS
|
||||
So that I can insert them into my content efficiently
|
||||
|
||||
Background:
|
||||
Given a "image" "folder1/file1.jpg" was created "2012-01-01 12:00:00"
|
||||
And a "image" "folder1/folder1-1/file2.jpg" was created "2010-01-01 12:00:00"
|
||||
And a "folder" "folder2"
|
||||
And I am logged in with "ADMIN" permissions
|
||||
And I go to "/admin/assets"
|
||||
|
||||
@modal
|
||||
Scenario: I can add a new folder
|
||||
Given I press the "Add folder" button
|
||||
And I type "newfolder" into the dialog
|
||||
And I confirm the dialog
|
||||
Then the "Files" table should contain "newfolder"
|
||||
|
||||
Scenario: I can list files in a folder
|
||||
Given I click on "folder1" in the "Files" table
|
||||
Then the "folder1" table should contain "file1"
|
||||
And the "folder1" table should not contain "file1-1"
|
||||
|
||||
Scenario: I can upload a file to a folder
|
||||
Given I click on "folder1" in the "Files" table
|
||||
And I attach the file "testfile.jpg" to "AssetUploadField" with HTML5
|
||||
And I wait for 5 seconds
|
||||
Then the "folder1" table should contain "testfile"
|
||||
|
||||
Scenario: I can edit a file
|
||||
Given I click on "folder1" in the "Files" table
|
||||
And I click on "file1" in the "folder1" table
|
||||
And I fill in "renamedfile" for "Title"
|
||||
And I press the "Save" button
|
||||
And I follow "folder1"
|
||||
Then the "folder1" table should not contain "testfile"
|
||||
And the "folder1" table should contain "renamedfile"
|
||||
|
||||
Scenario: I can delete a file
|
||||
Given I click on "folder1" in the "Files" table
|
||||
And I click on "file1" in the "folder1" table
|
||||
And I press the "Archive" button
|
||||
Then the "folder1" table should not contain "file1"
|
||||
|
||||
Scenario: I can change the folder of a file
|
||||
Given I click on "folder1" in the "Files" table
|
||||
And I click on "file1" in the "folder1" table
|
||||
And I fill in "folder2" for the "Folder" dropdown
|
||||
And I press the "Save" button
|
||||
And I click "Files" in the ".breadcrumbs-wrapper" element
|
||||
And I click on "folder2" in the "Files" table
|
||||
And the "folder2" table should contain "file1"
|
||||
|
||||
Scenario: I can see allowed extensions help
|
||||
When I go to "/admin/assets/"
|
||||
And I click "Show allowed extensions" in the ".ss-uploadfield-view-allowed-extensions" element
|
||||
Then I should see "png,"
|
||||
|
||||
Scenario: I can filter the files list view using name
|
||||
Given I expand the content filters
|
||||
And I fill in "Name" with "file1"
|
||||
And I press the "Search" button
|
||||
Then the "Files" table should contain "file1"
|
||||
And the "Files" table should not contain "file2"
|
||||
|
||||
Scenario: I can filter the files list view using filetype
|
||||
Given a "file" "document.pdf"
|
||||
And I expand the content filters
|
||||
And I select "Image" from "File type" with javascript
|
||||
And I press the "Search" button
|
||||
Then the "Files" table should contain "file1"
|
||||
And the "Files" table should not contain "document"
|
||||
|
||||
Scenario: I can filter out files that don't match the date range
|
||||
Given I expand the content filters
|
||||
And I fill in "From" with "2003-01-01"
|
||||
And I fill in "To" with "2011-01-01"
|
||||
And I press the "Search" button
|
||||
And the "Files" table should contain "file2"
|
||||
And the "Files" table should not contain "file1"
|
@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\CMS\Controllers\AssetAdmin;
|
||||
|
||||
|
||||
/**
|
||||
* Tests {@see AssetAdmin}
|
||||
*/
|
||||
class AssetAdminTest extends SapphireTest {
|
||||
|
||||
protected static $fixture_file = 'AssetAdminTest.yml';
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
AssetStoreTest_SpyStore::activate('AssetAdminTest');
|
||||
|
||||
if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH);
|
||||
|
||||
// Create a test folders for each of the fixture references
|
||||
foreach(File::get()->filter('ClassName', 'Folder') as $folder) {
|
||||
/** @var Folder $folder */
|
||||
$folder->publishSingle();
|
||||
}
|
||||
|
||||
// Create a test files for each of the fixture references
|
||||
$content = str_repeat('x',1000000);
|
||||
foreach(File::get()->exclude('ClassName', 'Folder') as $file) {
|
||||
/** @var File $file */
|
||||
$file->setFromString($content, $file->generateFilename());
|
||||
$file->publishSingle();
|
||||
}
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
|
||||
// Remove the test files that we've created
|
||||
$fileIDs = $this->allFixtureIDs('File');
|
||||
foreach($fileIDs as $fileID) {
|
||||
$file = DataObject::get_by_id('File', $fileID);
|
||||
if($file && file_exists(BASE_PATH."/$file->Filename")) unlink(BASE_PATH."/$file->Filename");
|
||||
}
|
||||
|
||||
// Remove the test folders that we've crated
|
||||
$folderIDs = $this->allFixtureIDs('Folder');
|
||||
foreach($folderIDs as $folderID) {
|
||||
$folder = DataObject::get_by_id('Folder', $folderID);
|
||||
if($folder && file_exists(BASE_PATH."/$folder->Filename")) {
|
||||
Filesystem::removeFolder(BASE_PATH."/$folder->Filename");
|
||||
}
|
||||
}
|
||||
|
||||
// Remove left over folders and any files that may exist
|
||||
if(file_exists(ASSETS_PATH.'/AssetAdminTest')) {
|
||||
Filesystem::removeFolder(ASSETS_PATH.'/AssetAdminTest');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock a file search using AssetAdmin
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $from Created from date
|
||||
* @param string $to Createi to date
|
||||
* @param string $category
|
||||
* @return SS_List
|
||||
*/
|
||||
protected function getResultsForSearch($name = '', $from = '', $to = '', $category = '') {
|
||||
$request = new SS_HTTPRequest(null, 'admin/assets/show', array(
|
||||
'q' => array(
|
||||
'Name' => $name,
|
||||
'CreatedFrom' => $from,
|
||||
'CreatedTo' => $to,
|
||||
'AppCategory' => $category
|
||||
),
|
||||
'action_doSearch' => 'Apply Filter'
|
||||
));
|
||||
$admin = new AssetAdmin();
|
||||
$admin->setRequest($request);
|
||||
return $admin->getList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests filtering between date ranges
|
||||
*/
|
||||
public function testDateFromToLastSameDate() {
|
||||
$file1 = $this->objFromFixture('File', 'file1');
|
||||
$file2 = $this->objFromFixture('File', 'file2');
|
||||
|
||||
// Force creation times
|
||||
$file1->Created = '2014-01-05 23:11:39';
|
||||
$file1->write();
|
||||
$file2->Created = '2014-01-06 12:00:00';
|
||||
$file2->write();
|
||||
|
||||
// Mock searches for 4th Jan
|
||||
$results = $this->getResultsForSearch(null, '2014-01-04', '2014-01-04');
|
||||
$this->assertEmpty($results->column('Title'));
|
||||
|
||||
// Mock searches for 5th Jan
|
||||
$results = $this->getResultsForSearch(null, '2014-01-05', '2014-01-05');
|
||||
$this->assertEquals(array('File1'), $results->column('Title'));
|
||||
|
||||
// Mock searches for 5th-6th Jan
|
||||
$results = $this->getResultsForSearch(null, '2014-01-05', '2014-01-06');
|
||||
$this->assertEquals(array('File1', 'File2'), $results->sort('Title')->column('Title'));
|
||||
|
||||
// Mock searches for 6th Jan
|
||||
$results = $this->getResultsForSearch(null, '2014-01-06', '2014-01-06');
|
||||
$this->assertEquals(array('File2'), $results->column('Title'));
|
||||
|
||||
// Mock searches for 7th Jan
|
||||
$results = $this->getResultsForSearch(null, '2014-01-07', '2014-01-07');
|
||||
$this->assertEmpty($results->column('Title'));
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
Folder:
|
||||
folder1:
|
||||
Name: AssetAdminTest
|
||||
File:
|
||||
file1:
|
||||
Title: File1
|
||||
Name: file1.txt
|
||||
ParentID: =>Folder.folder1
|
||||
file2:
|
||||
Title: File2
|
||||
Name: file2.txt
|
||||
ParentID: =>Folder.folder1
|
@ -105,9 +105,6 @@ SilverStripe\Security\Member:
|
||||
Email: admin@example.com
|
||||
Password: ZXXlkwecxz2390232233
|
||||
Groups: =>SilverStripe\Security\Group.admin
|
||||
assetsonlyuser:
|
||||
Email: assetsonlyuser@test.com
|
||||
Groups: =>SilverStripe\Security\Group.assetsonly
|
||||
allcmssectionsuser:
|
||||
Email: allcmssectionsuser@test.com
|
||||
Groups: =>SilverStripe\Security\Group.allcmssections
|
||||
@ -118,9 +115,6 @@ SilverStripe\Security\Permission:
|
||||
admin:
|
||||
Code: ADMIN
|
||||
GroupID: =>SilverStripe\Security\Group.admin
|
||||
assetsonly:
|
||||
Code: CMS_ACCESS_AssetAdmin
|
||||
GroupID: =>SilverStripe\Security\Group.assetsonly
|
||||
allcmssections:
|
||||
Code: CMS_ACCESS_LeftAndMain
|
||||
GroupID: =>SilverStripe\Security\Group.allcmssections
|
||||
|
@ -32,11 +32,10 @@ class SilverStripeNavigatorTest extends SapphireTest {
|
||||
public function testCanView() {
|
||||
$page = $this->objFromFixture('Page', 'page1');
|
||||
$admin = $this->objFromFixture('SilverStripe\\Security\\Member', 'admin');
|
||||
$author = $this->objFromFixture('SilverStripe\\Security\\Member', 'assetsonlyuser');
|
||||
$navigator = new SilverStripeNavigator($page);
|
||||
|
||||
// TODO Shouldn't be necessary but SapphireTest logs in as ADMIN by default
|
||||
$this->logInWithPermission('CMS_ACCESS_AssetAdmin');
|
||||
$this->logInWithPermission('CMS_ACCESS_CMSMain');
|
||||
$items = $navigator->getItems();
|
||||
$classes = array_map('get_class', $items->toArray());
|
||||
$this->assertNotContains('SilverStripeNavigatorTest_ProtectedTestItem', $classes);
|
||||
|
Loading…
Reference in New Issue
Block a user