72 $contextMenuActions =
$GLOBALS[
'BE_USER']->getTSConfig(
'options.contextMenu.' . $this->contextMenuType .
'.items');
73 return $contextMenuActions[
'properties'];
89 if ($displayCondition ===
'') {
93 $conditions = array();
94 preg_match_all(
'/(.+?)(>=|<=|!=|=|>|<)(.+?)(\\|\\||&&|$)/is', $displayCondition, $conditions);
97 $amountOfConditions = count($conditions[0]);
98 for ($i = 0; $i < $amountOfConditions; ++$i) {
100 $method = trim($conditions[1][$i]);
101 list($method, $index) = explode(
'|', $method);
102 if (!method_exists($node, $method)) {
106 $returnValue = call_user_func(array($node, $method));
107 if (is_array($returnValue)) {
108 $returnValue = $returnValue[$index];
111 $operator = trim($conditions[2][$i]);
112 $expected = trim($conditions[3][$i]);
113 if ($operator ===
'=') {
114 $returnValue = $returnValue == $expected;
115 } elseif ($operator ===
'>') {
116 $returnValue = $returnValue > $expected;
117 } elseif ($operator ===
'<') {
118 $returnValue = $returnValue < $expected;
119 } elseif ($operator ===
'>=') {
120 $returnValue = $returnValue >= $expected;
121 } elseif ($operator ===
'<=') {
122 $returnValue = $returnValue <= $expected;
123 } elseif ($operator ===
'!=') {
124 $returnValue = $returnValue != $expected;
126 $returnValue = FALSE;
130 if ($chainType ===
'||') {
131 $lastResult = $lastResult || $returnValue;
132 } elseif ($chainType ===
'&&') {
133 $lastResult = $lastResult && $returnValue;
135 $lastResult = $returnValue;
138 $chainType = trim($conditions[4][$i]);
151 protected function getNextContextMenuLevel(array $actions, \
TYPO3\CMS\Backend\Tree\TreeNode $node, $level = 0) {
155 return $actionCollection;
158 foreach ($actions as $index => $actionConfiguration) {
159 if (substr($index, -1) !==
'.') {
160 $type = $actionConfiguration;
161 if ($type !==
'DIVIDER') {
165 if (!in_array($type, array(
'DIVIDER',
'SUBMENU',
'ITEM'))) {
170 $action->setId($index);
171 if ($type ===
'DIVIDER') {
172 $action->setType(
'divider');
174 if (in_array($actionConfiguration[
'name'], $this->disableItems) || isset($actionConfiguration[
'displayCondition']) && trim($actionConfiguration[
'displayCondition']) !==
'' && !$this->
evaluateDisplayCondition($node, $actionConfiguration[
'displayCondition'])) {
178 $label =
$GLOBALS[
'LANG']->sL($actionConfiguration[
'label'], TRUE);
179 if ($type ===
'SUBMENU') {
180 $action->setType(
'submenu');
181 $action->setChildActions($this->getNextContextMenuLevel($actionConfiguration, $node, $level + 1));
183 $action->setType(
'action');
184 $action->setCallbackAction($actionConfiguration[
'callbackAction']);
185 if (is_array($actionConfiguration[
'customAttributes.'])) {
186 if (!empty($actionConfiguration[
'customAttributes.'][
'contentUrl'])) {
187 $actionConfiguration[
'customAttributes.'][
'contentUrl'] = $this->
replaceModuleTokenInContentUrl($actionConfiguration[
'customAttributes.'][
'contentUrl']);
189 $action->setCustomAttributes($actionConfiguration[
'customAttributes.']);
192 $action->setLabel($label);
193 if (isset($actionConfiguration[
'icon']) && trim($actionConfiguration[
'icon']) !==
'') {
194 $action->setIcon($actionConfiguration[
'icon']);
195 } elseif (isset($actionConfiguration[
'spriteIcon'])) {
196 $action->setClass(\
TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($actionConfiguration[
'spriteIcon']));
199 $actionCollection->offsetSet($level . (
int)$index, $action);
200 $actionCollection->ksort();
202 return $actionCollection;
212 $parsedUrl = parse_url($contentUrl);
213 parse_str($parsedUrl[
'query'], $urlParameters);
214 if (isset($urlParameters[
'M'])) {
216 unset($urlParameters[
'M']);
static makeInstance($className)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]