/** * @return string */ protected function renderStorageMenu() { $currentStorage = $this->getMediaModule()->getCurrentStorage(); /** @var $storage \TYPO3\CMS\Core\Resource\ResourceStorage */ $options = ''; foreach ($this->getMediaModule()->getAllowedStorages() as $storage) { $selected = ''; if ($currentStorage->getUid() == $storage->getUid()) { $selected = 'selected'; } $options .= sprintf('<option value="%s" %s>%s %s</option>', $storage->getUid(), $selected, $storage->getName(), $storage->isOnline() ? '' : '(' . LocalizationUtility::translate('offline', 'media') . ')'); } $parameters = GeneralUtility::_GET(); $inputs = ''; foreach ($parameters as $parameter => $value) { list($parameter, $value) = $this->computeParameterAndValue($parameter, $value); if ($parameter !== $this->moduleLoader->getParameterPrefix() . '[storage]') { $inputs .= sprintf('<input type="hidden" name="%s" value="%s" />', $parameter, $value); } } $template = '<form action="mod.php" id="form-menu-storage" method="get"> %s <select name="%s[storage]" class="btn btn-min" id="menu-storage" onchange="$(\'#form-menu-storage\').submit()">%s</select> </form>'; return sprintf($template, $inputs, $this->moduleLoader->getParameterPrefix(), $options); }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->id = intval(GeneralUtility::_GET('id')); $this->tsParser = new TsParserUtility(); // extension configuration $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['themes']); $extensionConfiguration['categoriesToShow'] = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']); $extensionConfiguration['constantsToHide'] = GeneralUtility::trimExplode(',', $extensionConfiguration['constantsToHide']); // mod.tx_themes.constantCategoriesToShow.value $externalConstantCategoriesToShow = $GLOBALS['BE_USER']->getTSConfig('mod.tx_themes.constantCategoriesToShow', BackendUtility::getPagesTSconfig($this->id)); if ($externalConstantCategoriesToShow['value']) { $this->externalConfig['constantCategoriesToShow'] = GeneralUtility::trimExplode(',', $externalConstantCategoriesToShow['value']); ArrayUtility::mergeRecursiveWithOverrule($extensionConfiguration['categoriesToShow'], $this->externalConfig['constantCategoriesToShow']); } else { $this->externalConfig['constantCategoriesToShow'] = array(); } // mod.tx_themes.constantsToHide.value $externalConstantsToHide = $GLOBALS['BE_USER']->getTSConfig('mod.tx_themes.constantsToHide', BackendUtility::getPagesTSconfig($this->id)); if ($externalConstantsToHide['value']) { $this->externalConfig['constantsToHide'] = GeneralUtility::trimExplode(',', $externalConstantsToHide['value']); ArrayUtility::mergeRecursiveWithOverrule($extensionConfiguration['constantsToHide'], $this->externalConfig['constantsToHide']); } else { $this->externalConfig['constantsToHide'] = array(); } $this->allowedCategories = $extensionConfiguration['categoriesToShow']; $this->deniedFields = $extensionConfiguration['constantsToHide']; // initialize normally used values }
/** * this is an intermediate clickmenu handler * * @param ServerRequestInterface $request * @param ResponseInterface $response * @return ResponseInterface */ public function getContextMenuAction(ServerRequestInterface $request, ResponseInterface $response) { // XML has to be parsed, no parse errors allowed @ini_set('display_errors', 0); $clipObj = GeneralUtility::makeInstance(Clipboard::class); $clipObj->initializeClipboard(); // This locks the clipboard to the Normal for this request. $clipObj->lockToNormal(); // Update clipboard if some actions are sent. $CB = GeneralUtility::_GET('CB'); $clipObj->setCmd($CB); $clipObj->cleanCurrent(); // Saves $clipObj->endClipboard(); // Create clickmenu object $clickMenu = GeneralUtility::makeInstance(ClickMenu::class); // Set internal vars in clickmenu object: $clickMenu->clipObj = $clipObj; $clickMenu->extClassArray = $this->extClassArray; // Set content of the clickmenu with the incoming var, "item" $ajaxContent = $clickMenu->init(); // send the data $ajaxContent = '<?xml version="1.0"?><t3ajax>' . $ajaxContent . '</t3ajax>'; $response->getBody()->write($ajaxContent); $response = $response->withHeader('Content-Type', 'text/xml; charset=utf-8'); return $response; }
public function initialize() { $feUserObj = EidUtility::initFeUser(); $pageId = GeneralUtility::_GET('id') ?: 1; /** @var TypoScriptFrontendController $typoScriptFrontendController */ $typoScriptFrontendController = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], $pageId, 0, TRUE); $GLOBALS['TSFE'] = $typoScriptFrontendController; $typoScriptFrontendController->connectToDB(); $typoScriptFrontendController->fe_user = $feUserObj; $typoScriptFrontendController->id = 2653; $typoScriptFrontendController->determineId(); $typoScriptFrontendController->getCompressedTCarray(); $typoScriptFrontendController->initTemplate(); $typoScriptFrontendController->getConfigArray(); $typoScriptFrontendController->includeTCA(); /** @var TypoScriptService $typoScriptService */ $typoScriptService = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); $pluginTyposcript = $typoScriptFrontendController->tmpl->setup['plugin.'][$this->extensionConfiguration['extensionKey'] . '.']; $this->pluginConfiguration = $typoScriptService->convertTypoScriptArrayToPlainArray($pluginTyposcript); // Set configuration to call the plugin $extensionConfiguration['settings'] = $this->pluginConfiguration['settings']; $extensionConfiguration['persistence'] = $this->pluginConfiguration['persistence']; $this->extensionConfiguration = array_merge($extensionConfiguration, $this->extensionConfiguration); $this->bootstrap = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Core\\Bootstrap'); $this->bootstrap->initialize($this->extensionConfiguration); }
/** * @param $imageorientConfig * @return array */ public function setImageorientItems(&$imageorientConfig) { $pageTsConfig = BackendUtility::getPagesTSconfig(GeneralUtility::_GET('id')); $pageTsConfig = GeneralUtility::removeDotsFromTS($pageTsConfig); if (array_key_exists('tx_customresponsiveimages', $pageTsConfig)) { $responsiveImageConfiguration = $pageTsConfig['tx_customresponsiveimages']; } else { $responsiveImageConfiguration = array(); } $groupedItems = array(); $i = 0; foreach ($responsiveImageConfiguration['items'] as $imageorient => $item) { $groupedItems[$item['group']][$i][] = $GLOBALS['LANG']->sL($item['label']); $groupedItems[$item['group']][$i][] = $imageorient; $groupedItems[$item['group']][$i][] = array_key_exists('icon', $item) && !empty($item['icon']) ? $responsiveImageConfiguration['seliconsPath'] . $item['icon'] : NULL; $i++; } $imageOrientItems = array(); foreach ($responsiveImageConfiguration['groups'] as $groupName => $group) { if (array_key_exists('label', $group) && !empty($group['label'])) { $imageOrientItems[] = array($GLOBALS['LANG']->sL($group['label']), '--div--'); } if (array_key_exists($groupName, $groupedItems)) { foreach ($groupedItems[$groupName] as $item) { array_push($imageOrientItems, $item); } } } $imageorientConfig['items'] = $imageOrientItems; }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->id = intval(GeneralUtility::_GET('id')); $this->tsParser = new TsParserUtility(); // Get extension configuration /** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */ $configurationUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility'); $extensionConfiguration = $configurationUtility->getCurrentConfiguration('themes'); // Initially, get configuration from extension manager! $extensionConfiguration['categoriesToShow'] = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']['value']); $extensionConfiguration['constantsToHide'] = GeneralUtility::trimExplode(',', $extensionConfiguration['constantsToHide']['value']); // mod.tx_themes.constantCategoriesToShow.value // Get value from page/user typoscript $externalConstantCategoriesToShow = $this->getBackendUser()->getTSConfig('mod.tx_themes.constantCategoriesToShow', BackendUtility::getPagesTSconfig($this->id)); if ($externalConstantCategoriesToShow['value']) { $this->externalConfig['constantCategoriesToShow'] = GeneralUtility::trimExplode(',', $externalConstantCategoriesToShow['value']); $extensionConfiguration['categoriesToShow'] = array_merge($extensionConfiguration['categoriesToShow'], $this->externalConfig['constantCategoriesToShow']); } // mod.tx_themes.constantsToHide.value // Get value from page/user typoscript $externalConstantsToHide = $this->getBackendUser()->getTSConfig('mod.tx_themes.constantsToHide', BackendUtility::getPagesTSconfig($this->id)); if ($externalConstantsToHide['value']) { $this->externalConfig['constantsToHide'] = GeneralUtility::trimExplode(',', $externalConstantsToHide['value']); $extensionConfiguration['constantsToHide'] = array_merge($extensionConfiguration['constantsToHide'], $this->externalConfig['constantsToHide']); } $this->allowedCategories = $extensionConfiguration['categoriesToShow']; $this->deniedFields = $extensionConfiguration['constantsToHide']; // initialize normally used values }
/** * Main function * * @param [type] $$backRef: ... * @param [type] $menuItems: ... * @param [type] $table: ... * @param [type] $uid: ... * @return [type] ... */ function main(&$backRef, $menuItems, $table, $uid) { global $BE_USER, $TCA, $LANG; $localItems = array(); if (!$backRef->cmLevel) { // Returns directly, because the clicked item was not from the pages table if ($table == "tx_l10nmgr_cfg") { // Adds the regular item: $LL = $this->includeLL(); // Repeat this (below) for as many items you want to add! // Remember to add entries in the localconf.php file for additional titles. $url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm1/index.php?id=" . $uid; $localItems[] = $backRef->linkItem($GLOBALS["LANG"]->getLLL("cm1_title", $LL), $backRef->excludeIcon('<img src="' . ExtensionManagementUtility::extRelPath("l10nmgr") . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" />'), $backRef->urlRefForCM($url), 1); } $localItems["moreoptions_tx_l10nmgr_cm3"] = $backRef->linkItem('L10Nmgr tools', '', "top.loadTopMenu('" . GeneralUtility::linkThisScript() . "&cmLevel=1&subname=moreoptions_tx_l10nmgrXX_cm3');return false;", 0, 1); // Simply merges the two arrays together and returns ... $menuItems = array_merge($menuItems, $localItems); } elseif (GeneralUtility::_GET('subname') == 'moreoptions_tx_l10nmgrXX_cm3') { $url = ExtensionManagementUtility::extRelPath("l10nmgr") . "cm3/index.php?id=" . $uid . '&table=' . $table; $localItems[] = $backRef->linkItem('Create priority', '', $backRef->urlRefForCM($url . '&cmd=createPriority'), 1); $localItems[] = $backRef->linkItem('Manage priorities', '', $backRef->urlRefForCM($url . '&cmd=managePriorities'), 1); $localItems[] = $backRef->linkItem('Update Index', '', $backRef->urlRefForCM($url . '&cmd=updateIndex'), 1); $localItems[] = $backRef->linkItem('Flush Translations', '', $backRef->urlRefForCM($url . '&cmd=flushTranslations'), 1); $menuItems = array_merge($menuItems, $localItems); } return $menuItems; }
/** * Initialize frontend environment */ public function __construct() { if (empty($_POST['tx_ajaxexample_piexample']['action'])) { $_POST['tx_ajaxexample_piexample']['action'] = 'hello'; } $_POST['tx_ajaxexample_piexample']['controller'] = 'Example'; $this->bootstrap = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Core\\Bootstrap'); $feUserObj = EidUtility::initFeUser(); $pageId = GeneralUtility::_GET('id') ?: 1; /** @var TypoScriptFrontendController $typoScriptFrontendController */ $typoScriptFrontendController = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], $pageId, 0, TRUE); $GLOBALS['TSFE'] = $typoScriptFrontendController; $typoScriptFrontendController->connectToDB(); $typoScriptFrontendController->fe_user = $feUserObj; $typoScriptFrontendController->id = $pageId; $typoScriptFrontendController->determineId(); $typoScriptFrontendController->getCompressedTCarray(); $typoScriptFrontendController->initTemplate(); $typoScriptFrontendController->getConfigArray(); $typoScriptFrontendController->includeTCA(); /** @var TypoScriptService $typoScriptService */ $typoScriptService = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); $pluginConfiguration = $typoScriptService->convertTypoScriptArrayToPlainArray($typoScriptFrontendController->tmpl->setup['plugin.']['tx_ajaxexample.']); // Set configuration to call the plugin $this->pluginConfiguration = array('pluginName' => 'PiExample', 'vendorName' => 'Helhum', 'extensionName' => 'AjaxExample', 'controller' => 'Example', 'action' => $_POST['tx_ajaxexample_piexample']['action'], 'mvc' => array('requestHandlers' => array('TYPO3\\CMS\\Extbase\\Mvc\\Web\\FrontendRequestHandler' => 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\FrontendRequestHandler')), 'settings' => $pluginConfiguration['settings'], 'persistence' => array('storagePid' => $pluginConfiguration['persistence']['storagePid'])); }
public function main() { $result = $error = $url = NULL; $this->view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($this->templatePath . 'Main.html')); if ($this->configuration->isValid()) { try { $this->checkPageId(); $url = $this->urlService->getFullUrl($this->pageId, $this->pObj->MOD_SETTINGS); if (GeneralUtility::_GET('clear')) { $this->pageSpeedRepository->clearByIdentifier($url); $this->view->assign('cacheCleared', TRUE); } $result = $this->pageSpeedRepository->findByIdentifier($url); } catch (\HTTP_Request2_ConnectionException $e) { $error = 'error.http_request.connection'; // todo add log } catch (\RuntimeException $e) { $error = $e->getMessage(); } } else { $error = 'error.invalid.key'; } $this->view->assignMultiple(array('lll' => 'LLL:EXT:page_speed/Resources/Private/Language/locallang.xlf:', 'menu' => $this->modifyFuncMenu(BackendUtility::getFuncMenu($this->pObj->id, 'SET[language]', $this->pObj->MOD_SETTINGS['language'], $this->pObj->MOD_MENU['language']), 'language'), 'configuration' => $this->configuration, 'result' => $result, 'url' => $url, 'error' => $error, 'pageId' => $this->pageId)); return $this->view->render(); }
/** * Post-processing to define which control items to show. Possibly own icons can be added here. * * @param string $parentUid The uid of the parent (embedding) record (uid or NEW...) * @param string $foreignTable The table (foreign_table) we create control-icons for * @param array $childRecord The current record of that foreign_table * @param array $childConfig TCA configuration of the current field of the child record * @param boolean $isVirtual Defines whether the current records is only virtually shown and not physically part of the parent record * @param array $controlItems (reference) Associative array with the currently available control items * * @return void */ public function renderForeignRecordHeaderControl_postProcess($parentUid, $foreignTable, array $childRecord, array $childConfig, $isVirtual, array &$controlItems) { if ($foreignTable != 'sys_file_reference') { return; } if (!GeneralUtility::isFirstPartOfStr($childRecord['uid_local'], 'sys_file_')) { return; } $parts = BackendUtility::splitTable_Uid($childRecord['uid_local']); if (!isset($parts[1])) { return; } $table = $childRecord['tablenames']; $uid = $parentUid; $arguments = GeneralUtility::_GET(); if ($this->isValidRecord($table, $uid) && isset($arguments['edit'])) { $returnUrl = ['edit' => $arguments['edit'], 'returnUrl' => $arguments['returnUrl']]; if (GeneralUtility::compat_version('7.0')) { $returnUrlGenerated = BackendUtility::getModuleUrl('record_edit', $returnUrl); } else { $returnUrlGenerated = 'alt_doc.php?' . ltrim(GeneralUtility::implodeArrayForUrl('', $returnUrl, '', true, true), '&') . BackendUtility::getUrlToken('editRecord'); } $wizardArguments = ['P' => ['referenceUid' => $childRecord['uid'], 'returnUrl' => $returnUrlGenerated]]; $wizardUri = BackendUtility::getModuleUrl('focuspoint', $wizardArguments); } else { $wizardUri = 'javascript:alert(\'Please save the base record first, because open this wizard will not save the changes in the current form!\');'; } /** @var WizardService $wizardService */ $wizardService = GeneralUtility::makeInstance('HDNET\\Focuspoint\\Service\\WizardService'); $this->arrayUnshiftAssoc($controlItems, 'focuspoint', $wizardService->getWizardButton($wizardUri)); }
/** * Override the action name if found in the uc of the user * * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException */ public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { $vars = GeneralUtility::_GET('tx_indexedsearch_web_indexedsearchisearch'); $beUser = $this->getBackendUserAuthentication(); if (is_array($vars) && isset($vars['action']) && method_exists($this, $vars['action'] . 'Action')) { $action = $vars['action']; switch($action) { case 'saveStopwordsKeywords': $action = 'statisticDetails'; break; case 'deleteIndexedItem': $action = 'statistic'; break; } $beUser->uc['indexed_search']['action'] = $action; $beUser->uc['indexed_search']['arguments'] = $request->getArguments(); $beUser->writeUC(); } elseif (isset($beUser->uc['indexed_search']['action'])) { if ($request instanceof WebRequest) { $request->setControllerActionName($beUser->uc['indexed_search']['action']); } if (isset($beUser->uc['indexed_search']['arguments'])) { $request->setArguments($beUser->uc['indexed_search']['arguments']); } } parent::processRequest($request, $response); }
/** * Hook-function: inject t3editor JavaScript code before the page is compiled * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage * * @param array $parameters * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $documentTemplate * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage */ public function preStartPageHook($parameters, $documentTemplate) { if (GeneralUtility::_GET('M') === 'file_edit') { $t3editor = $this->getT3editor(); $documentTemplate->JScode .= $t3editor->getJavascriptCode($documentTemplate); $documentTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/T3editor/FileEdit'); } }
/** * @return int */ protected function getNextTransactionId() { $transaction = 0; if (GeneralUtility::_GET('sEcho')) { $transaction = (int) GeneralUtility::_GET('sEcho') + 1; } return $transaction; }
/** * Returns the "back" buttons to be placed in the doc header. * * @return string */ public function render() { $result = ''; if (GeneralUtility::_GET('returnUrl')) { $result = sprintf('<a href="%s" class="btn btn-default btn-return-top">%s</a>', GeneralUtility::_GP('returnUrl'), $this->getIconFactory()->getIcon('actions-document-close', Icon::SIZE_SMALL)); } return $result; }
public function render(\GeorgRinger\News\Domain\Model\News $newsItem) { $vars = GeneralUtility::_GET('tx_news_pi1'); if (isset($vars['news']) && (int) $newsItem->getUid() === (int) $vars['news']) { return $this->renderThenChild(); } else { return $this->renderElseChild(); } }
/** * Initializes the current action */ protected function initializeAction() { // Set default value of PID to know where to store/look for newsletter $this->pid = filter_var(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('id'), FILTER_VALIDATE_INT, ['min_range' => 0]); if (!$this->pid) { $this->pid = 0; } parent::initializeAction(); }
/** * @param string $theme * @return string * @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException */ public function render($theme) { $pageId = intval(GeneralUtility::_GET('id')); $themeOfPage = $this->themeRepository->findByPageOrRootline($pageId); if ($themeOfPage !== NULL && $themeOfPage->getExtensionName() === $theme) { return $this->renderThenChild(); } return $this->renderElseChild(); }
/** * Stop validation if confirmation step is active on create * * @return bool */ protected function ignoreValidationIfConfirmation() { $piVars = GeneralUtility::_GP('tx_powermail_pi1'); $piVarsGet = GeneralUtility::_GET('tx_powermail_pi1'); if ($piVars['__referrer']['@action'] === 'confirmation' && $piVarsGet['action'] === 'create') { return TRUE; } return FALSE; }
protected function getCurrentIdentifier() { $moduleName = GeneralUtility::_GET('M'); $prefix = 'AppEngineApp_AppEngineId'; if (strpos($moduleName, $prefix) === 0) { return substr($moduleName, strlen($prefix)); } return NULL; }
public function render(Tx_News_Domain_Model_News $newsItem) { $vars = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('tx_news_pi1'); if (isset($vars['news']) && (int) $newsItem->getUid() === (int) $vars['news']) { return $this->renderThenChild(); } else { return $this->renderElseChild(); } }
/** * action edit * * @return void */ public function editAction() { if ($GLOBALS['TSFE']->id === MainHelper::CHANGEUSERDATAPAGEID) { $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); $lang = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('L'); $pageRenderer->addJsFooterInlineCode('', "jQuery(document).ready(function(){\r\n Gbfemanager.init({$lang});\r\n });"); } parent::editAction(); }
/** * Hook-function: inject t3editor JavaScript code before the page is compiled * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage * * @return void * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage */ public function preStartPageHook() { // Enable editor in Template-Modul if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('M') === 'web_ts') { $t3editor = $this->getT3editor(); // Insert javascript code $t3editor->getJavascriptCode(); } }
/** * This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality. * * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method. * @return bool */ protected static function evaluateCondition($arguments = null) { $pageId = intval(GeneralUtility::_GET('id')); /** @var \KayStrobach\Themes\Domain\Repository\ThemeRepository $themeRepository */ $themeRepository = GeneralUtility::makeInstance('KayStrobach\\Themes\\Domain\\Repository\\ThemeRepository'); /** @var \KayStrobach\Themes\Domain\Model\Theme $themeOfPage */ $themeOfPage = $themeRepository->findByPageOrRootline($pageId); return $themeOfPage !== NULL && $themeOfPage->getExtensionName() === $arguments['theme']; }
/** * Hook-function: inject t3editor JavaScript code before the page is compiled * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage * * @param array $parameters * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $pObj * @return void * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage */ public function preStartPageHook($parameters, $pObj) { // Enable editor in Template-Modul if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('M') === 'web_ts') { $t3editor = $this->getT3editor(); // Insert javascript code in document header $pObj->JScode .= $t3editor->getJavascriptCode($pObj); } }
/** * Stop validation if confirmation step is active on create * * @return bool */ protected function ignoreValidationIfConfirmation() { $piVars = GeneralUtility::_GP($this->variablesPrefix); $piVarsGet = GeneralUtility::_GET($this->variablesPrefix); if ($piVars['__referrer']['@action'] === 'confirmation' && $piVarsGet['action'] === 'create') { return true; } return false; }
/** * Hook-function: inject t3editor JavaScript code before the page is compiled * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage * * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage */ public function preStartPageHook() { // @todo: this is a workaround. Ideally the document template holds the current request so we can match the route // against the name of the route and not the GET parameter if (GeneralUtility::_GET('route') === '/file/editcontent') { $t3editor = $this->getT3editor(); $t3editor->getJavascriptCode(); $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/T3editor/FileEdit'); } }
/** * @return void */ public function selectThemeAction() { $selectedThemes = GeneralUtility::_GET('selectedThemes'); foreach ($selectedThemes as $theme => $isSelected) { $themeName = end(explode('.', $theme)); $selectedThemeNames[$themeName] = $isSelected == 'checked' ? TRUE : FALSE; } $this->registry->set('tx_yag', 'rfcSelectedThemes', serialize($selectedThemeNames)); exit; }
/** * Main entry point for checking extensions to load, * setting up the checks (deleting protocol), and returning * OK if process run through without errors * * @return string "OK" if process ran through without errors */ protected function executeAction() { register_shutdown_function(array($this, 'logError')); $getVars = GeneralUtility::_GET('install'); if (isset($getVars['extensionCompatibilityTester']) && isset($getVars['extensionCompatibilityTester']['forceCheck']) && $getVars['extensionCompatibilityTester']['forceCheck'] == 1) { $this->deleteProtocolFile(); } $this->tryToLoadExtLocalconfAndExtTablesOfExtensions($this->getExtensionsToLoad()); return 'OK'; }
/** * Initializes the instance of this class. This constructir sets starting * point for the sitemap to the current page id */ public function __construct() { $this->cObj = GeneralUtility::makeInstance('tslib_cObj'); $this->cObj->start(array()); $this->offset = max(0, intval(GeneralUtility::_GET('offset'))); $this->limit = max(0, intval(GeneralUtility::_GET('limit'))); if ($this->limit <= 0) { $this->limit = 50000; } $this->createRenderer(); }
/** * process field array for table tt_content * * @param array $fieldArray * * @return void */ public function processFieldArrayForTtContent(array &$fieldArray) { if ($this->getTable() === 'tt_content') { $pid = (int) GeneralUtility::_GET('DDinsertNew'); if (abs($pid) > 0) { $this->setDefaultFieldValues($fieldArray, $pid); $this->getDefaultFlexformValues($fieldArray); } } $this->setFieldEntries($fieldArray, $pid); }