Example #1
0
 /**
  * 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));
 }
Example #2
0
 /**
  * Get TCA information
  *
  * @param string $tableName
  *
  * @return array
  */
 public function getTca($tableName)
 {
     $tca = ['ctrl' => ['languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource'], 'columns' => ['sys_language_uid' => ['exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'default' => '0', 'special' => 'languages', 'items' => [['LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1, 'flags-multiple']]]], 'l10n_parent' => ['displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'items' => [['', 0]], 'foreign_table' => $tableName, 'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)', 'foreign_table_loadIcons' => false, 'noIconsBelowSelect' => true]], 'l10n_diffsource' => ['config' => ['type' => 'passthrough']]], 'palettes' => ['language' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource']]];
     if (!GeneralUtility::compat_version('7.0')) {
         $tca['columns']['l10n_parent']['config']['iconsInOptionTags'] = false;
     }
     return $tca;
 }
Example #3
0
 /**
  * Get the wizard icon
  *
  * @return string
  */
 protected function getWizardIcon()
 {
     if (GeneralUtility::compat_version('7.6')) {
         /** @var \TYPO3\CMS\Core\Imaging\IconFactory $iconFactory */
         $iconFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Imaging\\IconFactory');
         $icon = $iconFactory->getIcon('tcarecords-tx_focuspoint_domain_model_filestandalone-default', Icon::SIZE_SMALL, null);
         return $icon->render();
     }
     return IconUtility::getSpriteIcon('extensions-focuspoint-focuspoint');
 }
Example #4
0
 /**
  * Render a edit link for the backend preview
  *
  * @param array $data Row of the content element
  *
  * @return string
  */
 public function render(array $data)
 {
     $urlParameter = ['edit[tt_content][' . $data['uid'] . ']' => 'edit', 'returnUrl' => GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')];
     if (GeneralUtility::compat_version('7.0')) {
         $url = BackendUtility::getModuleUrl('record_edit', $urlParameter);
     } else {
         $url = $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . http_build_query($urlParameter);
     }
     return '<a href="' . $url . '">' . $this->renderChildren() . '</a>';
 }
 /**
  * Uses GeneralUtility::compat_version to return a classname which can be used in backend views
  *
  * @todo: Remove condition, when TYPO3 6.2 is deprecated
  *
  * @return string
  */
 public function render()
 {
     if (GeneralUtility::compat_version('7.6')) {
         return 'typo3-76';
     } elseif (GeneralUtility::compat_version('6.2')) {
         return 'typo3-62';
     } else {
         return '';
     }
 }
 /**
  * Returns a URL to link to FormEngine
  *
  * @param string $parameters Is a set of GET params to send to FormEngine
  * @return string URL to FormEngine module + parameters
  * @see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()
  */
 public function render($parameters)
 {
     // Make sure record_edit module is available
     if (GeneralUtility::compat_version('7.0')) {
         $parameters = GeneralUtility::explodeUrl2Array($parameters);
         return BackendUtility::getModuleUrl('record_edit', $parameters);
     } else {
         return 'alt_doc.php?' . $parameters;
     }
 }
Example #7
0
 /**
  * Resize the image (if required) and returns its path. If the image was not changed, the path will be equal to $src
  *
  * @see http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/5/#id4164427
  *
  * @param string                           $src
  * @param FileInterface|AbstractFileFolder $image
  * @param string                           $width              width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.
  * @param string                           $height             height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.
  * @param integer                          $minWidth           minimum width of the image
  * @param integer                          $minHeight          minimum height of the image
  * @param integer                          $maxWidth           maximum width of the image
  * @param integer                          $maxHeight          maximum height of the image
  * @param boolean                          $treatIdAsReference given src argument is a sys_file_reference record
  * @param string                           $ratio
  *
  * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
  * @return string path to the image
  */
 public function render($src = null, $image = null, $width = null, $height = null, $minWidth = null, $minHeight = null, $maxWidth = null, $maxHeight = null, $treatIdAsReference = false, $ratio = '1:1')
 {
     if (GeneralUtility::compat_version('7.0')) {
         return self::renderStatic(['src' => $src, 'image' => $image, 'width' => $width, 'height' => $height, 'minWidth' => $minWidth, 'minHeight' => $minHeight, 'maxWidth' => $maxWidth, 'maxHeight' => $maxHeight, 'treatIdAsReference' => $treatIdAsReference, 'crop' => null, 'ratio' => $ratio], $this->buildRenderChildrenClosure(), $this->renderingContext);
     }
     /** @var \HDNET\Focuspoint\Service\FocusCropService $service */
     $service = GeneralUtility::makeInstance('HDNET\\Focuspoint\\Service\\FocusCropService');
     $src = $service->getCroppedImageSrcForViewHelper($src, $image, $treatIdAsReference, $ratio);
     return parent::render($src, null, $width, $height, $minWidth, $minHeight, $maxWidth, $maxHeight, false);
 }
Example #8
0
 /**
  * Processing the wizard items array
  *
  * @param    array $wizardItems : The wizard items
  *
  * @return    array Modified array with wizard items
  */
 function proc($wizardItems)
 {
     $LL = $this->includeLocalLang();
     $icon = 'EXT:html5videoplayer/Resources/Public/Icons/Wizicon.gif';
     if (!GeneralUtility::compat_version('7.0')) {
         $icon = ExtensionManagementUtility::extRelPath('html5videoplayer') . '/Resources/Public/Icons/Wizicon.gif';
     }
     $wizardItems['plugins_tx_html5videoplayer_pi1'] = array('icon' => $icon, 'title' => $this->getLanguage()->getLLL('list_title', $LL), 'description' => $this->getLanguage()->getLLL('list_plus_wiz_description', $LL), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=html5videoplayer_pivideoplayer');
     return $wizardItems;
 }
Example #9
0
 /**
  * Test if exception handling works
  * Using expectedException does not work supporting 7 + 8.
  *
  * @test
  * @return void
  */
 public function viewHelperThrowsExceptionIfFileNotFoundFor()
 {
     try {
         $viewHelper = new FileSizeViewHelper();
         $viewHelper->render('fo', 'bar');
     } catch (\Exception $e) {
         $expectedException = GeneralUtility::compat_version('8.0.0') ? 'TYPO3Fluid\\Fluid\\Core\\Exception' : 'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Exception\\InvalidVariableException';
         $this->assertEquals($expectedException, get_class($e));
     }
 }
 /**
  * Itemsproc function to extend the selection of templateLayouts in the plugin
  *
  * @todo: Remove condition when TYPO3 6.2 is deprecated
  *
  * @param array $config Configuration array
  *
  * @return void
  */
 public function user_templateLayout(array &$config)
 {
     if (GeneralUtility::compat_version('7.6')) {
         $templateLayouts = $this->getTemplateLayoutsFromTsConfig($config['flexParentDatabaseRow']['pid']);
     } else {
         $templateLayouts = $this->getTemplateLayoutsFromTsConfig($config['row']['pid']);
     }
     foreach ($templateLayouts as $index => $layout) {
         $additionalLayout = [$GLOBALS['LANG']->sL($layout, true), $index];
         array_push($config['items'], $additionalLayout);
     }
 }
 /**
  * include inlineJs
  *
  * @param string $inlineJS
  * @param int $currentCeUid
  * @return void
  */
 public function render($inlineJS, $currentRow)
 {
     $block = 'jQuery(function(){' . $inlineJS . '});';
     $name = 't3sbootstrap-thumbnailrow-' . $currentRow;
     if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('7.4')) {
         /* @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
         $pageRenderer = $this->objectManager->get('TYPO3\\CMS\\Core\\Page\\PageRenderer');
         $pageRenderer->addJsFooterInlineCode($name, $block);
     } else {
         $GLOBALS['TSFE']->getPageRenderer()->addJsFooterInlineCode($name, $block);
     }
 }
Example #12
0
 /**
  * clear Cache ajax handler
  *
  * @param array              $ajaxParams
  * @param AjaxRequestHandler $ajaxObj
  */
 public function clear($ajaxParams, AjaxRequestHandler $ajaxObj)
 {
     if ($this->isProduction() || !$this->isAdmin()) {
         return;
     }
     /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */
     $cacheManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager');
     $cacheManager->getCache('autoloader')->flush();
     // Dump new class loading information
     if (GeneralUtility::compat_version('7.0') && !\TYPO3\CMS\Core\Core\Bootstrap::usesComposerClassLoading()) {
         ClassLoadingInformation::dumpClassLoadingInformation();
     }
 }
 /**
  * Renders a edit link for the given Event UID
  *
  * @todo: Remove condition, when TYPO3 6.2 is deprecated
  *
  * @param int $uid
  * @return string
  */
 public function render($uid)
 {
     $pid = (int) GeneralUtility::_GET('id');
     if (GeneralUtility::compat_version('7.6')) {
         $parameters = ['edit[tx_sfeventmgt_domain_model_event][' . (int) $uid . ']' => 'edit'];
         $parameters['returnUrl'] = 'index.php?M=web_SfEventMgtTxSfeventmgtM1&id=' . $pid . $this->getModuleToken();
         $url = BackendUtility::getModuleUrl('record_edit', $parameters);
     } else {
         $returnUrl = 'mod.php?M=web_SfEventMgtTxSfeventmgtM1&id=' . $pid . $this->getModuleToken();
         $url = 'alt_doc.php?edit[tx_sfeventmgt_domain_model_event][' . (int) $uid . ']=edit&returnUrl=' . urlencode($returnUrl);
     }
     return $url;
 }
 /**
  * Returns a URL to link to quick command
  *
  * @param string $parameters Is a set of GET params to send to FormEngine
  * @return string URL to FormEngine module + parameters
  */
 public function render($parameters)
 {
     $parameters = GeneralUtility::explodeUrl2Array($parameters);
     $parameters['vC'] = $this->getBackendUserAuthentication()->veriCode();
     $parameters['prErr'] = 1;
     $parameters['uPT'] = 1;
     // Make sure record_edit module is available
     if (GeneralUtility::compat_version('7.0')) {
         $url = BackendUtility::getModuleUrl('tce_db', $parameters);
     } else {
         $url = 'tce_db.php?' . GeneralUtility::implodeArrayForUrl('', $parameters);
     }
     return $url . BackendUtility::getUrlToken('tceAction');
 }
 /**
  * Preprocesses the preview rendering of a content element.
  *
  * @param PageLayoutView $parentObject  Calling parent object
  * @param bool           $drawItem      Whether to draw the item using the default functionalities
  * @param string         $headerContent Header content
  * @param string         $itemContent   Item content
  * @param array          $row           Record row of tt_content
  *
  * @return void
  */
 public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
 {
     if (!$this->isAutoloaderContenobject($row)) {
         return;
     }
     if (!$this->hasBackendPreview($row)) {
         return;
     }
     if (!GeneralUtility::compat_version('7.0') && !ExtensionManagementUtility::isLoaded('css_styled_content')) {
         // @todo avoid exception in the backend of TYPO3 6.2. Check why the backend is broken
         return;
     }
     $itemContent = $this->getBackendPreview($row);
     $drawItem = false;
 }
Example #16
0
 /**
  * clear Cache ajax handler
  *
  * @param array              $ajaxParams
  * @param AjaxRequestHandler $ajaxObj
  */
 public function clear($ajaxParams, AjaxRequestHandler $ajaxObj)
 {
     if ($this->isProduction() || !$this->isAdmin()) {
         return;
     }
     /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */
     $cacheManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager');
     $cacheManager->getCache('autoloader')->flush();
     // clear autoload folder
     if (GeneralUtility::compat_version('7.0')) {
         $autoloadFolder = GeneralUtility::getFileAbsFileName('typo3temp/autoload/');
         if (is_dir($autoloadFolder)) {
             GeneralUtility::rmdir($autoloadFolder, true);
         }
     }
 }
Example #17
0
 /**
  * Get the file object of the given cell information
  *
  * @param array $cells
  *
  * @return int
  * @throws \Exception
  */
 protected function getFileMetaUidByCells($cells)
 {
     if (GeneralUtility::compat_version('7.2.0')) {
         $metaData = $cells['__fileOrFolderObject']->_getMetaData();
         if (!isset($metaData['uid'])) {
             throw new \Exception('No meta data found', 2462378462378);
         }
         return (int) $metaData['uid'];
     } else {
         $pattern = '/sys_file_metadata\\]\\[([0-9]*)\\]/';
         if (!preg_match($pattern, $cells['editmetadata'], $matches)) {
             throw new \Exception('No valid metadata information found', 127846873264328);
         }
         return (int) $matches[1];
     }
 }
Example #18
0
 /**
  * Add the given icon to the TCA table type
  *
  * @param string $table
  * @param string $type
  * @param string $icon
  */
 public static function addTcaTypeIcon($table, $type, $icon)
 {
     if (GeneralUtility::compat_version('7.0')) {
         $fullIconPath = substr(PathUtility::getAbsoluteWebPath($icon), 1);
         if (StringUtility::endsWith(strtolower($fullIconPath), 'svg')) {
             $iconProviderClass = 'TYPO3\\CMS\\Core\\Imaging\\IconProvider\\SvgIconProvider';
         } else {
             $iconProviderClass = 'TYPO3\\CMS\\Core\\Imaging\\IconProvider\\BitmapIconProvider';
         }
         /** @var IconRegistry $iconRegistry */
         $iconRegistry = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Imaging\\IconRegistry');
         $iconIdentifier = 'tcarecords-' . $table . '-' . $type;
         $iconRegistry->registerIcon($iconIdentifier, $iconProviderClass, ['source' => $fullIconPath]);
         $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes'][$type] = $iconIdentifier;
     } else {
         $fullIconPath = str_replace('../typo3/', '', $icon);
         SpriteManager::addTcaTypeIcon('tt_content', $type, $fullIconPath);
     }
 }
Example #19
0
 /**
  * Get the file object of the given cell information
  *
  * @param array $cells
  *
  * @return int
  * @throws \Exception
  */
 protected function getFileMetaUidByCells($cells)
 {
     if (GeneralUtility::compat_version('7.2.0')) {
         $pattern = "/'([0-9]:.*?)'/";
         if (!preg_match($pattern, $cells['info'], $matches)) {
             throw new \Exception('No valid metadata information found', 24674575467452);
         }
         $resourceFactory = ResourceFactory::getInstance();
         $fileObject = $resourceFactory->getFileObjectFromCombinedIdentifier(str_replace('\\', '', $matches[1]));
         $metaData = $fileObject->_getMetaData();
         if (!isset($metaData['uid'])) {
             throw new \Exception('No meta data found', 2462378462378);
         }
         return (int) $metaData['uid'];
     } else {
         $pattern = '/sys_file_metadata\\]\\[([0-9]*)\\]/';
         if (!preg_match($pattern, $cells['editmetadata'], $matches)) {
             throw new \Exception('No valid metadata information found', 127846873264328);
         }
         return (int) $matches[1];
     }
 }
 /**
  * Include a CSS/JS files
  *
  * @param string $path Path to the CSS/JS file which should be included
  *
  * @return void
  */
 public function render($path)
 {
     $path = $GLOBALS['TSFE']->tmpl->getFileName($path);
     // JS
     if (strtolower(substr($path, -3)) === '.js') {
         if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('7.4')) {
             /* @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
             $pageRenderer = $this->objectManager->get('TYPO3\\CMS\\Core\\Page\\PageRenderer');
             $pageRenderer->addJsFile($path, NULL, FALSE);
         } else {
             $GLOBALS['TSFE']->getPageRenderer()->addJsFile($path, NULL, FALSE);
         }
         // CSS
     } elseif (strtolower(substr($path, -4)) === '.css') {
         if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('7.4')) {
             /* @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
             $pageRenderer = $this->objectManager->get('TYPO3\\CMS\\Core\\Page\\PageRenderer');
             $pageRenderer->addCssFile($path, 'stylesheet', 'screen', '', FALSE);
         } else {
             $GLOBALS['TSFE']->getPageRenderer()->addCssFile($path, 'stylesheet', 'screen', '', FALSE);
         }
     }
 }
Example #21
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$GLOBALS['PATH_solr'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('solr');
# ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- #
$compatMode = FALSE;
if (!\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('6.0')) {
    $compatMode = TRUE;
    require_once $GLOBALS['PATH_solr'] . 'Compat/interface.tx_scheduler_progressprovider.php';
}
define('SOLR_COMPAT', $compatMode);
# ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- #
// Windows compatibility
if (!function_exists('strptime')) {
    require_once $GLOBALS['PATH_solr'] . 'Lib/strptime/strptime.php';
}
# ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- #
// adding the Search plugin
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'PiResults/Results.php', '_pi_results', 'list_type', FALSE);
// adding the Search Form plugin
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'PiSearch/Search.php', '_pi_search', 'list_type', TRUE);
// adding the Frequent Searches plugin
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'PiFrequentSearches/FrequentSearches.php', '_pi_frequentsearches', 'list_type', TRUE);
# ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- #
// registering Index Queue page indexer helpers
if (TYPO3_MODE == 'FE' && isset($_SERVER['HTTP_X_TX_SOLR_IQ'])) {
    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest']['Tx_Solr_IndexQueue_PageIndexerRequestHandler'] = '&Tx_Solr_IndexQueue_PageIndexerRequestHandler->run';
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument']['Tx_Solr_AdditionalFieldsIndexer'] = 'Tx_Solr_AdditionalFieldsIndexer';
    Tx_Solr_IndexQueue_FrontendHelper_Manager::registerFrontendHelper('findUserGroups', 'Tx_Solr_IndexQueue_FrontendHelper_UserGroupDetector');
 /**
  * Checks if config-array exists already but if not, gets it
  *
  * @return void
  * @todo Define visibility
  */
 public function getConfigArray()
 {
     $setStatPageName = FALSE;
     // If config is not set by the cache (which would be a major mistake somewhere) OR if INTincScripts-include-scripts have been registered, then we must parse the template in order to get it
     if (!is_array($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) {
         $GLOBALS['TT']->push('Parse template', '');
         // Force parsing, if set?:
         $this->tmpl->forceTemplateParsing = $this->forceTemplateParsing;
         // Start parsing the TS template. Might return cached version.
         $this->tmpl->start($this->rootLine);
         $GLOBALS['TT']->pull();
         if ($this->tmpl->loaded) {
             $GLOBALS['TT']->push('Setting the config-array', '');
             // toplevel - objArrayName
             $this->sPre = $this->tmpl->setup['types.'][$this->type];
             $this->pSetup = $this->tmpl->setup[$this->sPre . '.'];
             if (!is_array($this->pSetup)) {
                 $message = 'The page is not configured! [type=' . $this->type . '][' . $this->sPre . '].';
                 if ($this->checkPageUnavailableHandler()) {
                     $this->pageUnavailableAndExit($message);
                 } else {
                     $explanation = 'This means that there is no TypoScript object of type PAGE with typeNum=' . $this->type . ' configured.';
                     \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog($message, 'cms', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
                     throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message . ' ' . $explanation, 1294587217);
                 }
             } else {
                 $this->config['config'] = array();
                 // Filling the config-array, first with the main "config." part
                 if (is_array($this->tmpl->setup['config.'])) {
                     $this->config['config'] = $this->tmpl->setup['config.'];
                 }
                 // override it with the page/type-specific "config."
                 if (is_array($this->pSetup['config.'])) {
                     $this->config['config'] = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($this->config['config'], $this->pSetup['config.']);
                 }
                 if ($this->config['config']['typolinkEnableLinksAcrossDomains']) {
                     $this->config['config']['typolinkCheckRootline'] = TRUE;
                 }
                 // Set default values for removeDefaultJS and inlineStyle2TempFile so CSS and JS are externalized if compatversion is higher than 4.0
                 if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('4.0')) {
                     if (!isset($this->config['config']['removeDefaultJS'])) {
                         $this->config['config']['removeDefaultJS'] = 'external';
                     }
                     if (!isset($this->config['config']['inlineStyle2TempFile'])) {
                         $this->config['config']['inlineStyle2TempFile'] = 1;
                     }
                 }
                 if (!isset($this->config['config']['compressJs'])) {
                     $this->config['config']['compressJs'] = 0;
                 }
                 // Processing for the config_array:
                 $this->config['rootLine'] = $this->tmpl->rootLine;
                 $this->config['mainScript'] = trim($this->config['config']['mainScript']) ? trim($this->config['config']['mainScript']) : 'index.php';
                 // Class for render Header and Footer parts
                 $template = '';
                 if ($this->pSetup['pageHeaderFooterTemplateFile']) {
                     $file = $this->tmpl->getFileName($this->pSetup['pageHeaderFooterTemplateFile']);
                     if ($file) {
                         $this->setTemplateFile($file);
                     }
                 }
             }
             $GLOBALS['TT']->pull();
         } else {
             if ($this->checkPageUnavailableHandler()) {
                 $this->pageUnavailableAndExit('No TypoScript template found!');
             } else {
                 $message = 'No TypoScript template found!';
                 \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog($message, 'cms', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
                 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1294587218);
             }
         }
     }
     // Initialize charset settings etc.
     $this->initLLvars();
     // No cache
     // Set $this->no_cache TRUE if the config.no_cache value is set!
     if ($this->config['config']['no_cache']) {
         $this->set_no_cache();
     }
     // Merge GET with defaultGetVars
     if (!empty($this->config['config']['defaultGetVars.'])) {
         $modifiedGetVars = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule(\TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($this->config['config']['defaultGetVars.']), \TYPO3\CMS\Core\Utility\GeneralUtility::_GET());
         \TYPO3\CMS\Core\Utility\GeneralUtility::_GETset($modifiedGetVars);
     }
     // Hook for postProcessing the configuration array
     if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'])) {
         $params = array('config' => &$this->config['config']);
         foreach ($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
 }
 /**
  * Returns the URL to a given module
  *      mainly used for visibility settings or deleting
  *      a record via AJAX
  *
  * @param string $moduleName Name of the module
  * @param array $urlParameters URL parameters that should be added as key value pairs
  * @return string Calculated URL
  * @todo remove condition for TYPO3 6.2 in upcoming major version
  */
 public static function getModuleUrl($moduleName, $urlParameters = [])
 {
     if (GeneralUtility::compat_version('7.2')) {
         $uri = BackendUtilityCore::getModuleUrl($moduleName, $urlParameters);
     } else {
         $uri = 'tce_db.php?' . BackendUtilityCore::getUrlToken('tceAction');
     }
     return $uri;
 }
 /**
  * Pre build TCA information for the given model
  *
  * @param string $modelClassName
  *
  * @return array
  */
 public function getTcaInformation($modelClassName)
 {
     $modelInformation = ClassNamingUtility::explodeObjectModelName($modelClassName);
     $extensionName = GeneralUtility::camelCaseToLowerCaseUnderscored($modelInformation['extensionName']);
     $reflectionTableName = ModelUtility::getTableNameByModelReflectionAnnotation($modelClassName);
     $tableName = ModelUtility::getTableNameByModelName($modelClassName);
     $searchFields = [];
     $customFields = $this->getCustomModelFieldTca($modelClassName, $searchFields);
     if ($reflectionTableName !== '') {
         $customConfiguration = ['columns' => $customFields];
         $base = is_array($GLOBALS['TCA'][$reflectionTableName]) ? $GLOBALS['TCA'][$reflectionTableName] : [];
         return ArrayUtility::mergeRecursiveDistinct($base, $customConfiguration);
     }
     $excludes = ModelUtility::getSmartExcludesByModelName($modelClassName);
     $dataSet = $this->getDataSet();
     $dataImplementations = $dataSet->getAllAndExcludeList($excludes);
     $baseTca = $dataSet->getTcaInformation($dataImplementations, $tableName);
     // title
     $fields = array_keys($customFields);
     $labelField = 'title';
     if (!in_array($labelField, $fields)) {
         $labelField = $fields[0];
     }
     try {
         TranslateUtility::assureLabel($tableName, $extensionName);
     } catch (\Exception $ex) {
         // @todo handle
     }
     if (!is_array($baseTca['columns'])) {
         $baseTca['columns'] = [];
     }
     $baseTca['columns'] = ArrayUtility::mergeRecursiveDistinct($baseTca['columns'], $customFields);
     // items
     $showitem = $fields;
     if (!in_array('language', $excludes)) {
         $showitem[] = '--palette--;LLL:EXT:lang/locallang_general.xlf:LGL.language;language';
     }
     if (!in_array('workspaces', $excludes)) {
         $baseTca['ctrl']['shadowColumnsForNewPlaceholders'] .= ',' . $labelField;
     }
     if (GeneralUtility::compat_version('7.0')) {
         $languagePrefix = 'LLL:EXT:frontend/Resources/Private/Language/';
     } else {
         $languagePrefix = 'LLL:EXT:cms/';
     }
     if (!in_array('enableFields', $excludes)) {
         $showitem[] = '--div--;' . $languagePrefix . 'locallang_ttc.xlf:tabs.access';
         $showitem[] = '--palette--;' . $languagePrefix . 'locallang_tca.xlf:pages.palettes.access;access';
     }
     $showitem[] = '--div--;' . $languagePrefix . 'locallang_ttc.xlf:tabs.extended';
     $overrideTca = ['ctrl' => ['title' => TranslateUtility::getLllOrHelpMessage($tableName, $extensionName), 'label' => $labelField, 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => true, 'sortby' => 'sorting', 'delete' => 'deleted', 'searchFields' => implode(',', $searchFields), 'iconfile' => IconUtility::getByModelName($modelClassName, GeneralUtility::compat_version('7.0'))], 'interface' => ['showRecordFieldList' => implode(',', array_keys($baseTca['columns']))], 'types' => ['1' => ['showitem' => implode(',', $showitem)]], 'palettes' => ['access' => ['showitem' => 'starttime, endtime, --linebreak--, hidden, editlock, --linebreak--, fe_group']]];
     return ArrayUtility::mergeRecursiveDistinct($baseTca, $overrideTca);
 }
<?php

defined('TYPO3_MODE') or die;
// Keep old code (pre-FAL) for installations that haven't upgraded yet.
// @deprecated since TYPO3 6.0, please remove at earliest in TYPO3 6.2
// existing installation - and files are merged, nothing to do
if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['TYPO3\\CMS\\Install\\Updates\\TceformsUpdateWizard']) || !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['TYPO3\\CMS\\Install\\Updates\\TceformsUpdateWizard'], 'pages_language_overlay:media')) && !\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('6.0')) {
    \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[pages_language_overlay][columns][media] yet. Please do so before TYPO3 v7.');
    // Existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
    $GLOBALS['TCA']['pages_language_overlay']['columns']['media']['config'] = array('type' => 'group', 'internal_type' => 'file', 'allowed' => $GLOBALS['TCA']['pages']['columns']['media']['config']['allowed'], 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'], 'uploadfolder' => 'uploads/media', 'show_thumbs' => '1', 'size' => '3', 'maxitems' => '100', 'minitems' => '0');
}
 /**
  * Checks if there are still updates to perform
  *
  * @return 	tx_reports_reports_status_Status	An tx_reports_reports_status_Status object representing whether the installation is not completely updated yet
  */
 protected function getRemainingUpdatesStatus()
 {
     $value = $GLOBALS['LANG']->getLL('status_updateComplete');
     $message = '';
     $severity = \TYPO3\CMS\Reports\Status::OK;
     if (!\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version(TYPO3_branch)) {
         $value = $GLOBALS['LANG']->getLL('status_updateIncomplete');
         $severity = \TYPO3\CMS\Reports\Status::WARNING;
         $url = 'install/index.php?redirect_url=index.php' . urlencode('?TYPO3_INSTALL[type]=update');
         $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_update'), '<a href="' . $url . '">', '</a>');
     }
     return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Reports\\Status', $GLOBALS['LANG']->sL('LLL:EXT:install/report/locallang.xml:status_remainingUpdates'), $value, $message, $severity);
 }
 /**
  * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
  *
  * @param string $key The condition to match against its criterias.
  * @param string $value
  * @return NULL|boolean Result of the evaluation; NULL if condition could not be evaluated
  */
 protected function evaluateConditionCommon($key, $value)
 {
     if (GeneralUtility::inList('browser,version,system,useragent', strtolower($key))) {
         $browserInfo = $this->getBrowserInfo(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'));
     }
     $keyParts = GeneralUtility::trimExplode('|', $key);
     switch ($keyParts[0]) {
         case 'applicationContext':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             $currentApplicationContext = GeneralUtility::getApplicationContext();
             foreach ($values as $applicationContext) {
                 if ($this->searchStringWildcard($currentApplicationContext, $applicationContext)) {
                     return TRUE;
                 }
             }
             break;
         case 'browser':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             // take all identified browsers into account, eg chrome deliver
             // webkit=>532.5, chrome=>4.1, safari=>532.5
             // so comparing string will be
             // "webkit532.5 chrome4.1 safari532.5"
             $all = '';
             foreach ($browserInfo['all'] as $key => $value) {
                 $all .= $key . $value . ' ';
             }
             foreach ($values as $test) {
                 if (stripos($all, $test) !== FALSE) {
                     return TRUE;
                 }
             }
             break;
         case 'version':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 if (strcspn($test, '=<>') == 0) {
                     switch ($test[0]) {
                         case '=':
                             if (doubleval(substr($test, 1)) == $browserInfo['version']) {
                                 return TRUE;
                             }
                             break;
                         case '<':
                             if (doubleval(substr($test, 1)) > $browserInfo['version']) {
                                 return TRUE;
                             }
                             break;
                         case '>':
                             if (doubleval(substr($test, 1)) < $browserInfo['version']) {
                                 return TRUE;
                             }
                             break;
                     }
                 } elseif (strpos(' ' . $browserInfo['version'], $test) == 1) {
                     return TRUE;
                 }
             }
             break;
         case 'system':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             // Take all identified systems into account, e.g. mac for iOS, Linux
             // for android and Windows NT for Windows XP
             $allSystems = ' ' . implode(' ', $browserInfo['all_systems']);
             foreach ($values as $test) {
                 if (stripos($allSystems, $test) !== FALSE) {
                     return TRUE;
                 }
             }
             break;
         case 'device':
             if (!isset($this->deviceInfo)) {
                 $this->deviceInfo = $this->getDeviceType(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'));
             }
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 if ($this->deviceInfo == $test) {
                     return TRUE;
                 }
             }
             break;
         case 'useragent':
             $test = trim($value);
             if ($test !== '') {
                 return $this->searchStringWildcard((string) $browserInfo['useragent'], $test);
             }
             break;
         case 'language':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 if (preg_match('/^\\*.+\\*$/', $test)) {
                     $allLanguages = preg_split('/[,;]/', GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE'));
                     if (in_array(substr($test, 1, -1), $allLanguages)) {
                         return TRUE;
                     }
                 } elseif (GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test) {
                     return TRUE;
                 }
             }
             break;
         case 'IP':
             if ($value === 'devIP') {
                 $value = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
             }
             if (GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value)) {
                 return TRUE;
             }
             break;
         case 'hostname':
             if (GeneralUtility::cmpFQDN(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value)) {
                 return TRUE;
             }
             break;
         case 'hour':
         case 'minute':
         case 'month':
         case 'year':
         case 'dayofweek':
         case 'dayofmonth':
         case 'dayofyear':
             // In order to simulate time properly in templates.
             $theEvalTime = $GLOBALS['SIM_EXEC_TIME'];
             switch ($key) {
                 case 'hour':
                     $theTestValue = date('H', $theEvalTime);
                     break;
                 case 'minute':
                     $theTestValue = date('i', $theEvalTime);
                     break;
                 case 'month':
                     $theTestValue = date('m', $theEvalTime);
                     break;
                 case 'year':
                     $theTestValue = date('Y', $theEvalTime);
                     break;
                 case 'dayofweek':
                     $theTestValue = date('w', $theEvalTime);
                     break;
                 case 'dayofmonth':
                     $theTestValue = date('d', $theEvalTime);
                     break;
                 case 'dayofyear':
                     $theTestValue = date('z', $theEvalTime);
                     break;
             }
             $theTestValue = (int) $theTestValue;
             // comp
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($test)) {
                     $test = '=' . $test;
                 }
                 if ($this->compareNumber($test, $theTestValue)) {
                     return TRUE;
                 }
             }
             break;
         case 'compatVersion':
             return GeneralUtility::compat_version($value);
             break;
         case 'loginUser':
             if ($this->isUserLoggedIn()) {
                 $values = GeneralUtility::trimExplode(',', $value, TRUE);
                 foreach ($values as $test) {
                     if ($test == '*' || (string) $this->getUserId() === (string) $test) {
                         return TRUE;
                     }
                 }
             } elseif ($value === '') {
                 return TRUE;
             }
             break;
         case 'page':
             if ($keyParts[1]) {
                 $page = $this->getPage();
                 $property = $keyParts[1];
                 if (!empty($page) && isset($page[$property]) && (string) $page[$property] === (string) $value) {
                     return TRUE;
                 }
             }
             break;
         case 'globalVar':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 $point = strcspn($test, '!=<>');
                 $theVarName = substr($test, 0, $point);
                 $nv = $this->getVariable(trim($theVarName));
                 $testValue = substr($test, $point);
                 if ($this->compareNumber($testValue, $nv)) {
                     return TRUE;
                 }
             }
             break;
         case 'globalString':
             $values = GeneralUtility::trimExplode(',', $value, TRUE);
             foreach ($values as $test) {
                 $point = strcspn($test, '=');
                 $theVarName = substr($test, 0, $point);
                 $nv = (string) $this->getVariable(trim($theVarName));
                 $testValue = substr($test, $point + 1);
                 if ($this->searchStringWildcard($nv, trim($testValue))) {
                     return TRUE;
                 }
             }
             break;
         case 'userFunc':
             $matches = array();
             preg_match_all('/^\\s*([^\\(\\s]+)\\s*(?:\\((.*)\\))?\\s*$/', $value, $matches);
             $funcName = $matches[1][0];
             $funcValues = $matches[2][0] ? $this->parseUserFuncArguments($matches[2][0]) : array();
             if (function_exists($funcName) && call_user_func_array($funcName, $funcValues)) {
                 return TRUE;
             }
             break;
     }
     return NULL;
 }
Example #28
0
 /**
  * Wrap the given field configuration in the CE default TCA fields
  *
  * @param string $configuration
  * @param boolean $noHeader
  *
  * @return string
  */
 protected function wrapDefaultTcaConfiguration($configuration, $noHeader = false)
 {
     if (GeneralUtility::compat_version('7.0')) {
         $languagePrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf';
     } else {
         $languagePrefix = 'LLL:EXT:cms/locallang_ttc.xml';
     }
     $configuration = trim($configuration) ? trim($configuration) . ',' : '';
     return '--palette--;' . $languagePrefix . ':palette.general;general,
 ' . ($noHeader ? '' : '--palette--;' . $languagePrefix . ':palette.header;header,') . '
 --div--;LLL:EXT:autoloader/Resources/Private/Language/locallang.xml:contentData,
 ' . $configuration . '
 --div--;' . $languagePrefix . ':tabs.access,
 --palette--;' . $languagePrefix . ':palette.visibility;visibility,
 --palette--;' . $languagePrefix . ':palette.access;access,
 --div--;' . $languagePrefix . ':tabs.extended';
 }
Example #29
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin($_EXTKEY, 'Feeasygooglemap', 'EasyGoogleMap');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'EasyGoogleMap');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_easygooglemap_domain_model_location', 'EXT:easy_googlemap/Resources/Private/Language/locallang_csh_tx_easygooglemap_domain_model_location.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_easygooglemap_domain_model_location');
$TCA['tx_easygooglemap_domain_model_location'] = array('ctrl' => array('title' => 'LLL:EXT:easy_googlemap/Resources/Private/Language/locallang_db.xlf:tx_easygooglemap_domain_model_location', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => TRUE, 'sortby' => 'sorting', 'versioningWS' => 2, 'versioning_followPages' => TRUE, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'), 'searchFields' => 'title, infobox, city, country, postal_code, street, anchorx, anchory, longitude, latitude, icon, link', 'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Location.php', 'iconfile' => \TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('7.5') ? 'EXT:easy_googlemap/Resources/Public/Icons/tx_easygooglemap_domain_model_location.png' : \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_easygooglemap_domain_model_location.png'));
 /**
  * Display some warning messages if this installation is obviously insecure!!
  * These warnings are only displayed to admin users
  *
  * @return void
  */
 public static function displayWarningMessages()
 {
     if ($GLOBALS['BE_USER']->isAdmin()) {
         // Array containing warnings that must be displayed
         $warnings = array();
         // If this file exists and it isn't older than one hour, the Install Tool is enabled
         $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';
         // Cleanup command, if set
         $cmd = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('adminWarning_cmd');
         switch ($cmd) {
             case 'remove_ENABLE_INSTALL_TOOL':
                 if (unlink($enableInstallToolFile)) {
                     unset($enableInstallToolFile);
                 }
                 break;
         }
         // Check if the Install Tool Password is still default: joh316
         if ($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] == md5('joh316')) {
             $url = 'install/index.php?redirect_url=index.php' . urlencode('?TYPO3_INSTALL[type]=about');
             $warnings['install_password'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_password'), '<a href="' . $url . '">', '</a>');
         }
         // Check if there is still a default user 'admin' with password 'password' (MD5sum = 5f4dcc3b5aa765d61d8327deb882cf99)
         $where_clause = 'username='******'TYPO3_DB']->fullQuoteStr('admin', 'be_users') . ' AND password='******'TYPO3_DB']->fullQuoteStr('5f4dcc3b5aa765d61d8327deb882cf99', 'be_users') . self::deleteClause('be_users');
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, username, password', 'be_users', $where_clause);
         if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             $url = 'alt_doc.php?returnUrl=alt_intro.php&edit[be_users][' . $row['uid'] . ']=edit';
             $warnings['backend_admin'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_admin'), '<a href="' . htmlspecialchars($url) . '">', '</a>');
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
         // Check whether the file ENABLE_INSTALL_TOOL contains the string "KEEP_FILE" which permanently unlocks the install tool
         if (is_file($enableInstallToolFile) && trim(file_get_contents($enableInstallToolFile)) === 'KEEP_FILE') {
             $url = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT') . '?adminWarning_cmd=remove_ENABLE_INSTALL_TOOL';
             $warnings['install_enabled'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled'), '<span style="white-space:nowrap;">' . $enableInstallToolFile . '</span>');
             $warnings['install_enabled'] .= ' <a href="' . $url . '">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled_cmd') . '</a>';
         }
         // Check if the encryption key is empty
         if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] == '') {
             $url = 'install/index.php?redirect_url=index.php' . urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');
             $warnings['install_encryption'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_encryption'), '<a href="' . $url . '">', '</a>');
         }
         // Check if parts of fileDenyPattern were removed which is dangerous on Apache
         $defaultParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('|', FILE_DENY_PATTERN_DEFAULT, TRUE);
         $givenParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('|', $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], TRUE);
         $result = array_intersect($defaultParts, $givenParts);
         if ($defaultParts !== $result) {
             $warnings['file_deny_pattern'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_pattern_partsNotPresent'), '<br /><pre>' . htmlspecialchars(FILE_DENY_PATTERN_DEFAULT) . '</pre><br />');
         }
         // Check if fileDenyPattern allows to upload .htaccess files which is dangerous on Apache
         if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT && \TYPO3\CMS\Core\Utility\GeneralUtility::verifyFilenameAgainstDenyPattern('.htaccess')) {
             $warnings['file_deny_htaccess'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_htaccess');
         }
         // Check if there are still updates to perform
         if (!\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version(TYPO3_branch)) {
             $url = 'install/index.php?redirect_url=index.php' . urlencode('?TYPO3_INSTALL[type]=update');
             $warnings['install_update'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_update'), '<a href="' . $url . '">', '</a>');
         }
         // Check if sys_refindex is empty
         $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_refindex');
         $registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Registry');
         $lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate');
         if (!$count && $lastRefIndexUpdate) {
             $url = 'sysext/lowlevel/dbint/index.php?&id=0&SET[function]=refindex';
             $warnings['backend_reference'] = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_reference_index'), '<a href="' . $url . '">', '</a>', self::dateTime($lastRefIndexUpdate));
         }
         // Check for memcached if configured
         $memCacheUse = FALSE;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $table => $conf) {
                 if (is_array($conf)) {
                     foreach ($conf as $key => $value) {
                         if (!is_array($value) && $value === 'TYPO3\\CMS\\Core\\Cache\\Backend\\MemcachedBackend') {
                             $servers = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$table]['options']['servers'];
                             $memCacheUse = TRUE;
                             break;
                         }
                     }
                 }
             }
             if ($memCacheUse) {
                 $failed = array();
                 $defaultPort = ini_get('memcache.default_port');
                 if (function_exists('memcache_connect')) {
                     if (is_array($servers)) {
                         foreach ($servers as $testServer) {
                             $configuredServer = $testServer;
                             if (substr($testServer, 0, 7) == 'unix://') {
                                 $host = $testServer;
                                 $port = 0;
                             } else {
                                 if (substr($testServer, 0, 6) === 'tcp://') {
                                     $testServer = substr($testServer, 6);
                                 }
                                 if (strstr($testServer, ':') !== FALSE) {
                                     list($host, $port) = explode(':', $testServer, 2);
                                 } else {
                                     $host = $testServer;
                                     $port = $defaultPort;
                                 }
                             }
                             $memcache_obj = @memcache_connect($host, $port);
                             if ($memcache_obj != NULL) {
                                 memcache_close($memcache_obj);
                             } else {
                                 $failed[] = $configuredServer;
                             }
                         }
                     }
                 }
                 if (count($failed) > 0) {
                     $warnings['memcached'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.memcache_not_usable') . '<br/>' . implode(', ', $failed);
                 }
             }
         }
         // Hook for additional warnings
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $classRef) {
                 $hookObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
                 if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
                     $hookObj->displayWarningMessages_postProcess($warnings);
                 }
             }
         }
         if (count($warnings)) {
             if (count($warnings) > 1) {
                 $securityWarnings = '<ul><li>' . implode('</li><li>', $warnings) . '</li></ul>';
             } else {
                 $securityWarnings = '<p>' . implode('', $warnings) . '</p>';
             }
             $securityMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $securityWarnings, $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.header'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
             $content = '<div style="margin: 20px 0px;">' . $securityMessage->render() . '</div>';
             unset($warnings);
             return $content;
         }
     }
     return '<p>&nbsp;</p>';
 }