Project

General

Profile

Bug #24604 » 17073_noCSS_v1.diff

Administrator Admin, 2011-01-16 22:48

View differences:

t3lib/config_default.php (Arbeitskopie)
'em_wsdlURL' => 'http://typo3.org/wsdl/tx_ter_wsdl.php', // The SOAP URL for uploading extensions to the TER2. Usually doesn't need to be changed.
'em_mirrorListURL' => 'http://repositories.typo3.org/mirrors.xml.gz', // Allows to preset the URL for fetching the extension repository mirror list from. Used in the Extension Manager.
'requiredExt' => 'cms,lang,sv,em,list,pagetree', // String (exclude). List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
'requiredExt' => 'cms,lang,sv,em,list', // String (exclude). List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
'excludeForPackaging' => '(CVS|\..*|.*~|.*\.bak)', // String: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax!
'extCache' => 1, // <p>Integer (0, 1, 2, 3)</p><dl><dt>0</dt><dd>ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time</dd><dt>1</dt><dd>scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators)</dd><dt>2</dt><dd>scripts cached and prefix includes a hash based on the 'extList' string</dd><dt>3</dt><dd>scripts cached to typo3conf/temp_CACHED_* (no hash included at all...)</dd></dl>
'extList' => 'filelist,version,tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler', // String (exclude) List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
......
options.enableShowPalettes=1
options.file_list.enableDisplayBigControlPanel=selectable
options.file_list.enableDisplayThumbnails=selectable
options.file_list.enableClipBoard=selectable', // String (exclude). Enter lines of default backend user/group TSconfig.
options.file_list.enableClipBoard=selectable
options.pageTree {
doktypesToShowInNewPageDragArea = 1,6,4,7,3,254,255,199
}
options.contextMenu {
table {
pages_root {
disableItems =
items {
100 = ITEM
100 {
name = view
label = LLL:EXT:lang/locallang_core.xml:cm.view
spriteIcon = actions-document-view
displayCondition = canBeViewed != 0
callbackAction = viewPage
}
200 = ITEM
200 {
name = new
label = LLL:EXT:lang/locallang_core.xml:cm.new
spriteIcon = actions-page-new
displayCondition = canCreateNewPages != 0
callbackAction = newPageWizard
}
300 = DIVIDER
400 = ITEM
400 {
name = history
label = LLL:EXT:lang/locallang_misc.xml:CM_history
spriteIcon = actions-document-history-open
displayCondition = canShowHistory != 0
callbackAction = openHistoryPopUp
}
}
}
pages {
disableItems =
items {
100 = ITEM
100 {
name = view
label = LLL:EXT:lang/locallang_core.xml:cm.view
spriteIcon = actions-document-view
displayCondition = canBeViewed != 0
callbackAction = viewPage
}
200 = DIVIDER
300 = ITEM
300 {
name = disable
label = LLL:EXT:lang/locallang_core.xml:cm.hide
spriteIcon = actions-edit-hide
displayCondition = getRecord|hidden = 0 && canBeDisabledAndEnabled != 0
callbackAction = disablePage
}
400 = ITEM
400 {
name = enable
label = LLL:EXT:lang/locallang_core.xml:cm.unhide
spriteIcon = actions-edit-unhide
displayCondition = getRecord|hidden = 1 && canBeDisabledAndEnabled != 0
callbackAction = enablePage
}
500 = ITEM
500 {
name = edit
label = LLL:EXT:lang/locallang_core.xml:cm.edit
spriteIcon = actions-document-open
displayCondition = canBeEdited != 0
callbackAction = editPageProperties
}
600 = ITEM
600 {
name = info
label = LLL:EXT:lang/locallang_core.xml:cm.info
spriteIcon = actions-document-info
displayCondition = canShowInfo != 0
callbackAction = openInfoPopUp
}
700 = ITEM
700 {
name = history
label = LLL:EXT:lang/locallang_misc.xml:CM_history
spriteIcon = actions-document-history-open
displayCondition = canShowHistory != 0
callbackAction = openHistoryPopUp
}
800 = DIVIDER
900 = SUBMENU
900 {
label = LLL:EXT:lang/locallang_core.xml:cm.copyPasteActions
100 = ITEM
100 {
name = new
label = LLL:EXT:lang/locallang_core.xml:cm.new
spriteIcon = actions-page-new
displayCondition = canCreateNewPages != 0
callbackAction = newPageWizard
}
200 = DIVIDER
300 = ITEM
300 {
name = cut
label = LLL:EXT:lang/locallang_core.xml:cm.cut
spriteIcon = actions-edit-cut
displayCondition = isInCutMode = 0 && canBeCut != 0 && isMountPoint != 1
callbackAction = enableCutMode
}
400 = ITEM
400 {
name = cut
label = LLL:EXT:lang/locallang_core.xml:cm.cut
spriteIcon = actions-edit-cut-release
displayCondition = isInCutMode = 1 && canBeCut != 0
callbackAction = disableCutMode
}
500 = ITEM
500 {
name = copy
label = LLL:EXT:lang/locallang_core.xml:cm.copy
spriteIcon = actions-edit-copy
displayCondition = isInCopyMode = 0 && canBeCopied != 0
callbackAction = enableCopyMode
}
600 = ITEM
600 {
name = copy
label = LLL:EXT:lang/locallang_core.xml:cm.copy
spriteIcon = actions-edit-copy-release
displayCondition = isInCopyMode = 1 && canBeCopied != 0
callbackAction = disableCopyMode
}
700 = ITEM
700 {
name = pasteInto
label = LLL:EXT:lang/locallang_core.xml:cm.pasteinto
spriteIcon = actions-document-paste-into
displayCondition = getContextInfo|inCopyMode = 1 || getContextInfo|inCutMode = 1 && canBePastedInto != 0
callbackAction = pasteIntoNode
}
800 = ITEM
800 {
name = pasteAfter
label = LLL:EXT:lang/locallang_core.xml:cm.pasteafter
spriteIcon = actions-document-paste-after
displayCondition = getContextInfo|inCopyMode = 1 || getContextInfo|inCutMode = 1 && canBePastedAfter != 0
callbackAction = pasteAfterNode
}
900 = DIVIDER
1000 = ITEM
1000 {
name = delete
label = LLL:EXT:lang/locallang_core.xml:cm.delete
spriteIcon = actions-edit-delete
displayCondition = canBeRemoved != 0 && isMountPoint != 1
callbackAction = removeNode
}
}
1000 = SUBMENU
1000 {
label = LLL:EXT:lang/locallang_core.xml:cm.branchActions
100 = ITEM
100 {
name = mountAsTreeroot
label = LLL:EXT:lang/locallang_core.xml:cm.tempMountPoint
spriteIcon = actions-system-extension-documentation
displayCondition = canBeTemporaryMountPoint != 0 && isMountPoint = 0
callbackAction = mountAsTreeRoot
}
200 = DIVIDER
300 = ITEM
300 {
name = expandBranch
label = LLL:EXT:lang/locallang_core.xml:cm.expandBranch
displayCondition =
callbackAction = expandBranch
}
400 = ITEM
400 {
name = collapseBranch
label = LLL:EXT:lang/locallang_core.xml:cm.collapseBranch
displayCondition =
callbackAction = collapseBranch
}
}
}
}
}
}
', // String (exclude). Enter lines of default backend user/group TSconfig.
'defaultPageTSconfig' => 'mod.web_list.enableDisplayBigControlPanel=selectable
mod.web_list.enableClipBoard=selectable
mod.web_list.enableLocalizationView=selectable', // String (exclude).Enter lines of default Page TSconfig.
......
'TYPO3.LiveSearchActions.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_backendlivesearch.php:extDirect_DataProvider_BackendLiveSearch',
'TYPO3.BackendUserSettings.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_beusersettings.php:extDirect_DataProvider_BackendUserSettings',
'TYPO3.ExtDirectStateProvider.ExtDirect' => 't3lib/extjs/dataprovider/class.extdirect_dataprovider_state.php:extDirect_DataProvider_State',
'TYPO3.Components.PageTree.DataProvider' => 't3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_tree.php:t3lib_tree_pagetree_extdirect_Tree',
'TYPO3.Components.PageTree.Commands' => 't3lib/tree/pagetree/extdirect/class.t3lib_tree_pagetree_extdirect_tree.php:t3lib_tree_pagetree_extdirect_Commands',
'TYPO3.Components.PageTree.ContextMenuDataProvider' => 't3lib/contextmenu/pagetree/extdirect/class.t3lib_contextmenu_pagetree_extdirect_contextmenu.php:t3lib_contextmenu_pagetree_extdirect_ContextMenu',
),
),
'EXTCONF' => array( // Here you may add manually set configuration options for your extensions. Eg. $TYPO3_CONF_VARS['EXTCONF']['my_extension_key']['my_option'] = 'my_value';
......
$ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60); // $ACCESS_TIME is a common time in minutes for access control
$SIM_ACCESS_TIME = $ACCESS_TIME; // if $SIM_EXEC_TIME is changed this value must be set accordingly
?>
?>
t3lib/stddb/tables.php (Arbeitskopie)
'help' => '',
);
// register the pagetree core navigation component
t3lib_extMgm::addCoreNavigationComponent('web', 'typo3-pagetree', array(
'TYPO3.Components.PageTree'
));
/**
* $TBE_STYLES configures backend styles and colors; Basically this contains all the values that can be used to create new skins for TYPO3.
t3lib/js/extjs/components/pagetree/javascript/deletiondropzone.js (Revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
Ext.namespace('TYPO3.Components.PageTree');
/**
* @class TYPO3.Components.PageTree.DeletionDropZone
*
* Deletion Drop Zone
*
* @namespace TYPO3.Components.PageTree
* @extends Ext.Panel
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
/**
* Border
*
* @type {Boolean}
*/
border: true,
/**
* Hide the drop zone initially
*
* @type {Boolean}
*/
hidden: true,
/**
* Command Provider
*
* @cfg {Object}
*/
commandProvider: null,
/**
* Drag and Drop Group
*
* @cfg {String}
*/
ddGroup: '',
/**
* Main Application
*
* @cfg {TYPO3.Components.PageTree.App}
*/
app: null,
/**
* Removed node had a previous sibling
*
* @type {Boolean}
*/
isPreviousSibling: false,
/**
* Removed node
*
* @type {Ext.tree.TreeNode}
*/
previousNode: null,
/**
* Click Handler for the recovery text
*
* @type {Function}
*/
textClickHandler: null,
/**
* Amount of drops (used to prevent early hiding of the box)
*
* @type {int}
*/
amountOfDrops: 0,
/**
* Listeners
*
* The "afterrender" event creates the drop zone
*/
listeners: {
afterrender: {
fn: function() {
this.createDropZone();
this.getEl().on('mouseout', function(e) {
if (!e.within(this.getEl(), true)) {
this.removeClass(this.id + '-activateProxyOver');
if (!this.app.activeTree.shouldCopyNode) {
this.app.activeTree.copyHint.show();
}
}
}, this);
}
},
beforehide: {
fn: function() {
if (this.textClickHandler) {
return false;
}
}
}
},
/**
* Initializes the component
*
* @return {void}
*/
initComponent: function() {
this.html = '<p><span id="' + this.id + '-icon" class="' +
TYPO3.Components.PageTree.Sprites.TrashCan +
'">&nbsp;</span><span id="' + this.id + '-text">' +
TYPO3.Components.PageTree.LLL.dropToRemove + '</span></p>';
TYPO3.Components.PageTree.DeletionDropZone.superclass.initComponent.apply(this, arguments);
},
/**
* Creates the drop zone and it's functionality
*
* @return {void}
*/
createDropZone: function() {
(new Ext.dd.DropZone(this.getEl(), {
ddGroup: this.ddGroup,
notifyOver: function(ddProxy, e) {
ddProxy.setDragElPos(e.xy[0], e.xy[1] - 60);
return this.id + '-proxyOver';
}.createDelegate(this),
notifyEnter: function() {
this.addClass(this.id + '-activateProxyOver');
if (!this.app.activeTree.shouldCopyNode) {
this.app.activeTree.copyHint.hide();
}
return this.id + '-proxyOver';
}.createDelegate(this),
notifyDrop: function(ddProxy, e, n) {
var node = n.node;
if (!node) {
return;
}
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
);
++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;
}
}
node.ownerTree.commandProvider.deleteNode(node, tree);
}.createDelegate(this)
}));
},
/**
* Updates the drop zone text label
*
* @param {String} text
* @param {Boolean} animate
* @return {void}
*/
updateText: function(text, animate) {
animate = animate || false;
var elementText = Ext.get(this.id + '-text');
if (animate) {
elementText.animate({opacity: {to: 0}}, 1, function(elementText) {
elementText.update(text);
elementText.setStyle('opacity', 1);
});
} else {
elementText.update(text);
}
},
/**
* Updates the drop zone icon with another sprite icon
*
* @param {String} classes
* @return {void}
*/
updateIcon: function(classes) {
Ext.get(this.id + '-icon').set({
'class': classes
});
},
/**
* Resets the drop zone to the initial state
*
* @param {Boolean} hide
* @return {void}
*/
toOriginState: function(hide) {
if (hide !== false) {
hide = true;
}
Ext.get(this.id + '-text').un('click', this.textClickHandler);
this.previousNode = this.textClickHandler = null;
this.isPreviousSibling = false;
if (hide && !this.app.activeTree.dragZone.dragging) {
this.hide();
}
this.setHeight(35);
this.updateText(TYPO3.Components.PageTree.LLL.dropToRemove, false);
this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCan);
},
/**
* Restores the last removed node
*
* @param {Ext.tree.TreeNode} node
* @param {TYPO3.Components.PageTree.Tree} tree
* @return {void}
*/
restoreNode: function(node, tree) {
if (this.isPreviousSibling) {
this.commandProvider.restoreNodeAfterDestination(node, tree, this.previousNode);
} else {
this.commandProvider.restoreNodeToFirstChildOfDestination(node, tree, this.previousNode);
}
this.setHeight(35);
this.updateText(TYPO3.Components.PageTree.LLL.dropZoneElementRestored);
(function() {
if (this.textClickHandler) {
this.toOriginState();
}
}).defer(3000, this);
}
});
// XTYPE Registration
Ext.reg('TYPO3.Components.PageTree.DeletionDropZone', TYPO3.Components.PageTree.DeletionDropZone);
t3lib/js/extjs/components/pagetree/javascript/treeeditor.js (Revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
Ext.namespace('TYPO3.Components.PageTree');
/**
* @class TYPO3.Components.PageTree.TreeEditor
*
* Custom Tree Editor implementation to enable different source fields for the
* editable label.
*
* @namespace TYPO3.Components.PageTree
* @extends Ext.tree.TreeEditor
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
TYPO3.Components.PageTree.TreeEditor = Ext.extend(Ext.tree.TreeEditor, {
/**
* Don't send any save events if the value wasn't changed
*
* @type {Boolean}
*/
ignoreNoChange: true,
/**
* Edit delay
*
* @type {int}
*/
editDelay: 250,
/**
* Indicates if an underlying shadow should be shown
*
* @type {Boolean}
*/
shadow: false,
/**
* Listeners
*
* Handles the synchronization between the edited label and the shown label.
*/
listeners: {
beforecomplete: function(node) {
this.updatedValue = this.getValue();
if (this.updatedValue === '') {
return false;
}
this.setValue(this.editNode.attributes.prefix + Ext.util.Format.htmlEncode(this.updatedValue) + this.editNode.attributes.suffix);
},
complete: {
fn: function(node, newValue, oldValue) {
this.editNode.ownerTree.commandProvider.saveTitle(node, this.updatedValue, oldValue, this);
}
}
},
/**
* Updates the edit node
*
* @param {Ext.tree.TreeNode} node
* @param {String} editableText
* @param {String} updatedNode
* @return {void}
*/
updateNodeText: function(node, editableText, updatedNode) {
this.editNode.setText(this.editNode.attributes.prefix + updatedNode + this.editNode.attributes.suffix);
this.editNode.attributes.editableText = editableText;
},
/**
* Overridden method to set another editable text than the node text attribute
*
* @param {Ext.tree.TreeNode} node
* @return {Boolean}
*/
triggerEdit: function(node) {
this.completeEdit();
if (node.attributes.editable !== false) {
this.editNode = node;
if (this.tree.autoScroll) {
Ext.fly(node.ui.getEl()).scrollIntoView(this.tree.body);
}
var value = node.text || '';
if (!Ext.isGecko && Ext.isEmpty(node.text)) {
node.setText(' ');
}
// TYPO3 MODIFICATION to use another attribute
value = node.attributes.editableText;
this.autoEditTimer = this.startEdit.defer(this.editDelay, this, [node.ui.textNode, value]);
return false;
}
}
});
// XTYPE Registration
Ext.reg('TYPO3.Components.PageTree.TreeEditor', TYPO3.Components.PageTree.TreeEditor);
t3lib/js/extjs/components/pagetree/javascript/Ext.ux.state.TreePanel.js (Revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
Ext.ns('Ext.ux.state');
// dummy constructor
Ext.ux.state.TreePanel = function() {};
/**
* State Provider for a tree panel
*/
Ext.override(Ext.ux.state.TreePanel, {
/**
* Initializes the plugin
* @param {Ext.tree.TreePanel} tree
* @private
*/
init:function(tree) {
tree.lastSelectedNode = null;
tree.isRestoringState = false;
tree.stateHash = {};
// install event handlers on TreePanel
tree.on({
// add path of expanded node to stateHash
beforeexpandnode:function(n) {
if (this.isRestoringState) {
return;
}
this.stateHash[n.id] = n.getPath();
},
// delete path and all subpaths of collapsed node from stateHash
beforecollapsenode:function(n) {
if (this.isRestoringState) {
return;
}
delete this.stateHash[n.id];
var cPath = n.getPath();
for(var p in this.stateHash) {
if(this.stateHash.hasOwnProperty(p)) {
if(this.stateHash[p].indexOf(cPath) !== -1) {
delete this.stateHash[p];
}
}
}
},
beforeclick: function(node) {
if (this.isRestoringState) {
return;
}
this.stateHash['lastSelectedNode'] = node.id;
}
});
// update state on node expand or collapse
tree.stateEvents = tree.stateEvents || [];
tree.stateEvents.push('expandnode', 'collapsenode', 'click');
// add state related props to the tree
Ext.apply(tree, {
// keeps expanded nodes paths keyed by node.ids
stateHash:{},
restoreState: function() {
this.isRestoringState = true;
for(var p in this.stateHash) {
if(this.stateHash.hasOwnProperty(p)) {
this.expandPath(this.stateHash[p]);
}
}
// get last selected node
if (this.stateHash['lastSelectedNode']) {
var node = this.getNodeById(this.stateHash['lastSelectedNode']);
if (node) {
this.selectPath(node.getPath());
var contentId = TYPO3.Backend.ContentContainer.getIdFromUrl() ||
String(fsMod.recentIds['web']) || '-1';
var isCurrentSelectedNode = (
String(node.attributes.nodeData.id) === contentId ||
contentId.indexOf('pages' + String(node.attributes.nodeData.id)) !== -1
);
if (contentId !== '-1' && !isCurrentSelectedNode &&
this.commandProvider && this.commandProvider.singleClick
) {
this.commandProvider.singleClick(node, this);
}
}
}
this.isRestoringState = false;
},
// apply state on tree initialization
applyState:function(state) {
if(state) {
Ext.apply(this, state);
// it is too early to expand paths here
// so do it once on root load
this.root.on({
load: {
single:true,
scope:this,
fn: this.restoreState
}
});
}
},
// returns stateHash for save by state manager
getState:function() {
return {stateHash:this.stateHash};
}
});
}
});
t3lib/js/extjs/components/pagetree/javascript/contextmenu.js (Revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
Ext.namespace('TYPO3.Components.PageTree');
/**
* @class TYPO3.Components.PageTree.ContextMenu
*
* Context menu implementation
*
* @namespace TYPO3.Components.PageTree
* @extends Ext.menu.Menu
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
TYPO3.Components.PageTree.ContextMenu = Ext.extend(Ext.menu.Menu, {
/**
* Context menu node
*
* @cfg {Ext.tree.TreeNode}
*/
node: null,
/**
* Page Tree
*
* @cfg {TYPO3.Components.PageTree.Tree}
*/
pageTree: null,
/**
* Component Id
*
* @type {String}
*/
id: 'typo3-pagetree-contextmenu',
/**
* Listeners
*
* The itemclick event triggers the configured single click action
*/
listeners: {
itemclick: {
fn: function (item) {
if (this.pageTree.commandProvider[item.callbackAction]) {
if (item.parentMenu.pageTree.stateHash) {
fsMod.recentIds['web'] = item.parentMenu.node.attributes.nodeData.id;
item.parentMenu.pageTree.stateHash['lastSelectedNode'] = item.parentMenu.node.id;
}
this.pageTree.commandProvider[item.callbackAction](
item.parentMenu.node,
item.parentMenu.pageTree
);
}
}
}
},
/**
* Fills the menu with the actions
*
* @param {Ext.tree.TreeNode} node
* @param {TYPO3.Components.PageTree.Tree} pageTree
* @param {Object} contextMenuConfiguration
* @return {void}
*/
fill: function(node, pageTree, contextMenuConfiguration) {
this.node = node;
this.pageTree = pageTree;
var components = this.preProcessContextMenuConfiguration(contextMenuConfiguration);
if (components.length) {
for (var component in components) {
if (components[component] === '-') {
this.addSeparator();
} else if (typeof components[component] === 'object') {
this.addItem(components[component]);
}
}
}
},
/**
* Parses the context menu actions array recursively and generates the
* components for the context menu including separators/dividers and sub menus
*
* @param {Object} contextMenuConfiguration
* @param {int} level
* @return {Object}
*/
preProcessContextMenuConfiguration: function(contextMenuConfiguration, level) {
level = level || 0;
if (level > 5) {
return [];
}
var components = [];
var index = 0;
var modulesInsideGroup = false;
var subMenus = 0;
for (var singleAction in contextMenuConfiguration) {
if (contextMenuConfiguration[singleAction]['type'] === 'submenu') {
var subMenuComponents = this.preProcessContextMenuConfiguration(
contextMenuConfiguration[singleAction]['childActions'],
level + 1
);
if (subMenuComponents.length) {
var subMenu = new TYPO3.Components.PageTree.ContextMenu({
id: this.id + '-sub' + ++subMenus,
items: subMenuComponents,
node: this.node,
pageTree: this.pageTree
});
components[index++] = {
text: contextMenuConfiguration[singleAction]['label'],
cls: 'contextMenu-subMenu',
menu: subMenu,
icon: contextMenuConfiguration[singleAction]['icon'],
iconCls: contextMenuConfiguration[singleAction]['class']
};
}
} else if (contextMenuConfiguration[singleAction]['type'] === 'divider') {
if (modulesInsideGroup) {
components[index++] = '-';
modulesInsideGroup = false;
}
} else {
modulesInsideGroup = true;
if (typeof contextMenuConfiguration[singleAction] === 'object') {
var component = {
'text': contextMenuConfiguration[singleAction]['label'],
'icon': contextMenuConfiguration[singleAction]['icon'],
'iconCls': contextMenuConfiguration[singleAction]['class'],
'callbackAction': contextMenuConfiguration[singleAction]['callbackAction']
};
component.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate(
'<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}">',
'<span class="{hrefTarget}">',
'<img src="{icon}" class="x-menu-item-icon {iconCls}" unselectable="on" />',
'</span>',
'<span class="x-menu-item-text">{text}</span>',
'</a>'
);
components[index++] = component;
}
}
}
// remove divider if it's the last item of the context menu
if (components.last() === '-') {
components[components.length - 1] = '';
}
return components;
}
});
// XTYPE Registration
Ext.reg('TYPO3.Components.PageTree.ContextMenu', TYPO3.Components.PageTree.ContextMenu);
t3lib/js/extjs/components/pagetree/javascript/loadorder.txt (Revision 0)
treeeditor.js
tree.js
filteringtree.js
nodeui.js
deletiondropzone.js
toppanel.js
contextmenu.js
actions.js
Ext.ux.state.TreePanel.js
app.js
t3lib/js/extjs/components/pagetree/javascript/tree.js (Revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 TYPO3 Tree Team <http://forge.typo3.org/projects/typo3v4-extjstrees>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
Ext.namespace('TYPO3.Components.PageTree');
/**
* @class TYPO3.Components.PageTree.Tree
*
* Generic Tree Panel
*
* @namespace TYPO3.Components.PageTree
* @extends Ext.tree.TreePanel
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
/**
* Border
*
* @type {Boolean}
*/
border: false,
/**
* Indicates if the root node is visible
*
* @type {Boolean}
*/
rootVisible: false,
/**
* Enable the drag and drop feature
*
* @cfg {Boolean}
*/
enableDD: true,
/**
* Drag and Drop Group
*
* @cfg {String}
*/
ddGroup: '',
/**
* Indicates if the label should be editable
*
* @cfg {Boolean}
*/
labelEdit: true,
/**
* User Interface Provider
*
* @cfg {Ext.tree.TreeNodeUI}
*/
uiProvider: null,
/**
* Data Provider
*
* @cfg {Object}
*/
treeDataProvider: null,
/**
* Command Provider
*
* @cfg {Object}
*/
commandProvider : null,
/**
* Context menu provider
*
* @cfg {Object}
*/
contextMenuProvider: null,
/**
* Id of the deletion drop zone if any
*
* @cfg {String}
*/
deletionDropZoneId: '',
/**
* Root Node Configuration
*
* @type {Object}
*/
rootNodeConfig: {
id: 'root',
expanded: true,
nodeData: {
id: 'root'
}
},
/**
* Indicator if the control key is pressed
*
* @type {Boolean}
*/
isControlPressed: false,
/**
* Context Node
*
* @type {Ext.tree.TreeNode}
*/
t3ContextNode: null,
/**
* Context Information
*
* @type {Object}
*/
t3ContextInfo: {
inCopyMode: false,
inCutMode: false
},
/**
* Registered clicks for the double click feature
*
* @type {int}
*/
clicksRegistered: 0,
/**
* Indicator if the control key was pressed
*
* @type {Boolean}
*/
controlKeyPressed: false,
/**
* Listeners
*
* Event handlers that handle click events and synchronizes the label edit,
* double click and single click events in a useful way.
*/
listeners: {
// single click handler that only triggers after a delay to let the double click event
// a possibility to be executed (needed for label edit)
click: {
fn: function(node, event) {
if (this.clicksRegistered === 2) {
this.clicksRegistered = 0;
event.stopEvent();
return false;
}
this.clicksRegistered = 0;
if (this.commandProvider.singleClick) {
this.commandProvider.singleClick(node, this);
}
},
delay: 400
},
// prevent the expanding / collapsing on double click
beforedblclick: {
fn: function() {
return false;
}
},
// prevents label edit on a selected node
beforeclick: {
fn: function(node, event) {
if (!this.clicksRegistered && this.getSelectionModel().isSelected(node)) {
node.fireEvent('click', node, event);
++this.clicksRegistered;
return false;
}
++this.clicksRegistered;
}
}
},
/**
* Initializes the component
*
* @return {void}
*/
initComponent: function() {
if (!this.uiProvider) {
this.uiProvider = TYPO3.Components.PageTree.PageTreeNodeUI;
}
Ext.dd.DragDropMgr.useCache = false;
this.root = new Ext.tree.AsyncTreeNode(this.rootNodeConfig);
this.addTreeLoader();
if (this.labelEdit) {
this.enableInlineEditor();
}
if (this.enableDD) {
this.dragConfig = {ddGroup: this.ddGroup};
this.enableDragAndDrop();
}
if (this.contextMenuProvider) {
this.enableContextMenu();
}
TYPO3.Components.PageTree.Tree.superclass.initComponent.apply(this, arguments);
},
/**
* Refreshes the tree
*
* @param {Function} callback
* @param {Object} scope
* return {void}
*/
refreshTree: function(callback, scope) {
// remove readable rootline elements while refreshing
if (!this.inRefreshingMode) {
var rootlineElements = Ext.select('.x-tree-node-readableRootline');
if (rootlineElements) {
rootlineElements.each(function(element) {
element.remove();
});
}
}
this.refreshNode(this.root, callback, scope);
},
/**
* Refreshes a given node
*
* @param {Ext.tree.TreeNode} node
* @param {Function} callback
* @param {Object} scope
* return {void}
*/
refreshNode: function(node, callback, scope) {
if (this.inRefreshingMode) {
return;
}
scope = scope || node;
this.inRefreshingMode = true;
var loadCallback = function(node) {
node.ownerTree.inRefreshingMode = false;
if (node.ownerTree.restoreState) {
node.ownerTree.restoreState(node.getPath());
}
};
if (callback) {
loadCallback = callback.createSequence(loadCallback);
}
this.getLoader().load(node, loadCallback, scope);
},
/**
* Adds a tree loader implementation that uses the directFn feature
*
* return {void}
*/
addTreeLoader: function() {
this.loader = new Ext.tree.TreeLoader({
directFn: this.treeDataProvider.getNextTreeLevel,
paramOrder: 'nodeId,attributes',
nodeParameter: 'nodeId',
baseAttrs: {
uiProvider: this.uiProvider
},
// an id can never be zero in ExtJS, but this is needed
// for the root line feature or it will never be working!
createNode: function(attr) {
if (attr.id == 0) {
attr.id = 'siteRootNode';
}
return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
},
listeners: {
beforeload: function(treeLoader, node) {
treeLoader.baseParams.nodeId = node.id;
treeLoader.baseParams.attributes = node.attributes.nodeData;
}
}
});
},
/**
* Enables the context menu feature
*
* return {void}
*/
enableContextMenu: function() {
this.contextMenu = new TYPO3.Components.PageTree.ContextMenu();
this.on('contextmenu', function(node, event) {
this.openContextMenu(node, event);
});
},
/**
* Open a context menu for the given node
*
* @param {Ext.tree.TreeNode} node
* @param {Ext.EventObject} event
* return {void}
*/
openContextMenu: function(node, event) {
var attributes = Ext.apply(node.attributes.nodeData, {
t3ContextInfo: node.ownerTree.t3ContextInfo
});
this.contextMenuProvider.getActionsForNodeArray(
attributes,
function(configuration) {
this.contextMenu.removeAll();
this.contextMenu.fill(node, this, configuration);
if (this.contextMenu.items.length) {
this.contextMenu.showAt(event.getXY());
}
},
this
);
},
/**
* Initialize the inline editor for the given tree.
*
* @return {void}
*/
enableInlineEditor: function() {
(new TYPO3.Components.PageTree.TreeEditor(this));
},
/**
* Enables the drag and drop feature
*
* return {void}
*/
enableDragAndDrop: function() {
// init proxy element
this.on('startdrag', this.initDd, this);
this.on('enddrag', this.stopDd, this);
// node is moved
this.on('movenode', this.moveNode, this);
// new node is created/copied
this.on('beforenodedrop', this.beforeDropNode, this);
this.on('nodedrop', this.dropNode, this);
// listens on the ctrl key to toggle the copy mode
(new Ext.KeyMap(document, {
key: Ext.EventObject.CONTROL,
scope: this,
buffer: 250,
fn: function() {
if (!this.controlKeyPressed && this.dragZone.dragging && this.copyHint) {
if (this.shouldCopyNode) {
this.copyHint.show();
} else {
this.copyHint.hide();
}
this.shouldCopyNode = !this.shouldCopyNode;
this.dragZone.proxy.el.toggleClass('typo3-pagetree-copy');
}
this.controlKeyPressed = true;
}
}, 'keydown'));
(new Ext.KeyMap(document, {
key: Ext.EventObject.CONTROL,
scope: this,
fn: function() {
this.controlKeyPressed = false;
}
}, 'keyup'));
// listens on the escape key to stop the dragging
(new Ext.KeyMap(document, {
key: Ext.EventObject.ESC,
scope: this,
buffer: 250,
fn: function(event) {
if (this.dragZone.dragging) {
Ext.dd.DragDropMgr.stopDrag(event);
this.dragZone.onInvalidDrop(event);
}
}
}, 'keydown'));
},
/**
* Disables the deletion drop zone if configured
*
* @return {void}
*/
stopDd: function() {
if (this.deletionDropZoneId) {
Ext.getCmp(this.deletionDropZoneId).hide();
}
},
... This diff was truncated because it exceeds the maximum size that can be displayed.
(3-3/3)