Project

General

Profile

Feature #41526 » patch_41526.patch

Adds a clickmenu item - Thomas Löffler, 2012-10-03 12:31

View differences:

t3lib/js/extjs/components/pagetree/javascript/actions.js
},
/**
* Shows a page in menu
*
* @param {Ext.tree.TreeNode} node
* @return {void}
*/
showPageInMenu: function(node) {
TYPO3.Components.PageTree.Commands.showNode(
node.attributes.nodeData,
function(response) {
if (this.evaluateResponse(response)) {
this.updateNode(node, node.isExpanded(), response);
}
},
this
);
},
/**
* Hides a page in menu
*
* @param {Ext.tree.TreeNode} node
* @return {void}
*/
hidePageInMenu: function(node) {
TYPO3.Components.PageTree.Commands.hideNode(
node.attributes.nodeData,
function(response) {
if (this.evaluateResponse(response)) {
this.updateNode(node, node.isExpanded(), response);
}
},
this
);
},
/**
* Reloads the content frame with the current module and node id
*
* @param {Ext.tree.TreeNode} node
t3lib/stddb/DefaultConfiguration.php
displayCondition = canBeRemoved != 0 && isMountPoint != 1
callbackAction = removeNode
}
1100 = ITEM
1100 {
name = hide
label = LLL:EXT:lang/locallang_common.xml:hide
spriteIcon = apps-pagetree-page-not-in-menu
displayCondition = getRecord|nav_hide = 0 && canBeHidedAndUnhided != 0
callbackAction = hidePageInMenu
}
1200 = ITEM
1200 {
name = show
label = LLL:EXT:lang/locallang_common.xml:show
spriteIcon = apps-pagetree-page-default
displayCondition = getRecord|nav_hide = 1 && canBeHidedAndUnhided != 0
callbackAction = showPageInMenu
}
}
1000 = SUBMENU
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
}
/**
* Shows the page in menu
*
* @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node
* @return void
*/
static public function showNode(\TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node) {
$data['pages'][$node->getWorkspaceId()]['nav_hide'] = 0;
self::processTceCmdAndDataMap(array(), $data);
}
/**
* Hides the page in menu
*
* @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node
* @return void
*/
static public function hideNode(\TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node) {
$data['pages'][$node->getWorkspaceId()]['nav_hide'] = 1;
self::processTceCmdAndDataMap(array(), $data);
}
/**
* Delete the page
*
* @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeCommands.php
}
/**
* Shows the page in menu
*
* @param stdClass $nodeData
* @return array
*/
public function showNode($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
try {
\TYPO3\CMS\Backend\Tree\Pagetree\Commands::showNode($node);
$newNode = \TYPO3\CMS\Backend\Tree\Pagetree\Commands::getNode($node->getId());
$newNode->setLeaf($node->isLeafNode());
$returnValue = $newNode->toArray();
} catch (\Exception $exception) {
$returnValue = array(
'success' => FALSE,
'error' => $exception->getMessage()
);
}
return $returnValue;
}
/**
* Hides the page in menu
*
* @param stdClass $nodeData
* @return array
*/
public function hideNode($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
try {
\TYPO3\CMS\Backend\Tree\Pagetree\Commands::hideNode($node);
$newNode = \TYPO3\CMS\Backend\Tree\Pagetree\Commands::getNode($node->getId());
$newNode->setLeaf($node->isLeafNode());
$returnValue = $newNode->toArray();
} catch (\Exception $exception) {
$returnValue = array(
'success' => FALSE,
'message' => $exception->getMessage()
);
}
return $returnValue;
}
/**
* Delete the page
*
* @param stdClass $nodeData
typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php
}
/**
* Checks if the page can be hided
*
* @return boolean
*/
public function canBeHidedAndUnhided() {
return $this->canEdit($this->record);
}
/**
* Checks if the page is allowed to can be cut
*
* @return boolean
typo3/sysext/lang/locallang_common.xlf
<trans-unit id="disabled" xml:space="preserve">
<source>Disabled</source>
</trans-unit>
<trans-unit id="hide" xml:space="preserve">
<source>Hide in menu</source>
</trans-unit>
<trans-unit id="down" xml:space="preserve">
<source>Down</source>
</trans-unit>
......
<trans-unit id="enabled" xml:space="preserve">
<source>Enabled</source>
</trans-unit>
<trans-unit id="show" xml:space="preserve">
<source>Show in menu</source>
</trans-unit>
<trans-unit id="file" xml:space="preserve">
<source>File</source>
</trans-unit>
(1-1/2)