本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ArrayUtility类的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtility类的具体用法?PHP ArrayUtility怎么用?PHP ArrayUtility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArrayUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeAction
/**
* 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
}
示例2: render
/**
* Download a file
*
* @param string $file Path to the file
* @param array $configuration configuration used to render the filelink cObject
* @param boolean $hideError define if an error should be displayed if file not found
* @param string $class optional class
* @param string $target target
* @param string $alt alt text
* @param string $title title text
* @param integer $secure news uid
* @return string
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
*/
public function render($file, $configuration = array(), $hideError = FALSE, $class = '', $target = '', $alt = '', $title = '', $secure = 0)
{
if (!is_file($file)) {
$errorMessage = sprintf('Given file "%s" for %s is not valid', htmlspecialchars($file), get_class());
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog($errorMessage, 'moox_news', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING);
if (!$hideError) {
throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException('Given file is not a valid file: ' . htmlspecialchars($file));
}
}
$cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj');
$fileInformation = pathinfo($file);
$fileInformation['file'] = $file;
$fileInformation['size'] = filesize($file);
$cObj->data = $fileInformation;
// set a basic configuration for cObj->filelink
$tsConfiguration = array('path' => $fileInformation['dirname'] . '/', 'ATagParams' => 'class="download-link basic-class ' . strtolower($fileInformation['extension']) . (!empty($class) ? ' ' . $class : '') . '"', 'labelStdWrap.' => array('cObject.' => array('value' => $this->renderChildren())));
// Fallback if no configuration given
if (!is_array($configuration)) {
$configuration = array('labelStdWrap.' => array('cObject' => 'TEXT'));
} else {
/** @var $typoscriptService \TYPO3\CMS\Extbase\Service\TypoScriptService */
$typoscriptService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
$configuration = $typoscriptService->convertPlainArrayToTypoScriptArray($configuration);
}
// merge default configuration with optional configuration
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($tsConfiguration, $configuration);
if (!empty($target)) {
$tsConfiguration['target'] = $target;
}
if (!empty($alt)) {
$tsConfiguration['altText'] = $alt;
}
if (!empty($title)) {
$tsConfiguration['titleText'] = $title;
}
$link = $cObj->filelink($fileInformation['basename'], $tsConfiguration);
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['moox_news']);
$securityExcludedFileTypes = array();
if ($extConf['securityExcludedFileTypes'] != "") {
$securityExcludedFileTypes = explode(",", $extConf['securityExcludedFileTypes']);
}
$securityFileLocators = array();
if ($extConf['securityFileLocators'] != "") {
$securityFileLocators = explode(",", $extConf['securityFileLocators']);
}
if ($extConf['securityUrlIndicator'] != "") {
$securityUrlIndicator = $extConf['securityUrlIndicator'];
} else {
$securityUrlIndicator = "mxsecured";
}
if ($secure > 0 && !in_array($fileInformation['extension'], $securityExcludedFileTypes)) {
foreach ($securityFileLocators as $securityFileLocator) {
$dividerPos = strpos($link, $securityFileLocator);
if ($dividerPos !== FALSE) {
$link = str_replace($securityFileLocator, $securityFileLocator . $securityUrlIndicator . '/' . base_convert($secure + 999999, 10, 21) . '/' . $GLOBALS["TSFE"]->id . '/', $link);
}
}
}
return $link;
}
示例3: cObjGetSingleExt
/**
* Renders the application defined cObject FORM
* which overrides the TYPO3 default cObject FORM
*
* Convert FORM to COA_INT - COA_INT.10 = FORM_INT
* If FORM_INT is also dedected by the ContentObjectRenderer, and now
* the Extbaseplugin "Form" is initalized. At this time the
* controller "Frontend" action "execute" do the rest.
*
* @param string $typoScriptObjectName Name of the object
* @param array $typoScript TS configuration for this cObject
* @param string $typoScriptKey A string label used for the internal debugging tracking.
* @param ContentObjectRenderer $contentObject reference
* @return string HTML output
*/
public function cObjGetSingleExt($typoScriptObjectName, array $typoScript, $typoScriptKey, ContentObjectRenderer $contentObject)
{
$content = '';
if ($typoScriptObjectName === 'FORM' && !empty($typoScript['useDefaultContentObject']) && ExtensionManagementUtility::isLoaded('compatibility6')) {
$content = $contentObject->getContentObject($typoScriptObjectName)->render($typoScript);
} elseif ($typoScriptObjectName === 'FORM') {
$mergedTypoScript = null;
if ($contentObject->data['CType'] === 'mailform') {
$bodytext = $contentObject->data['bodytext'];
/** @var $typoScriptParser TypoScriptParser */
$typoScriptParser = GeneralUtility::makeInstance(TypoScriptParser::class);
$typoScriptParser->parse($bodytext);
$mergedTypoScript = (array) $typoScriptParser->setup;
ArrayUtility::mergeRecursiveWithOverrule($mergedTypoScript, $typoScript);
// Disables content elements since TypoScript is handled that could contain insecure settings:
$mergedTypoScript[Configuration::DISABLE_CONTENT_ELEMENT_RENDERING] = true;
}
$newTypoScript = array('10' => 'FORM_INT', '10.' => is_array($mergedTypoScript) ? $mergedTypoScript : $typoScript);
$content = $contentObject->cObjGetSingle('COA_INT', $newTypoScript);
// Only apply stdWrap to TypoScript that was NOT created by the wizard:
if (isset($typoScript['stdWrap.'])) {
$content = $contentObject->stdWrap($content, $typoScript['stdWrap.']);
}
} elseif ($typoScriptObjectName === 'FORM_INT') {
$extbase = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Core\Bootstrap::class);
$content = $extbase->run('', array('pluginName' => 'Form', 'extensionName' => 'Form', 'vendorName' => 'TYPO3\\CMS', 'controller' => 'Frontend', 'action' => 'show', 'settings' => array('typoscript' => $typoScript), 'persistence' => array(), 'view' => array()));
}
return $content;
}
示例4: render
/**
* @return mixed
*/
public function render()
{
// Get page via pageUid argument or current id
$pageUid = intval($this->arguments['pageUid']);
if (0 === $pageUid) {
$pageUid = $GLOBALS['TSFE']->id;
}
$page = $this->pageSelect->getPage($pageUid);
// Add the page overlay
$languageUid = intval($GLOBALS['TSFE']->sys_language_uid);
if (0 !== $languageUid) {
$pageOverlay = $this->pageSelect->getPageOverlay($pageUid, $languageUid);
if (TRUE === is_array($pageOverlay)) {
if (TRUE === method_exists('TYPO3\\CMS\\Core\\Utility\\ArrayUtility', 'mergeRecursiveWithOverrule')) {
ArrayUtility::mergeRecursiveWithOverrule($page, $pageOverlay, FALSE, FALSE);
} else {
$page = GeneralUtility::array_merge_recursive_overrule($page, $pageOverlay, FALSE, FALSE);
}
}
}
$content = NULL;
// Check if field should be returned or assigned
$field = $this->arguments['field'];
if (TRUE === empty($field)) {
$content = $page;
} elseif (TRUE === isset($page[$field])) {
$content = $page[$field];
}
return $this->renderChildrenWithVariableOrReturnInput($content);
}
示例5: initializeAction
/**
* 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
/** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */
$configurationUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility');
$extensionConfiguration = $configurationUtility->getCurrentConfiguration('themes');
#$extensionConfiguration['categoriesToShow'] = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']);
#$extensionConfiguration['constantsToHide'] = GeneralUtility::trimExplode(',', $extensionConfiguration['constantsToHide']);
// mod.tx_themes.constantCategoriesToShow.value
$externalConstantCategoriesToShow = $this->getBackendUser()->getTSConfig('mod.tx_themes.constantCategoriesToShow', BackendUtility::getPagesTSconfig($this->id));
if ($externalConstantCategoriesToShow['value']) {
$this->externalConfig['constantCategoriesToShow'] = GeneralUtility::trimExplode(',', $externalConstantCategoriesToShow['value']);
$categoriesToShow = GeneralUtility::trimExplode(',', $extensionConfiguration['categoriesToShow']['value']);
ArrayUtility::mergeRecursiveWithOverrule($categoriesToShow, $this->externalConfig['constantCategoriesToShow']);
} else {
$this->externalConfig['constantCategoriesToShow'] = array();
}
// mod.tx_themes.constantsToHide.value
$externalConstantsToHide = $this->getBackendUser()->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 = $categoriesToShow;
$this->deniedFields = $extensionConfiguration['constantsToHide'];
// initialize normally used values
}
示例6: createJavaScriptLanguageLabels
/**
* Add an own language object with needed labels
*
* @param array $resultArray
* @return array
*/
protected function createJavaScriptLanguageLabels(array $resultArray)
{
/** @var $languageFactory LocalizationFactory */
$languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
$language = $GLOBALS['LANG']->lang;
$localizationArray = $languageFactory->getParsedData('EXT:document_node_type/Resources/Private/Language/locallang_form.xlf', $language, 'utf-8', 1);
if (is_array($localizationArray) && !empty($localizationArray)) {
if (!empty($localizationArray[$language])) {
$xlfLabelArray = $localizationArray['default'];
ArrayUtility::mergeRecursiveWithOverrule($xlfLabelArray, $localizationArray[$language], true, false);
} else {
$xlfLabelArray = $localizationArray['default'];
}
} else {
$xlfLabelArray = [];
}
$labelArray = [];
foreach ($xlfLabelArray as $key => $value) {
if (isset($value[0]['target'])) {
$labelArray[$key] = $value[0]['target'];
} else {
$labelArray[$key] = '';
}
}
$javaScriptString = 'var BootstrapSwitchElement = BootstrapSwitchElement || {};' . LF;
$javaScriptString .= 'BootstrapSwitchElement.lang = ' . json_encode($labelArray) . LF;
$resultArray['additionalJavaScriptPost'][] = $javaScriptString;
return $resultArray;
}
示例7: initializeAction
/**
* @return void
*/
public function initializeAction()
{
$this->objects = $this->widgetConfiguration['objects'];
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->configuration, $this->widgetConfiguration['configuration'], FALSE);
$this->numberOfObjects = count($this->objects);
$this->numberOfPages = ceil($this->numberOfObjects / (int) $this->configuration['itemsPerPage']);
}
示例8: updateSchema
/**
* Perform necessary database schema migrations
*
* @param SchemaUpdateType[] $schemaUpdateTypes List of permitted schema update types
* @return SchemaUpdateResult Result of the schema update
*/
public function updateSchema(array $schemaUpdateTypes)
{
$expectedSchema = $this->expectedSchemaService->getExpectedDatabaseSchema();
$currentSchema = $this->schemaMigrationService->getFieldDefinitions_database();
$addCreateChange = $this->schemaMigrationService->getDatabaseExtra($expectedSchema, $currentSchema);
$dropRename = $this->schemaMigrationService->getDatabaseExtra($currentSchema, $expectedSchema);
$updateStatements = array();
ArrayUtility::mergeRecursiveWithOverrule($updateStatements, $this->schemaMigrationService->getUpdateSuggestions($addCreateChange));
ArrayUtility::mergeRecursiveWithOverrule($updateStatements, $this->schemaMigrationService->getUpdateSuggestions($dropRename, 'remove'));
$updateResult = new SchemaUpdateResult();
foreach ($schemaUpdateTypes as $schemaUpdateType) {
$statementTypes = $this->getStatementTypes($schemaUpdateType);
foreach ($statementTypes as $statementType) {
if (isset($updateStatements[$statementType])) {
$statements = $updateStatements[$statementType];
$result = $this->schemaMigrationService->performUpdateQueries($statements, array_combine(array_keys($statements), array_fill(0, count($statements), TRUE)));
if ($result === TRUE) {
$updateResult->addPerformedUpdates($schemaUpdateType, count($statements));
} elseif (is_array($result)) {
$updateResult->addErrors($schemaUpdateType, $result);
}
}
}
}
return $updateResult;
}
示例9: setOptions
/**
* Set the options for this object
*
* @param array $parameters Configuration array
* @return void
*/
protected function setOptions(array $parameters)
{
if (is_array($parameters)) {
$keys = ArrayUtility::filterAndSortByNumericKeys($parameters);
foreach ($keys as $key) {
$class = $parameters[$key];
if ((int) $key && strpos($key, '.') === false) {
if (isset($parameters[$key . '.']) && $class === 'CHECKBOX') {
$childElementArguments = $parameters[$key . '.'];
if (isset($childElementArguments['checked'])) {
$childElementArguments['attributes']['selected'] = 'selected';
unset($childElementArguments['checked']);
}
if (isset($childElementArguments['value'])) {
$childElementArguments['attributes']['value'] = $childElementArguments['value'];
unset($childElementArguments['value']);
}
if (isset($childElementArguments['label.'])) {
$childElementArguments['text'] = $childElementArguments['label.']['value'];
unset($childElementArguments['label.']);
}
$this->configuration['options'][] = $childElementArguments;
}
}
}
}
}
示例10: process
/**
* The main method called by the controller
*
* Iterates over the configured post processors and calls them with their
* own settings
*
* @return string HTML messages from the called processors
*/
public function process()
{
$html = '';
if (is_array($this->postProcessorTypoScript)) {
$keys = ArrayUtility::filterAndSortByNumericKeys($this->postProcessorTypoScript);
foreach ($keys as $key) {
if (!(int) $key || strpos($key, '.') !== false) {
continue;
}
$className = false;
$processorName = $this->postProcessorTypoScript[$key];
$processorArguments = array();
if (isset($this->postProcessorTypoScript[$key . '.'])) {
$processorArguments = $this->postProcessorTypoScript[$key . '.'];
}
if (class_exists($processorName, true)) {
$className = $processorName;
} else {
$classNameExpanded = 'TYPO3\\CMS\\Form\\PostProcess\\' . ucfirst(strtolower($processorName)) . 'PostProcessor';
if (class_exists($classNameExpanded, true)) {
$className = $classNameExpanded;
}
}
if ($className !== false) {
$processor = $this->objectManager->get($className, $this->form, $processorArguments);
if ($processor instanceof PostProcessorInterface) {
$processor->setControllerContext($this->controllerContext);
$html .= $processor->process();
}
}
}
}
return $html;
}
示例11: addData
/**
* Inline parent TCA may override some TCA of children.
*
* @param array $result
* @return array
*/
public function addData(array $result)
{
// Replace types definition of inline child if foreign_types is defined in inlineParentConfig
if (isset($result['inlineParentConfig']['foreign_types'])) {
foreach ($result['inlineParentConfig']['foreign_types'] as $type => $config) {
$result['processedTca']['types'][$type] = $config;
}
}
// Override config section of foreign_selector field pointer if given
if (isset($result['inlineParentConfig']['foreign_selector']) && is_string($result['inlineParentConfig']['foreign_selector']) && isset($result['inlineParentConfig']['foreign_selector_fieldTcaOverride']) && is_array($result['inlineParentConfig']['foreign_selector_fieldTcaOverride']) && isset($result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']]) && is_array($result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']])) {
ArrayUtility::mergeRecursiveWithOverrule($result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']], $result['inlineParentConfig']['foreign_selector_fieldTcaOverride']);
}
// Set default values for (new) child if foreign_record_defaults is defined in inlineParentConfig
if (isset($result['inlineParentConfig']['foreign_record_defaults']) && is_array($result['inlineParentConfig']['foreign_record_defaults'])) {
$foreignTableConfig = $GLOBALS['TCA'][$result['inlineParentConfig']['foreign_table']];
// The following system relevant fields can't be set by foreign_record_defaults
$notSetableFields = ['uid', 'pid', 't3ver_oid', 't3ver_id', 't3ver_label', 't3ver_wsid', 't3ver_state', 't3ver_stage', 't3ver_count', 't3ver_tstamp', 't3ver_move_id'];
// Optional configuration fields used in child table. If set, they must not be overridden, either
$configurationKeysForNotSettableFields = ['crdate', 'cruser_id', 'delete', 'origUid', 'transOrigDiffSourceField', 'transOrigPointerField', 'tstamp'];
foreach ($configurationKeysForNotSettableFields as $configurationKey) {
if (isset($foreignTableConfig['ctrl'][$configurationKey])) {
$notSetableFields[] = $foreignTableConfig['ctrl'][$configurationKey];
}
}
foreach ($result['inlineParentConfig']['foreign_record_defaults'] as $fieldName => $defaultValue) {
if (isset($foreignTableConfig['columns'][$fieldName]) && !in_array($fieldName, $notSetableFields, true)) {
$result['processedTca']['columns'][$fieldName]['config']['default'] = $defaultValue;
}
}
}
return $result;
}
示例12: make
/**
* Generates a frameset based on input configuration in a TypoScript array.
*
* @param array $setup The TypoScript properties of the PAGE object property "frameSet.". See link.
* @return string A <frameset> tag.
* @see \TYPO3\CMS\Frontend\Page\PageGenerator::renderContentWithHeader()
*/
public function make($setup)
{
$content = '';
if (is_array($setup)) {
$sKeyArray = ArrayUtility::filterAndSortByNumericKeys($setup);
foreach ($sKeyArray as $theKey) {
$theValue = $setup[$theKey];
if ((int) $theKey && ($conf = $setup[$theKey . '.'])) {
switch ($theValue) {
case 'FRAME':
$typeNum = (int) $GLOBALS['TSFE']->tmpl->setup[$conf['obj'] . '.']['typeNum'];
if (!$conf['src'] && !$typeNum) {
$typeNum = -1;
}
$content .= '<frame' . $this->frameParams($conf, $typeNum) . ' />' . LF;
break;
case 'FRAMESET':
$frameset = GeneralUtility::makeInstance(__CLASS__);
$content .= $frameset->make($conf) . LF;
break;
}
}
}
return '<frameset' . $this->framesetParams($setup) . '>' . LF . $content . '</frameset>';
}
return '';
}
示例13: initializeAction
/**
* @return void
*/
public function initializeAction()
{
$this->objects = $this->widgetConfiguration['objects'];
ArrayUtility::mergeRecursiveWithOverrule($this->configuration, $this->widgetConfiguration['configuration'], FALSE);
$this->numberOfPages = ceil(count($this->objects) / (int) $this->configuration['itemsPerPage']);
$this->maximumNumberOfLinks = (int) $this->configuration['maximumNumberOfLinks'];
}
示例14: addData
/**
* Merge type specific page TS to pageTsConfig
*
* @param array $result
* @return array
*/
public function addData(array $result)
{
$mergedTsConfig = $result['pageTsConfig'];
if (empty($result['pageTsConfig']['TCEFORM.']) || !is_array($result['pageTsConfig']['TCEFORM.'])) {
$result['pageTsConfig'] = $mergedTsConfig;
return $result;
}
$mergedTsConfig = $result['pageTsConfig'];
$type = $result['recordTypeValue'];
$table = $result['tableName'];
// Merge TCEFORM.[table name].[field].types.[type] over TCEFORM.[table name].[field]
if (!empty($result['pageTsConfig']['TCEFORM.'][$table . '.']) && is_array($result['pageTsConfig']['TCEFORM.'][$table . '.'])) {
foreach ($result['pageTsConfig']['TCEFORM.'][$table . '.'] as $fieldNameWithDot => $fullFieldConfiguration) {
$newFieldConfiguration = $fullFieldConfiguration;
if (!empty($fullFieldConfiguration['types.']) && is_array($fullFieldConfiguration['types.'])) {
$typeSpecificConfiguration = $newFieldConfiguration['types.'];
unset($newFieldConfiguration['types.']);
if (!empty($typeSpecificConfiguration[$type . '.']) && is_array($typeSpecificConfiguration[$type . '.'])) {
ArrayUtility::mergeRecursiveWithOverrule($newFieldConfiguration, $typeSpecificConfiguration[$type . '.']);
}
}
$mergedTsConfig['TCEFORM.'][$table . '.'][$fieldNameWithDot] = $newFieldConfiguration;
}
}
$result['pageTsConfig'] = $mergedTsConfig;
return $result;
}
示例15: initialize
/**
* Initializes the languages.
*
* @return void
*/
public static function initialize()
{
/** @var $instance Locales */
$instance = GeneralUtility::makeInstance(Locales::class);
$instance->isoMapping = array_flip($instance->isoReverseMapping);
// Allow user-defined locales
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] as $locale => $name) {
if (!isset($instance->languages[$locale])) {
$instance->languages[$locale] = $name;
}
}
}
// Initializes the locale dependencies with TYPO3 supported locales
$instance->localeDependencies = array();
foreach ($instance->languages as $locale => $name) {
if (strlen($locale) === 5) {
$instance->localeDependencies[$locale] = array(substr($locale, 0, 2));
}
}
// Merge user-provided locale dependencies
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'])) {
ArrayUtility::mergeRecursiveWithOverrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']);
}
}