예제 #1
0
 /**
  * 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
0
	/**
	 * 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, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']);
		// Draw the header
		$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
		$this->doc->backPath = $GLOBALS['BACK_PATH'];
		$this->doc->form = '<form action="" method="post">';
		// DBAL page title:
		$this->content .= $this->doc->startPage($languageService->getLL('title'));
		$this->content .= $this->doc->header($languageService->getLL('title'));
		$this->content .= $this->doc->spacer(5);
		$this->content .= $this->doc->section('', $this->doc->funcMenu('', BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
		// Debug log:
		switch ($this->MOD_SETTINGS['function']) {
			case 'info':
				$this->content .= $this->doc->section($languageService->getLL('Cached_info'), $this->printCachedInfo());
				break;
			case 'sqlcheck':
				$this->content .= $this->doc->section($languageService->getLL('SQL_check'), $this->printSqlCheck());
				break;
			case 0:
				$this->content .= $this->doc->section($languageService->getLL('Debug_log'), $this->printLogMgm());
				break;
		}
		// ShortCut
		if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
			$this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
		}
		$this->content .= $this->doc->spacer(10);
	}
예제 #3
0
 /**
  * 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);
 }
예제 #4
0
 /**
  * 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']);
 }
 /**
  * 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;
 }
예제 #6
0
 /**
  * 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();
 }
예제 #7
0
 /**
  * Initialize menu configuration
  *
  * @return void
  */
 public function menuConfig()
 {
     // CLEANSE SETTINGS
     $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName, 'ses');
 }
예제 #8
0
 /**
  * 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;
 }
예제 #9
0
 /**
  * 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');
 }
예제 #10
0
 /**
  * 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>&nbsp;&nbsp;&nbsp;' . '<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;
 }
 /**
  * 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');
 }
 /**
  * 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']);
 }
 /**
  * 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');
     }
 }
 /**
  * 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']);
 }
예제 #15
0
 /**
  * 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();
     }
     return $dblist;
 }
예제 #16
0
 /**
  * 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();
 }
예제 #17
0
 /**
  * Initialize function menu array
  *
  * @return void
  * @todo Define visibility
  */
 public function menuConfig()
 {
     // MENU-ITEMS:
     $this->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');
     // Loading module configuration:
     $this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']);
     // Clean up settings:
     $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name']);
 }
 /**
  * Process saving request like in class.tstemplateinfo.php (TCE processing)
  *
  * @return bool TRUE if successful
  */
 public function save($parameters, $pObj)
 {
     $savingsuccess = false;
     if ($parameters['type'] == $this->ajaxSaveType) {
         $pageId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pageId');
         if (!is_numeric($pageId) || $pageId < 1) {
             return false;
         }
         // If given use the requested template_uid
         // if not, use the first template-record on the page (in this case there should only be one record!)
         $set = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET');
         $template_uid = $set['templatesOnPage'] ?: 0;
         // Defined global here!
         $tmpl = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
         // Do not log time-performance information
         $tmpl->tt_track = 0;
         $tmpl->init();
         // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
         $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
         $existTemplate = is_array($tplRow);
         if ($existTemplate) {
             $saveId = $tplRow['_ORIG_uid'] ?: $tplRow['uid'];
             // Update template ?
             $POST = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
             if ($POST['submit']) {
                 // Set the data to be saved
                 $recData = array();
                 if (is_array($POST['data'])) {
                     foreach ($POST['data'] as $field => $val) {
                         switch ($field) {
                             case 'constants':
                             case 'config':
                                 // Replace Windows- and Mac linebreaks
                                 $val = str_replace([CRLF, CR], LF, $val);
                                 $recData['sys_template'][$saveId][$field] = $val;
                                 break;
                         }
                     }
                 }
                 if (!empty($recData)) {
                     // process template row before saving
                     $tstemplateinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController::class);
                     /* @var $tstemplateinfo \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController */
                     // load the MOD_SETTINGS in order to check if the includeTypoScriptFileContent is set
                     $tstemplateinfo->pObj = $pObj;
                     $tstemplateinfo->pObj->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData(array('includeTypoScriptFileContent' => true), array(), 'web_ts');
                     $recData['sys_template'][$saveId] = $tstemplateinfo->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]);
                     // Create new tce-object
                     $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
                     $tce->stripslashes_values = 0;
                     // Initialize
                     $tce->start($recData, array());
                     // Saved the stuff
                     $tce->process_datamap();
                     // Clear the cache (note: currently only admin-users can clear the
                     // cache in tce_main.php)
                     $tce->clear_cacheCmd('all');
                     $savingsuccess = true;
                 }
             }
         }
     }
     return $savingsuccess;
 }
예제 #19
0
 /**
  * Creates an instance of the class found in $this->extClassConf['name'] in $this->extObj if any (this should hold three keys, "name", "path" and "title" if a "Function menu module" tries to connect...)
  * This value in extClassConf might be set by an extension (in an ext_tables/ext_localconf file) which thus "connects" to a module.
  * The array $this->extClassConf is set in handleExternalFunctionValue() based on the value of MOD_SETTINGS[function]
  * If an instance is created it is initiated with $this passed as value and $this->extClassConf as second argument. Further the $this->MOD_SETTING is cleaned up again after calling the init function.
  *
  * @return void
  * @see handleExternalFunctionValue(), \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(), $extObj
  */
 public function checkExtObj()
 {
     if (is_array($this->extClassConf) && $this->extClassConf['name']) {
         $this->extObj = GeneralUtility::makeInstance($this->extClassConf['name']);
         $this->extObj->init($this, $this->extClassConf);
         // Re-write:
         $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
     }
 }
예제 #20
0
 /**
  * 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'];
         }
     }
     // Find if there are ANY languages at all (and if not, remove the language option from function menu).
     $count = $this->getDatabaseConnection()->exec_SELECTcountRows('uid', 'sys_language', $this->getBackendUser()->isAdmin() ? '' : 'hidden=0');
     if (!$count) {
         unset($this->MOD_MENU['function']['2']);
     }
     // page/be_user TSconfig settings and blinding of menu-items
     $this->modSharedTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
     $this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']);
     if ($this->modTSconfig['properties']['QEisDefault']) {
         ksort($this->MOD_MENU['function']);
     }
     $this->MOD_MENU['function'] = BackendUtility::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function');
     // Remove QuickEdit as option if page type is not...
     if (!GeneralUtility::inList($GLOBALS['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 = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), 'web_layout');
     // 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;
     }
 }
 /**
  * @todo Define visibility
  */
 public function templateMenu()
 {
     // Defined global here!
     $tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
     /** @var $tmpl \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService */
     // Do not log time-performance information
     $tmpl->tt_track = FALSE;
     $tmpl->init();
     $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
     $menu = '';
     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);
     $menu = BackendUtility::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
     return $menu;
 }
예제 #22
0
 /**
  * Configure menu
  *
  * @return void
  */
 public function menuConfig()
 {
     $lang = $this->getLanguageService();
     // 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 = ['function' => [0 => htmlspecialchars($lang->getLL('menuTitle')), 'records' => htmlspecialchars($lang->getLL('recordStatistics')), 'relations' => htmlspecialchars($lang->getLL('databaseRelations')), 'search' => htmlspecialchars($lang->getLL('fullSearch')), 'refindex' => htmlspecialchars($lang->getLL('manageRefIndex'))], 'search' => ['raw' => htmlspecialchars($lang->getLL('rawSearch')), 'query' => htmlspecialchars($lang->getLL('advancedQuery'))], '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' => ['all' => htmlspecialchars($lang->getLL('selectRecords')), 'count' => htmlspecialchars($lang->getLL('countResults')), 'explain' => htmlspecialchars($lang->getLL('explainQuery')), 'csv' => htmlspecialchars($lang->getLL('csvExport'))], 'sword' => ''];
     // CLEAN SETTINGS
     $OLD_MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, '', $this->moduleName, 'ses');
     $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName, 'ses');
     if (GeneralUtility::_GP('queryConfig')) {
         $qA = GeneralUtility::_GP('queryConfig');
         $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, ['queryConfig' => serialize($qA)], $this->moduleName, 'ses');
     }
     $addConditionCheck = GeneralUtility::_GP('qG_ins');
     $setLimitToStart = false;
     foreach ($OLD_MOD_SETTINGS as $key => $val) {
         if (substr($key, 0, 5) == 'query' && $this->MOD_SETTINGS[$key] != $val && $key != 'queryLimit' && $key != 'use_listview') {
             $setLimitToStart = true;
             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 = BackendUtility::getModuleData($this->MOD_MENU, $this->MOD_SETTINGS, $this->moduleName, 'ses');
     }
 }
예제 #23
0
 /**
  * Write the current storage array and update MOD_SETTINGS
  *
  * @param array $writeArray Array of settings which should be overwrite current MOD_SETTINGS
  * @param string $mconfName Name of the module to store the settings for. Default: $this->getModule()->MCONF['name'] (current module)
  * @return void
  */
 public function writeStoredSetting($writeArray = array(), $mconfName = '')
 {
     // Making sure, index 0 is not set
     unset($this->storedSettings[0]);
     $this->storedSettings = $this->cleanupStorageArray($this->storedSettings);
     $writeArray[$this->prefix . '_storedSettings'] = serialize($this->storedSettings);
     $this->getModule()->MOD_SETTINGS = Utility\BackendUtility::getModuleData($this->getModule()->MOD_MENU, $writeArray, $mconfName ?: $this->getModule()->MCONF['name'], $this->type);
     if ($this->writeDevLog) {
         GeneralUtility::devLog('Settings stored:' . $this->msg, __CLASS__, 0);
     }
 }
예제 #24
0
 /**
  * Write the current storage array and update MOD_SETTINGS
  *
  * @param array $writeArray Array of settings which should be overwrite current MOD_SETTINGS
  * @param string $mconfName Name of the module to store the settings for. Default: $GLOBALS['SOBE']->MCONF['name'] (current module)
  * @return void
  * @todo Define visibility
  */
 public function writeStoredSetting($writeArray = array(), $mconfName = '')
 {
     // Making sure, index 0 is not set
     unset($this->storedSettings[0]);
     $this->storedSettings = $this->cleanupStorageArray($this->storedSettings);
     $writeArray[$this->prefix . '_storedSettings'] = serialize($this->storedSettings);
     $GLOBALS['SOBE']->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($GLOBALS['SOBE']->MOD_MENU, $writeArray, $mconfName ? $mconfName : $GLOBALS['SOBE']->MCONF['name'], $this->type);
     if ($this->writeDevLog) {
         GeneralUtility::devLog('Settings stored:' . $this->msg, 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
     }
 }
예제 #25
0
 /**
  * Get the HTML data required for a bulk selection of files of the TYPO3 Element Browser.
  *
  * @param integer $filesCount Number of files currently displayed
  * @return string HTML data required for a bulk selection of files - if $filesCount is 0, nothing is returned
  * @todo Define visibility
  */
 public function getBulkSelector($filesCount)
 {
     if (!$filesCount) {
         return '';
     }
     $labelToggleSelection = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_browse_links.xlf:toggleSelection', TRUE);
     $labelImportSelection = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_browse_links.xlf:importSelection', TRUE);
     // Getting flag for showing/not showing thumbnails:
     $noThumbsInEB = $GLOBALS['BE_USER']->getTSConfigVal('options.noThumbsInEB');
     $out = $this->doc->spacer(10) . '<div>' . '<a href="#" onclick="BrowseLinks.Selector.handle()">' . '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/import.gif', 'width="12" height="12"') . ' title="' . $labelImportSelection . '" alt="" /> ' . $labelImportSelection . '</a>&nbsp;&nbsp;&nbsp;' . '<a href="#" onclick="BrowseLinks.Selector.toggle()">' . '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/clip_select.gif', 'width="12" height="12"') . ' title="' . $labelToggleSelection . '" alt="" /> ' . $labelToggleSelection . '</a>' . '</div>';
     $thumbNailCheck = '';
     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">' . $GLOBALS['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;
 }
 /**
  * Same as \TYPO3\CMS\Backend\Module\BaseScriptClass::checkExtObj()
  *
  * @return void
  * @see \TYPO3\CMS\Backend\Module\BaseScriptClass::checkExtObj()
  */
 public function checkExtObj()
 {
     if (is_array($this->extClassConf) && $this->extClassConf['name']) {
         $this->extObj = GeneralUtility::makeInstance($this->extClassConf['name']);
         $this->extObj->init($this->pObj, $this->extClassConf);
         // Re-write:
         $this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), $this->pObj->MCONF['name']);
     }
 }
예제 #27
0
 /**
  * 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
  */
 protected function getBulkSelector($filesCount)
 {
     if (!$filesCount) {
         return '';
     }
     $lang = $this->getLanguageService();
     $out = '';
     // Getting flag for showing/not showing thumbnails:
     $noThumbsInEB = $this->getBackendUser()->getTSConfigVal('options.noThumbsInEB');
     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 = GeneralUtility::implodeArrayForUrl('', $this->getUrlParameters(['identifier' => $this->selectedFolder->getCombinedIdentifier()]));
         $thumbNailCheck = '<div class="checkbox" style="padding:5px 0 15px 0"><label for="checkDisplayThumbs">' . BackendUtility::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], $this->thisScript, $addParams, 'id="checkDisplayThumbs"') . $lang->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:displayThumbs', true) . '</label></div>';
         $out .= $thumbNailCheck;
     } else {
         $out .= '<div style="padding-top: 15px;"></div>';
     }
     return $out;
 }
 /**
  * Stores information about the last action of the module.
  */
 protected function storeLastModuleInformation()
 {
     // Probably should store also arguments (except pager?)
     $foo = BackendUtility::getModuleData(array('controller' => '', 'action' => ''), array('controller' => $this->getControllerName(), 'action' => $this->getActionName()), $this->argumentsKey);
 }
예제 #29
0
 /**
  * Render template menu
  *
  * @return string
  */
 public function templateMenu()
 {
     $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
     $this->templateService->init();
     $all = $this->templateService->ext_getAllTemplates($this->id);
     if (count($all) > 1) {
         $this->MOD_MENU['templatesOnPage'] = [];
         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']);
 }
예제 #30
0
 /**
  * Setting the menu/session variables
  *
  * @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 will be saved.
     // Values NOT in this array will not be saved in the settings-array for the module.
     $this->MOD_MENU = ['sort' => '', 'reverse' => '', 'displayThumbs' => '', 'clipBoard' => '', 'bigControlPanel' => ''];
     // CLEANSE SETTINGS
     $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName);
 }