/** * Preparing menu content and initializing clipboard and module TSconfig * * @return void * @access public */ function menuConfig() { global $TYPO3_CONF_VARS; // Prepare array of sys_language uids for available translations: $this->translatedLanguagesArr = $this->getAvailableLanguages($this->id); $translatedLanguagesUids = array(); foreach ($this->translatedLanguagesArr as $languageRecord) { $translatedLanguagesUids[$languageRecord['uid']] = $languageRecord['title']; } $this->MOD_MENU = array('tt_content_showHidden' => 1, 'showOutline' => 1, 'language' => $translatedLanguagesUids, 'clip_parentPos' => '', 'clip' => '', 'langDisplayMode' => '', 'recordsView_table' => '', 'recordsView_start' => '', 'disablePageStructureInheritance' => ''); // Hook: menuConfig_preProcessModMenu $menuHooks = $this->hooks_prepareObjectsArray('menuConfigClass'); foreach ($menuHooks as $hookObj) { if (method_exists($hookObj, 'menuConfig_preProcessModMenu')) { $hookObj->menuConfig_preProcessModMenu($this->MOD_MENU, $this); } } // page/be_user TSconfig settings and blinding of menu-items $this->MOD_MENU['view'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['view'], 'menu.function'); if (!isset($this->modTSconfig['properties']['sideBarEnable'])) { $this->modTSconfig['properties']['sideBarEnable'] = 1; } // CLEANSE SETTINGS $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); }
/** * Modifies parent objects internal MOD_MENU array, adding items this module needs. * * @return array Items merged with the parent objects. * @see t3lib_extobjbase::init() */ function modMenu() { global $LANG; $modMenuAdd = array($this->function_key => array()); $modMenuAdd[$this->function_key] = $this->pObj->mergeExternalItems($this->pObj->MCONF['name'], $this->function_key, $modMenuAdd[$this->function_key]); $modMenuAdd[$this->function_key] = t3lib_BEfunc::unsetMenuItems($this->pObj->modTSconfig['properties'], $modMenuAdd[$this->function_key], 'menu.' . $this->function_key); return $modMenuAdd; }
/** * Returns the menu array * * @return array */ function modMenu() { $modMenu = array('depth' => array(0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'), 1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'), 2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'), 3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'), 99 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi')), 'type' => array('pathcache' => 'ID-to-path mapping', 'decode' => 'Decode cache', 'encode' => 'Encode cache', 'uniqalias' => 'Unique Aliases', 'redirects' => 'Redirects', 'config' => 'Configuration', 'log' => 'Error Log')); $modMenu['type'] = t3lib_BEfunc::unsetMenuItems($this->pObj->modTSconfig['properties'], $modMenu['type'], 'menu.realurl_type'); return $modMenu; }
/** * @param array $modTSconfig Module TS config array * @param array $itemArray Array of items from which to remove items. * @param string $TSref $TSref points to the "object string" in $modTSconfig * @return array The modified $itemArray is returned. */ public function unsetMenuItems($modTSconfig, $itemArray, $TSref) { /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */ return t3lib_BEfunc::unsetMenuItems($modTSconfig, $itemArray, $TSref); }
/** * Adds items to the ->MOD_MENU array. Used for the function menu selector. * * @return void */ function menuConfig() { $this->MOD_MENU = array('function' => array('1' => $GLOBALS['LANG']->getLL('function1')), 'showEditIcons' => 0, 'expandAll' => 0, 'showOnlyEditable' => 0, 'showHiddenCategories' => 0, 'searchLevels' => array(-1 => $GLOBALS['LANG']->getLL('allPages'), 0 => $GLOBALS['LANG']->getLL('thisPage'), 1 => $GLOBALS['LANG']->getLL('oneLevel'), 2 => $GLOBALS['LANG']->getLL('twoLevels'), 3 => $GLOBALS['LANG']->getLL('threeLevels'), 4 => $GLOBALS['LANG']->getLL('fourLevels')), 'showThumbs' => 1, 'showLimit' => 0, 'language' => array(0 => $GLOBALS['LANG']->getLL('defaultLangLabel'))); $this->initLanguageMenu(); $this->MOD_MENU['function'] = $this->mergeExternalItems($this->MCONF['name'], 'function', $this->MOD_MENU['function']); $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function'); $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); }
/** * Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems()) * Then MOD_SETTINGS array is cleaned up (see t3lib_BEfunc::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted. * Also loads the modTSconfig internal variable. * * @return void * @see init(), $MOD_MENU, $MOD_SETTINGS, t3lib_BEfunc::getModuleData(), mergeExternalItems() */ function menuConfig() { // page/be_user TSconfig settings and blinding of menu-items $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); $this->MOD_MENU['function'] = $this->mergeExternalItems($this->MCONF['name'], 'function', $this->MOD_MENU['function']); $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function'); #debug($this->MOD_MENU['function'],$this->MCONF['name']); #debug($this->modTSconfig['properties']); $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); }
/** * Initialize menu array * * @return void */ function menuConfig() { global $BE_USER, $LANG, $TYPO3_CONF_VARS; // MENU-ITEMS: $this->MOD_MENU = array('tt_board' => array(0 => $LANG->getLL('m_tt_board_0'), 'expand' => $LANG->getLL('m_tt_board_expand')), 'tt_address' => array(0 => $LANG->getLL('m_tt_address_0'), 1 => $LANG->getLL('m_tt_address_1'), 2 => $LANG->getLL('m_tt_address_2')), 'tt_links' => array(0 => $LANG->getLL('m_default'), 1 => $LANG->getLL('m_tt_links_1'), 2 => $LANG->getLL('m_tt_links_2')), 'tt_calender' => array(0 => $LANG->getLL('m_default'), 'date' => $LANG->getLL('m_tt_calender_date'), 'date_ext' => $LANG->getLL('m_tt_calender_date_ext'), 'todo' => $LANG->getLL('m_tt_calender_todo'), 'todo_ext' => $LANG->getLL('m_tt_calender_todo_ext')), 'tt_products' => array(0 => $LANG->getLL('m_default'), 'ext' => $LANG->getLL('m_tt_products_ext')), 'tt_content_showHidden' => '', 'showPalettes' => '', 'showDescriptions' => '', 'disableRTE' => '', 'function' => array(0 => $LANG->getLL('m_function_0'), 1 => $LANG->getLL('m_function_1'), 2 => $LANG->getLL('m_function_2'), 3 => $LANG->getLL('pageInformation')), 'language' => array(0 => $LANG->getLL('m_default'))); // example settings: // $TYPO3_CONF_VARS['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] = // array ('default' => array( // 'MENU' => 'LLL:EXT:tx_myext/locallang_db.xml:menuDefault', // 'fList' => 'title,description,image', // 'icon' => TRUE), if (is_array($this->externalTables)) { foreach ($this->externalTables as $table => $tableSettings) { // delete the default settings from above if (is_array($this->MOD_MENU[$table])) { unset($this->MOD_MENU[$table]); } if (is_array($tableSettings) && count($tableSettings) > 1) { foreach ($tableSettings as $key => $settings) { $this->MOD_MENU[$table][$key] = $LANG->sL($settings['MENU']); } } } } // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page. Add these to language selector. $res = $this->exec_languageQuery($this->id); while ($lrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if ($GLOBALS['BE_USER']->checkLanguageAccess($lrow['uid'])) { $this->MOD_MENU['language'][$lrow['uid']] = $lrow['hidden'] ? '(' . $lrow['title'] . ')' : $lrow['title']; } } // Find if there are ANY languages at all (and if not, remove the language option from function menu). $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'sys_language', $BE_USER->isAdmin() ? '' : 'hidden=0'); if (!$count) { unset($this->MOD_MENU['function']['2']); } // page/be_user TSconfig settings and blinding of menu-items $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED'); $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']); if ($this->modTSconfig['properties']['QEisDefault']) { ksort($this->MOD_MENU['function']); } $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function'); // Remove QuickEdit as option if page type is not... if (!t3lib_div::inList($TYPO3_CONF_VARS['FE']['content_doktypes'] . ',6', $this->pageinfo['doktype'])) { unset($this->MOD_MENU['function'][0]); } // Setting alternative default label: if (($this->modSharedTSconfig['properties']['defaultLanguageLabel'] || $this->modTSconfig['properties']['defaultLanguageLabel']) && isset($this->MOD_MENU['language'][0])) { $this->MOD_MENU['language'][0] = $this->modTSconfig['properties']['defaultLanguageLabel'] ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $this->modSharedTSconfig['properties']['defaultLanguageLabel']; } // Clean up settings $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); // For all elements to be shown in draft workspaces & to also show hidden elements by default if user hasn't disabled the option if ($GLOBALS['BE_USER']->workspace != 0 || $this->MOD_SETTINGS['tt_content_showHidden'] !== '0') { $this->MOD_SETTINGS['tt_content_showHidden'] = 1; } }