Bug #24619 ยป 17091_v1.diff
t3lib/js/extjs/components/pagetree/javascript/deletiondropzone.js (Arbeitskopie) | ||
---|---|---|
}
|
||
var tree = node.ownerTree;
|
||
if (!top.TYPO3.configuration.inWorkspace) {
|
||
this.setHeight(50);
|
||
this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCanRestore);
|
||
this.updateText(
|
||
node.text + '<br />' +
|
||
'<span class="' + this.id + '-restore">' +
|
||
'<span class="' + this.id + '-restoreText">' +
|
||
TYPO3.Components.PageTree.LLL.dropZoneElementRemoved +
|
||
'</span>' +
|
||
'</span>',
|
||
false
|
||
);
|
||
var nodeHasChildNodes = (node.hasChildNodes() || node.isExpandable());
|
||
++this.amountOfDrops;
|
||
(function() {
|
||
if (!--this.amountOfDrops) {
|
||
this.toOriginState();
|
||
}
|
||
}).defer(10000, this);
|
||
var callback = null;
|
||
if (!top.TYPO3.configuration.inWorkspace && !nodeHasChildNodes) {
|
||
callback = this.setRecoverState.createDelegate(this);
|
||
}
|
||
this.textClickHandler = this.restoreNode.createDelegate(this, [node, tree]);
|
||
Ext.get(this.id + '-text').on('click', this.textClickHandler);
|
||
this.isPreviousSibling = false;
|
||
this.previousNode = node.parentNode;
|
||
if (node.previousSibling) {
|
||
this.previousNode = node.previousSibling;
|
||
this.isPreviousSibling = true;
|
||
}
|
||
if (nodeHasChildNodes) {
|
||
node.ownerTree.commandProvider.confirmDelete(node, tree, callback, true);
|
||
} else {
|
||
node.ownerTree.commandProvider.deleteNode(node, tree, callback);
|
||
}
|
||
node.ownerTree.commandProvider.deleteNode(node, tree);
|
||
}.createDelegate(this)
|
||
}));
|
||
},
|
||
/**
|
||
* Sets the drop zone into the recovery state
|
||
*
|
||
* @param {Ext.tree.TreeNode} node
|
||
* @param {TYPO3.Components.PageTree.Tree} tree
|
||
* @param {Boolean} succeeded
|
||
* @return {void}
|
||
*/
|
||
setRecoverState: function(node, tree, succeeded) {
|
||
if (!succeeded) {
|
||
this.toOriginState();
|
||
return;
|
||
}
|
||
this.show();
|
||
this.setHeight(50);
|
||
this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCanRestore);
|
||
this.updateText(
|
||
node.text + '<br />' +
|
||
'<span class="' + this.id + '-restore">' +
|
||
'<span class="' + this.id + '-restoreText">' +
|
||
TYPO3.Components.PageTree.LLL.dropZoneElementRemoved +
|
||
'</span>' +
|
||
'</span>',
|
||
false
|
||
);
|
||
++this.amountOfDrops;
|
||
(function() {
|
||
if (!--this.amountOfDrops) {
|
||
this.toOriginState();
|
||
}
|
||
}).defer(10000, this);
|
||
this.textClickHandler = this.restoreNode.createDelegate(this, [node, tree]);
|
||
Ext.get(this.id + '-text').on('click', this.textClickHandler);
|
||
this.isPreviousSibling = false;
|
||
this.previousNode = node.parentNode;
|
||
if (node.previousSibling) {
|
||
this.previousNode = node.previousSibling;
|
||
this.isPreviousSibling = true;
|
||
}
|
||
},
|
||
/**
|
||
* Updates the drop zone text label
|
||
*
|
||
* @param {String} text
|
t3lib/js/extjs/components/pagetree/javascript/tree.js (Arbeitskopie) | ||
---|---|---|
* Enables the deletion drop zone if configured. Also it creates the
|
||
* shown dd proxy element.
|
||
*
|
||
* @param {TYPO3.Components.PageTree.Tree} treePane
|
||
* @param {Ext.tree.TreeNode} node
|
||
* @return {void}
|
||
*/
|
||
initDd: function() {
|
||
if (this.deletionDropZoneId) {
|
||
initDd: function(treePanel, node) {
|
||
var nodeHasChildNodes = (node.hasChildNodes() || node.isExpandable());
|
||
if (this.deletionDropZoneId &&
|
||
(!nodeHasChildNodes ||
|
||
(nodeHasChildNodes && TYPO3.Components.PageTree.Configuration.canDeleteRecursivly)
|
||
)) {
|
||
Ext.getCmp(this.deletionDropZoneId).show();
|
||
}
|
||
this.initDDProxyElement();
|
t3lib/js/extjs/components/pagetree/javascript/actions.js (Arbeitskopie) | ||
---|---|---|
*
|
||
* @param {Ext.tree.TreeNode} node
|
||
* @param {TYPO3.Components.PageTree.Tree} tree
|
||
* @param {Function} callback
|
||
* @param {Boolean} recursiveDelete
|
||
* @return {void}
|
||
*/
|
||
confirmDelete: function(node, tree) {
|
||
TYPO3.Components.PageTree.Commands.getConfirmContentDeletionMessage(node.attributes.nodeData.id, function(message, options) {
|
||
Ext.Msg.show({
|
||
title: message.title,
|
||
msg: message.message,
|
||
buttons: Ext.Msg.YESNO,
|
||
fn: function (answer, text, button) {
|
||
if (answer === 'yes') {
|
||
TYPO3.Components.PageTree.Actions.deleteNode(node, tree);
|
||
return true;
|
||
}
|
||
return false;
|
||
},
|
||
animEl: 'elId'
|
||
});
|
||
}, this);
|
||
confirmDelete: function(node, tree, callback, recursiveDelete) {
|
||
callback = callback || null;
|
||
var title = TYPO3.Components.PageTree.LLL.deleteDialogTitle,
|
||
message = TYPO3.Components.PageTree.LLL.deleteDialogMessage;
|
||
if (recursiveDelete) {
|
||
message = TYPO3.Components.PageTree.LLL.recursiveDeleteDialogMessage;
|
||
}
|
||
Ext.Msg.show({
|
||
title: title,
|
||
msg: message,
|
||
buttons: Ext.Msg.YESNO,
|
||
fn: function (answer) {
|
||
if (answer === 'yes') {
|
||
TYPO3.Components.PageTree.Actions.deleteNode(node, tree, callback);
|
||
return true;
|
||
}
|
||
return false;
|
||
},
|
||
animEl: 'elId'
|
||
});
|
||
},
|
||
/**
|
||
... | ... | |
*
|
||
* @param {Ext.tree.TreeNode} node
|
||
* @param {TYPO3.Components.PageTree.Tree} tree
|
||
* @param {Function} callback
|
||
* @return {void}
|
||
*/
|
||
deleteNode: function(node, tree) {
|
||
deleteNode: function(node, tree, callback) {
|
||
TYPO3.Components.PageTree.Commands.deleteNode(
|
||
node.attributes.nodeData,
|
||
function(response) {
|
||
if (this.evaluateResponse(response)) {
|
||
var succeeded = this.evaluateResponse(response);
|
||
if (callback !== null) {
|
||
callback(node, tree, succeeded);
|
||
}
|
||
if (succeeded) {
|
||
// the node may not be removed in workspace mode
|
||
if (top.TYPO3.configuration.inWorkspace && response.id) {
|
||
this.updateNode(node, node.isExpanded(), response);
|
||
... | ... | |
}
|
||
},
|
||
/**
|
||
* Restores a given node and moves it to the given destination inside the tree. Use this
|
||
* method if you want to add it as the first child of the destination.
|
t3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_tree.php (Arbeitskopie) | ||
---|---|---|
'dropZoneElementRestored' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored', TRUE),
|
||
'searchTermInfo' => $GLOBALS['LANG']->sL($file . 'tree.searchTermInfo', TRUE),
|
||
'temporaryMountPointIndicatorInfo' => $GLOBALS['LANG']->sl($file . 'labels.temporaryDBmount', TRUE),
|
||
'deleteDialogTitle' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteItem', TRUE),
|
||
'deleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteWarning', TRUE),
|
||
'recursiveDeleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:recursiveDeleteWarning', TRUE),
|
||
),
|
||
'Configuration' => array(
|
||
'hideFilter' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'),
|
||
'displayDeleteConfirmation' => $GLOBALS['BE_USER']->jsConfirmation(4),
|
||
'canDeleteRecursivly' => $GLOBALS['BE_USER']->uc['recursiveDelete'] == TRUE,
|
||
'disableIconLinkToContextmenu' => $GLOBALS['BE_USER']->getTSConfigVal(
|
||
'options.pageTree.disableIconLinkToContextmenu'
|
||
),
|
t3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_commands.php (Arbeitskopie) | ||
---|---|---|
}
|
||
/**
|
||
* Gets title and message for JS deletion confirmation window
|
||
*
|
||
* @param $uid The uid of the record to be deleted
|
||
* @return array The title and the message for the confirmation window
|
||
*/
|
||
public function getConfirmContentDeletionMessage($uid) {
|
||
return array(
|
||
'title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteItem'),
|
||
'message' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteWarning')
|
||
);
|
||
}
|
||
/**
|
||
* Restore the page
|
||
*
|
||
* @param stdClass $nodeData
|
typo3/sysext/cms/layout/locallang.xml (Arbeitskopie) | ||
---|---|---|
<label index="move_page">Move page</label>
|
||
<label index="deleteItem">Delete</label>
|
||
<label index="deleteWarning">Are you sure you want to delete this record?</label>
|
||
<label index="recursiveDeleteWarning">You can recover pages with sub-pages only with the recycler. Are you sure you want to delete this pages?</label>
|
||
<label index="editColumn">Edit this column</label>
|
||
<label index="editPageProperties_curLang">Edit translation properties</label>
|
||
<label index="editInRTE">Edit in Rich Text Editor</label>
|