本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::getModuleData方法的具体用法?PHP BackendUtility::getModuleData怎么用?PHP BackendUtility::getModuleData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::getModuleData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function of the module. Write the content to $this->content
*
* @return void
*/
public function main()
{
$languageService = $this->getLanguageService();
$this->thisScript = BackendUtility::getModuleUrl($this->MCONF['name']);
// Clean up settings:
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name']);
// Draw the header
// DBAL page title:
$this->content .= '<h1>' . $languageService->getLL('title') . '</h1>';
$this->generateMenu();
// Debug log:
switch ($this->MOD_SETTINGS['function']) {
case 'info':
$this->content .= $this->moduleTemplate->section($languageService->getLL('Cached_info'), $this->printCachedInfo());
break;
case 'sqlcheck':
$this->content .= $this->moduleTemplate->section($languageService->getLL('SQL_check'), $this->printSqlCheck());
break;
case 0:
$this->content .= $this->moduleTemplate->section($languageService->getLL('Debug_log'), $this->printLogMgm());
break;
}
// ShortCut
$shortcutButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeShortcutButton()->setModuleName($this->MCONF['name'])->setGetVariables(['id']);
$this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortcutButton);
}
示例2: menuConfig
/**
* Menu Configuration
*
* @return void
*/
public function menuConfig()
{
// MENU-ITEMS:
// If array, then it's a selector box menu
// If empty string it's just a variable, that'll be saved.
// Values NOT in this array will not be saved in the settings-array for the module.
$this->MOD_MENU = array('function' => array(0 => LocalizationUtility::translate('typo3ConfVars', 'lowlevel'), 1 => LocalizationUtility::translate('tca', 'lowlevel'), 2 => LocalizationUtility::translate('tcaDescr', 'lowlevel'), 3 => LocalizationUtility::translate('loadedExt', 'lowlevel'), 4 => LocalizationUtility::translate('t3services', 'lowlevel'), 5 => LocalizationUtility::translate('tbemodules', 'lowlevel'), 6 => LocalizationUtility::translate('tbemodulesext', 'lowlevel'), 7 => LocalizationUtility::translate('tbeStyles', 'lowlevel'), 8 => LocalizationUtility::translate('beUser', 'lowlevel'), 9 => LocalizationUtility::translate('usersettings', 'lowlevel')), 'regexsearch' => '', 'fixedLgd' => '');
// CLEANSE SETTINGS
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName);
}
示例3: menuConfig
/**
* Menu Configuration
*
* @return void
* @todo Define visibility
*/
public function menuConfig()
{
global $TYPO3_CONF_VARS;
// MENU-ITEMS:
// If array, then it's a selector box menu
// If empty string it's just a variable, that'll be saved.
// Values NOT in this array will not be saved in the settings-array for the module.
$this->MOD_MENU = array('function' => array(0 => $GLOBALS['LANG']->getLL('typo3ConfVars', TRUE), 1 => $GLOBALS['LANG']->getLL('tca', TRUE), 2 => $GLOBALS['LANG']->getLL('tcaDescr', TRUE), 3 => $GLOBALS['LANG']->getLL('loadedExt', TRUE), 4 => $GLOBALS['LANG']->getLL('t3services', TRUE), 5 => $GLOBALS['LANG']->getLL('tbemodules', TRUE), 6 => $GLOBALS['LANG']->getLL('tbemodulesext', TRUE), 7 => $GLOBALS['LANG']->getLL('tbeStyles', TRUE), 8 => $GLOBALS['LANG']->getLL('beUser', TRUE), 9 => $GLOBALS['LANG']->getLL('usersettings', TRUE)), 'regexsearch' => '', 'fixedLgd' => '');
// CLEANSE SETTINGS
$this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']);
}
示例4: main
/**
* Main
*
* @return string
*/
public function main()
{
$lang = $this->getLanguageService();
$lang->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang_ceditor.xlf');
$theOutput = '';
// Create extension template
$this->pObj->createTemplate($this->pObj->id);
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// initialize
$existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
if ($existTemplate) {
$templateService = $this->getExtendedTemplateService();
$tplRow = $this->getTemplateRow();
$theConstants = $this->getConstants();
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Tstemplate/ConstantEditor');
$saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
// Update template ?
if (GeneralUtility::_POST('_savedok')) {
$templateService->changed = 0;
$templateService->ext_procesInput(GeneralUtility::_POST(), array(), $theConstants, $tplRow);
if ($templateService->changed) {
// Set the data to be saved
$recData = array();
$recData['sys_template'][$saveId]['constants'] = implode($templateService->raw, LF);
// Create new tce-object
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = false;
$tce->start($recData, array());
$tce->process_datamap();
// Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
$tce->clear_cacheCmd('all');
// re-read the template ...
$this->initialize_editor($this->pObj->id, $template_uid);
// re-read the constants as they have changed
$templateService = $this->getExtendedTemplateService();
$tplRow = $this->getTemplateRow();
$theConstants = $this->getConstants();
}
}
// Resetting the menu (start). I wonder if this in any way is a violation of the menu-system. Haven't checked. But need to do it here, because the menu is dependent on the categories available.
$this->pObj->MOD_MENU['constant_editor_cat'] = $templateService->ext_getCategoryLabelArray();
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), $this->pObj->MCONF['name']);
// Resetting the menu (stop)
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$content = $iconFactory->getIconForRecord('sys_template', $tplRow, Icon::SIZE_SMALL)->render() . '<strong>' . $this->pObj->linkWrapTemplateTitle($tplRow['title'], 'constants') . '</strong>' . (trim($tplRow['sitetitle']) ? htmlspecialchars(' (' . $tplRow['sitetitle'] . ')') : '');
$theOutput .= $this->pObj->doc->section($lang->getLL('editConstants', true), $content, false, true);
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu);
}
$theOutput .= '<div style="padding-top: 10px;"></div>';
if (!empty($this->pObj->MOD_MENU['constant_editor_cat'])) {
$menu = '<div class="form-inline form-inline-spaced">';
$menu .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[constant_editor_cat]', $this->pObj->MOD_SETTINGS['constant_editor_cat'], $this->pObj->MOD_MENU['constant_editor_cat']);
$menu .= '</div>';
$theOutput .= $this->pObj->doc->section($lang->getLL('category', true), '<span class="text-nowrap">' . $menu . '</span>', false);
} else {
$theOutput .= $this->pObj->doc->section($lang->getLL('noConstants', true), $lang->getLL('noConstantsDescription', true), false, false, 1);
}
$theOutput .= '<div style="padding-top: 15px;"></div>';
// Category and constant editor config:
$category = $this->pObj->MOD_SETTINGS['constant_editor_cat'];
$templateService->ext_getTSCE_config($category);
$printFields = trim($templateService->ext_printFields($theConstants, $category));
if ($printFields) {
$theOutput .= $this->pObj->doc->section('', $printFields);
}
$BE_USER_modOptions = BackendUtility::getModTSconfig(0, 'mod.' . $this->pObj->MCONF['name']);
if ($BE_USER_modOptions['properties']['constantEditor.']['example'] != 'top') {
$theOutput = $this->displayExample($theOutput);
}
} else {
$theOutput .= $this->pObj->noTemplate(1);
}
return $theOutput;
}
开发者ID:Audibene-GMBH,项目名称:TYPO3.CMS,代码行数:85,代码来源:TypoScriptTemplateConstantEditorModuleFunctionController.php
示例5: processAjaxRequestConstruct
/**
* Construct runtime environment for Inline Relational Record Editing.
* - creates an anoymous SC_alt_doc in $GLOBALS['SOBE']
* - creates a \TYPO3\CMS\Backend\Form\FormEngine in $GLOBALS['SOBE']->tceforms
* - sets ourself as reference to $GLOBALS['SOBE']->tceforms->inline
* - sets $GLOBALS['SOBE']->tceforms->RTEcounter to the current situation on client-side
*
* @param array &$ajaxArguments The arguments to be processed by the AJAX request
* @return void
*/
protected function processAjaxRequestConstruct(&$ajaxArguments)
{
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_doc.xlf');
// Create a new anonymous object:
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->MOD_MENU = array('showPalettes' => '', 'showDescriptions' => '', 'disableRTE' => '');
// Setting virtual document name
$GLOBALS['SOBE']->MCONF['name'] = 'xMOD_alt_doc.php';
// CLEANSE SETTINGS
$GLOBALS['SOBE']->MOD_SETTINGS = BackendUtility::getModuleData($GLOBALS['SOBE']->MOD_MENU, GeneralUtility::_GP('SET'), $GLOBALS['SOBE']->MCONF['name']);
// Create an instance of the document template object
$GLOBALS['SOBE']->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$GLOBALS['SOBE']->doc->backPath = $GLOBALS['BACK_PATH'];
// Initialize TCEforms (rendering the forms)
$GLOBALS['SOBE']->tceforms = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormEngine');
$GLOBALS['SOBE']->tceforms->inline = $this;
$GLOBALS['SOBE']->tceforms->RTEcounter = (int) array_shift($ajaxArguments);
$GLOBALS['SOBE']->tceforms->initDefaultBEMode();
$GLOBALS['SOBE']->tceforms->palettesCollapsed = !$GLOBALS['SOBE']->MOD_SETTINGS['showPalettes'];
$GLOBALS['SOBE']->tceforms->disableRTE = $GLOBALS['SOBE']->MOD_SETTINGS['disableRTE'];
$GLOBALS['SOBE']->tceforms->enableClickMenu = TRUE;
$GLOBALS['SOBE']->tceforms->enableTabMenu = TRUE;
// Clipboard is initialized:
// Start clipboard
$GLOBALS['SOBE']->tceforms->clipObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Clipboard\\Clipboard');
// Initialize - reads the clipboard content from the user session
$GLOBALS['SOBE']->tceforms->clipObj->initializeClipboard();
}
示例6: menuConfig
/**
* Initialize menu configuration
*
* @return void
*/
public function menuConfig()
{
// CLEANSE SETTINGS
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName, 'ses');
}
示例7: procesStoreControl
/**
* Process store control
*
* @return string
*/
public function procesStoreControl()
{
$storeArray = $this->initStoreArray();
$storeQueryConfigs = unserialize($GLOBALS['SOBE']->MOD_SETTINGS['storeQueryConfigs']);
$storeControl = GeneralUtility::_GP('storeControl');
$storeIndex = (int) $storeControl['STORE'];
$saveStoreArray = 0;
$writeArray = array();
if (is_array($storeControl)) {
$msg = '';
if ($storeControl['LOAD']) {
if ($storeIndex > 0) {
$writeArray = $this->loadStoreQueryConfigs($storeQueryConfigs, $storeIndex, $writeArray);
$saveStoreArray = 1;
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($GLOBALS['LANG']->getLL('query_loaded'), htmlspecialchars($storeArray[$storeIndex])));
} elseif ($storeIndex < 0 && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('sys_action')) {
$actionRecord = BackendUtility::getRecord('sys_action', abs($storeIndex));
if (is_array($actionRecord)) {
$dA = unserialize($actionRecord['t2_data']);
$dbSC = array();
if (is_array($dA['qC'])) {
$dbSC[0] = $dA['qC'];
}
$writeArray = $this->loadStoreQueryConfigs($dbSC, '0', $writeArray);
$saveStoreArray = 1;
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($GLOBALS['LANG']->getLL('query_from_action_loaded'), htmlspecialchars($actionRecord['title'])));
}
}
} elseif ($storeControl['SAVE']) {
if ($storeIndex < 0) {
$qOK = $this->saveQueryInAction(abs($storeIndex));
if ($qOK) {
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $GLOBALS['LANG']->getLL('query_saved'));
} else {
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $GLOBALS['LANG']->getLL('query_notsaved'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
}
} else {
if (trim($storeControl['title'])) {
if ($storeIndex > 0) {
$storeArray[$storeIndex] = $storeControl['title'];
} else {
$storeArray[] = $storeControl['title'];
end($storeArray);
$storeIndex = key($storeArray);
}
$storeQueryConfigs = $this->addToStoreQueryConfigs($storeQueryConfigs, $storeIndex);
$saveStoreArray = 1;
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $GLOBALS['LANG']->getLL('query_saved'));
}
}
} elseif ($storeControl['REMOVE']) {
if ($storeIndex > 0) {
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($GLOBALS['LANG']->getLL('query_removed'), htmlspecialchars($storeArray[$storeControl['STORE']])));
// Removing
unset($storeArray[$storeControl['STORE']]);
$saveStoreArray = 1;
}
}
if ($flashMessage) {
$msg = $flashMessage->render();
}
}
if ($saveStoreArray) {
// Making sure, index 0 is not set!
unset($storeArray[0]);
$writeArray['storeArray'] = serialize($storeArray);
$writeArray['storeQueryConfigs'] = serialize($this->cleanStoreQueryConfigs($storeQueryConfigs, $storeArray));
$GLOBALS['SOBE']->MOD_SETTINGS = BackendUtility::getModuleData($GLOBALS['SOBE']->MOD_MENU, $writeArray, $GLOBALS['SOBE']->MCONF['name'], 'ses');
}
return $msg;
}
示例8: menuConfig
/**
* MENU-ITEMS:
* If array, then it's a selector box menu
* If empty string it's just a variable, that'll be saved.
* Values NOT in this array will not be saved in the settings-array for the module.
*
* @return void
* @todo Define visibility
*/
public function menuConfig()
{
$this->MOD_MENU = array('function' => array('stat' => 'General statistics', 'typo3pages' => 'List: TYPO3 Pages', 'externalDocs' => 'List: External documents'));
// cleanse settings
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name'], 'ses');
}
示例9: getBulkSelector
/**
* Get the HTML data required for a bulk selection of files of the TYPO3 Element Browser.
*
* @param int $filesCount Number of files currently displayed
* @return string HTML data required for a bulk selection of files - if $filesCount is 0, nothing is returned
*/
public function getBulkSelector($filesCount)
{
if (!$filesCount) {
return '';
}
$lang = $this->getLanguageService();
$labelToggleSelection = $lang->sL('LLL:EXT:lang/locallang_browse_links.xlf:toggleSelection', TRUE);
$labelImportSelection = $lang->sL('LLL:EXT:lang/locallang_browse_links.xlf:importSelection', TRUE);
// Getting flag for showing/not showing thumbnails:
$noThumbsInEB = $this->getBackendUserAuthentication()->getTSConfigVal('options.noThumbsInEB');
$out = $this->doc->spacer(10) . '<div>' . '<a href="#" onclick="BrowseLinks.Selector.handle()">' . IconUtility::getSpriteIcon('actions-document-import-t3d', array('title' => $labelImportSelection)) . $labelImportSelection . '</a> ' . '<a href="#" onclick="BrowseLinks.Selector.toggle()">' . IconUtility::getSpriteIcon('actions-document-select', array('title' => $labelToggleSelection)) . $labelToggleSelection . '</a>' . '</div>';
if (!$noThumbsInEB && $this->selectedFolder) {
// MENU-ITEMS, fetching the setting for thumbnails from File>List module:
$_MOD_MENU = array('displayThumbs' => '');
$_MCONF['name'] = 'file_list';
$_MOD_SETTINGS = BackendUtility::getModuleData($_MOD_MENU, GeneralUtility::_GP('SET'), $_MCONF['name']);
$addParams = '&act=' . $this->act . '&mode=' . $this->mode . '&expandFolder=' . rawurlencode($this->selectedFolder->getCombinedIdentifier()) . '&bparams=' . rawurlencode($this->bparams);
$thumbNailCheck = BackendUtility::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], GeneralUtility::_GP('M') ? '' : $this->thisScript, $addParams, 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $lang->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:displayThumbs', TRUE) . '</label>';
$out .= $this->doc->spacer(5) . $thumbNailCheck . $this->doc->spacer(15);
} else {
$out .= $this->doc->spacer(15);
}
return $out;
}
示例10: storeLastModuleInformation
/**
* Stores information about the last action of the module.
*/
protected function storeLastModuleInformation()
{
// Probably should store also arguments (except pager?)
BackendUtility::getModuleData(array('controller' => ''), array('controller' => $this->getControllerName()), 'tx_realurl_web_realurlrealurl');
}
示例11: menuConfig
/**
* Configuration of the menu and initialization of ->MOD_SETTINGS
*
* @return void
*/
public function menuConfig()
{
// MENU-ITEMS:
// If array, then it's a selector box menu
// If empty string it's just a variable, that'll be saved.
// Values NOT in this array will not be saved in the settings-array for the module.
$temp = $GLOBALS['LANG']->getLL('levels');
$this->MOD_MENU = array('depth' => array(1 => '1 ' . $temp, 2 => '2 ' . $temp, 3 => '3 ' . $temp, 4 => '4 ' . $temp, 10 => '10 ' . $temp), 'mode' => array(0 => $GLOBALS['LANG']->getLL('user_overview'), 'perms' => $GLOBALS['LANG']->getLL('permissions')));
// Clean up settings:
$this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']);
}
示例12: menuConfig
/**
* Configure menu
*
* @return void
* @todo Define visibility
*/
public function menuConfig()
{
global $LANG;
// MENU-ITEMS:
// If array, then it's a selector box menu
// If empty string it's just a variable, that'll be saved.
// Values NOT in this array will not be saved in the settings-array for the module.
$this->MOD_MENU = array('function' => array(0 => $GLOBALS['LANG']->getLL('menu', TRUE), 'records' => $GLOBALS['LANG']->getLL('recordStatistics', TRUE), 'relations' => $GLOBALS['LANG']->getLL('databaseRelations', TRUE), 'search' => $GLOBALS['LANG']->getLL('fullSearch', TRUE), 'filesearch' => $GLOBALS['LANG']->getLL('findFilename', TRUE), 'refindex' => $GLOBALS['LANG']->getLL('manageRefIndex', TRUE)), 'search' => array('raw' => $GLOBALS['LANG']->getLL('rawSearch', TRUE), 'query' => $GLOBALS['LANG']->getLL('advancedQuery', TRUE)), 'search_query_smallparts' => '', 'search_result_labels' => '', 'labels_noprefix' => '', 'options_sortlabel' => '', 'show_deleted' => '', 'queryConfig' => '', 'queryTable' => '', 'queryFields' => '', 'queryLimit' => '', 'queryOrder' => '', 'queryOrderDesc' => '', 'queryOrder2' => '', 'queryOrder2Desc' => '', 'queryGroup' => '', 'storeArray' => '', 'storeQueryConfigs' => '', 'search_query_makeQuery' => array('all' => $GLOBALS['LANG']->getLL('selectRecords', TRUE), 'count' => $GLOBALS['LANG']->getLL('countResults', TRUE), 'explain' => $GLOBALS['LANG']->getLL('explainQuery', TRUE), 'csv' => $GLOBALS['LANG']->getLL('csvExport', TRUE)), 'sword' => '');
// CLEAN SETTINGS
$OLD_MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, '', $this->MCONF['name'], 'ses');
$this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name'], 'ses');
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('queryConfig')) {
$qA = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('queryConfig');
$this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, array('queryConfig' => serialize($qA)), $this->MCONF['name'], 'ses');
}
$addConditionCheck = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qG_ins');
foreach ($OLD_MOD_SETTINGS as $key => $val) {
if (substr($key, 0, 5) == 'query' && $this->MOD_SETTINGS[$key] != $val && $key != 'queryLimit' && $key != 'use_listview') {
$setLimitToStart = 1;
if ($key == 'queryTable' && !$addConditionCheck) {
$this->MOD_SETTINGS['queryConfig'] = '';
}
}
if ($key == 'queryTable' && $this->MOD_SETTINGS[$key] != $val) {
$this->MOD_SETTINGS['queryFields'] = '';
}
}
if ($setLimitToStart) {
$currentLimit = explode(',', $this->MOD_SETTINGS['queryLimit']);
if ($currentLimit[1]) {
$this->MOD_SETTINGS['queryLimit'] = '0,' . $currentLimit[1];
} else {
$this->MOD_SETTINGS['queryLimit'] = '0';
}
$this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, $this->MOD_SETTINGS, $this->MCONF['name'], 'ses');
}
}
示例13: templateMenu
/**
* Render template menu
*
* @return string
*/
public function templateMenu()
{
/** @var ExtendedTemplateService $tmpl */
$tmpl = GeneralUtility::makeInstance(ExtendedTemplateService::class);
$GLOBALS['tmpl'] = $tmpl;
// Do not log time-performance information
$tmpl->tt_track = false;
$tmpl->init();
$all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
if (count($all) > 1) {
$this->MOD_MENU['templatesOnPage'] = array();
foreach ($all as $d) {
$this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
}
}
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
return BackendUtility::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
}
示例14: getRecordList
/**
* initialize and return localRecordList
*
* @param string $table
* @param int $uid
* @param array $row
*
* @return DatabaseRecordList
*/
private function getRecordList($table, $uid, $row)
{
$dblist = NULL;
$permsClause = $GLOBALS['BE_USER']->getPagePermsClause(1);
// todo
// GPvars:
// $this->pointer = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pointer');
// $this->imagemode = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('imagemode');
// $this->search_field = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('search_field');
// $this->search_levels = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('search_levels');
// $this->showLimit = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('showLimit');
// $this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
// $this->clear_cache = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('clear_cache');
// $this->cmd = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd');
// $this->cmd_table = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd_table');
$cmd_table = GeneralUtility::_GP('cmd_table');
// Loading current page record and checking access:
$pageinfo = BackendUtility::readPageAccess($row['pid'], $permsClause);
$access = is_array($pageinfo) ? 1 : 0;
if ($access) {
// TODO: Menu settings: Apply predefined values for hidden checkboxes
// Set predefined value for DisplayBigControlPanel:
// Set predefined value for Clipboard:
// Set predefined value for LocalizationView:
// Initialize the dblist object:
/** @var $dblist DatabaseRecordList */
$dblist = GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\RecordList\\DatabaseRecordList');
$dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
$dblist->thumbs = $GLOBALS['BE_USER']->uc['thumbnailsByDefault'];
$modName = 'web_list';
$MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');
// Loading module configuration:
$modTSconfig = BackendUtility::getModTSconfig($uid, 'mod.' . $modName);
// todo: bring GP settings from outer list to the ajax request
$MOD_SETTINGS = BackendUtility::getModuleData($MOD_MENU, GeneralUtility::_GP('SET'), $modName);
$dblist->allFields = $MOD_SETTINGS['bigControlPanel'] || $table ? 1 : 0;
$dblist->localizationView = $MOD_SETTINGS['localization'];
$dblist->showClipboard = 1;
$dblist->disableSingleTableView = $modTSconfig['properties']['disableSingleTableView'];
$dblist->listOnlyInSingleTableMode = $modTSconfig['properties']['listOnlyInSingleTableView'];
$dblist->hideTables = $modTSconfig['properties']['hideTables'];
$dblist->hideTranslations = $modTSconfig['properties']['hideTranslations'];
$dblist->tableTSconfigOverTCA = $modTSconfig['properties']['table.'];
$dblist->clickTitleMode = $modTSconfig['properties']['clickTitleMode'];
$dblist->alternateBgColors = $modTSconfig['properties']['alternateBgColors'] ? 1 : 0;
$dblist->allowedNewTables = GeneralUtility::trimExplode(',', $modTSconfig['properties']['allowedNewTables'], 1);
$dblist->deniedNewTables = GeneralUtility::trimExplode(',', $modTSconfig['properties']['deniedNewTables'], 1);
$dblist->newWizards = $modTSconfig['properties']['newWizards'] ? 1 : 0;
$dblist->pageRow = $pageinfo;
$dblist->counter++;
$dblist->MOD_MENU = $MOD_MENU;
$dblist->modTSconfig = $modTSconfig;
// Clipboard is initialized:
$dblist->clipObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Clipboard\\Clipboard');
// Start clipboard
$dblist->clipObj->initializeClipboard();
// Initialize - reads the clipboard content from the user session
// todo
// Clipboard actions are handled:
$CB = GeneralUtility::_GET('CB');
// CB is the clipboard command array
if ($this->cmd == 'setCB') {
// CBH is all the fields selected for the clipboard, CBC is the checkbox fields which were checked. By merging we get a full array of checked/unchecked elements
// This is set to the 'el' array of the CB after being parsed so only the table in question is registered.
$CB['el'] = $dblist->clipObj->cleanUpCBC(array_merge((array) GeneralUtility::_POST('CBH'), (array) GeneralUtility::_POST('CBC')), $cmd_table);
}
if (!$MOD_SETTINGS['clipBoard']) {
$CB['setP'] = 'normal';
}
// If the clipboard is NOT shown, set the pad to 'normal'.
$dblist->clipObj->setCmd($CB);
// Execute commands.
$dblist->clipObj->cleanCurrent();
// Clean up pad
$dblist->clipObj->endClipboard();
// Save the clipboard content
// This flag will prevent the clipboard panel in being shown.
// It is set, if the clickmenu-layer is active AND the extended view is not enabled.
$dblist->dontShowClipControlPanels = $GLOBALS['CLIENT']['FORMSTYLE'] && !$MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current == 'normal' && !$GLOBALS['BE_USER']->uc['disableCMlayers'] && !$modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
// If there is access to the page, then render the list contents and set up the document template object:
// todo: there is no browsing in child records
//$this->pointer = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->pointer,0,100000);
$pointer = 0;
$search_field = '';
$search_levels = '';
$showLimit = 10;
//$dblist->start($this->id,$this->table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
$dblist->start($row['pid'], $table, $pointer, $search_field, $search_levels, $showLimit);
$dblist->setDispFields();
// Render the list of tables:
$dblist->generateList();
//.........这里部分代码省略.........
示例15: menuConfig
/**
* Initialize menu array
*
* @return void
*/
public function menuConfig()
{
$lang = $this->getLanguageService();
// MENU-ITEMS:
$this->MOD_MENU = array('tt_content_showHidden' => '', 'function' => array(0 => $lang->getLL('m_function_0'), 1 => $lang->getLL('m_function_1'), 2 => $lang->getLL('m_function_2')), 'language' => array(0 => $lang->getLL('m_default')));
// example settings:
// $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
// array ('default' => array(
// 'MENU' => 'LLL:EXT:tx_myext/locallang_db.xlf: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 = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
if ($this->getBackendUser()->checkLanguageAccess($lRow['uid'])) {
$this->MOD_MENU['language'][$lRow['uid']] = $lRow['hidden'] ? '(' . $lRow['title'] . ')' : $lRow['title'];
}
}
// 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 = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName);
// For all elements to be shown in draft workspaces & to also show hidden elements by default if user hasn't disabled the option
if ($this->getBackendUser()->workspace != 0 || $this->MOD_SETTINGS['tt_content_showHidden'] !== '0') {
$this->MOD_SETTINGS['tt_content_showHidden'] = 1;
}
$this->makeActionMenu();
}