2007-07-19 12:40:05 +02:00
|
|
|
/**
|
|
|
|
* Configuration for the left hand tree
|
|
|
|
*/
|
|
|
|
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
|
|
|
|
SiteTreeHandlers.parentChanged_url = 'admin/assets/ajaxupdateparent';
|
|
|
|
SiteTreeHandlers.orderChanged_url = 'admin/assets/ajaxupdatesort';
|
|
|
|
SiteTreeHandlers.loadPage_url = 'admin/assets/getitem';
|
|
|
|
SiteTreeHandlers.loadTree_url = 'admin/assets/getsubtree';
|
|
|
|
SiteTreeHandlers.showRecord_url = 'admin/assets/show/';
|
2007-09-04 06:12:30 +02:00
|
|
|
SiteTreeHandlers.controller_url = 'admin/assets';
|
|
|
|
|
2007-07-19 12:40:05 +02:00
|
|
|
var _HANDLER_FORMS = {
|
2009-11-21 04:19:05 +01:00
|
|
|
addpage : 'Form_AddForm',
|
2009-01-06 03:18:33 +01:00
|
|
|
deletepage : 'Form_DeleteItemsForm',
|
2007-07-19 12:40:05 +02:00
|
|
|
sortitems : 'sortitems_options'
|
|
|
|
};
|
|
|
|
|
2009-11-21 04:18:25 +01:00
|
|
|
(function($) {
|
2009-11-21 04:19:14 +01:00
|
|
|
/**
|
|
|
|
* Delete selected folders through "batch actions" tab.
|
|
|
|
*/
|
2009-11-21 04:19:59 +01:00
|
|
|
$(document).ready(function() {
|
2009-11-21 04:19:41 +01:00
|
|
|
$('#Form_BatchActionsForm').concrete('ss').register(
|
|
|
|
// TODO Hardcoding of base URL
|
|
|
|
'admin/assets/batchactions/delete',
|
|
|
|
function(ids) {
|
|
|
|
var confirmed = confirm(
|
|
|
|
ss.i18n.sprintf(
|
|
|
|
ss.i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'),
|
|
|
|
ids.length
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return (confirmed) ? ids : false;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
2009-11-21 04:19:14 +01:00
|
|
|
|
2009-11-21 04:19:59 +01:00
|
|
|
$.concrete('ss', function($){
|
|
|
|
$('#Form_SyncForm').concrete({
|
|
|
|
onsubmit: function(e) {
|
2009-11-21 04:19:05 +01:00
|
|
|
var button = jQuery(this).find(':submit:first');
|
|
|
|
button.addClass('loading');
|
|
|
|
$.get(
|
|
|
|
jQuery(this).attr('action'),
|
|
|
|
function() {
|
|
|
|
button.removeClass('loading');
|
2009-11-21 04:21:03 +01:00
|
|
|
// reload current form and tree
|
2009-11-21 04:19:43 +01:00
|
|
|
var currNode = $('#sitetree')[0].firstSelected();
|
|
|
|
if(currNode) {
|
|
|
|
var url = $(currNode).find('a').attr('href');
|
2009-11-21 04:19:59 +01:00
|
|
|
$('#Form_EditForm').loadForm(url);
|
2009-11-21 04:19:43 +01:00
|
|
|
}
|
2009-11-21 04:21:03 +01:00
|
|
|
$('#sitetree')[0].setCustomURL('admin/assets/getsubtree');
|
|
|
|
$('#sitetree')[0].reload({onSuccess: function() {
|
|
|
|
// TODO Reset current tree node
|
|
|
|
}});
|
2009-11-21 04:19:05 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
return false;
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
2009-11-21 04:19:59 +01:00
|
|
|
});
|
2009-11-21 04:19:05 +01:00
|
|
|
});
|
2009-11-21 04:19:18 +01:00
|
|
|
}(jQuery));
|