/**
  * Returns sub array of settings for given array namespace
  * (e.g. key1.key2.key3 returns settings['key1']['key2']['key3'])
  *
  * If no key is given, whole settings array is returned.
  *
  * If key does not exist, empty array is returned.
  *
  * @param string $key Key of settings array to be returned
  * @return mixed
  */
 public function getSettings($key = '')
 {
     if ($key != '') {
         return Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->settings, $key);
     } else {
         return $this->settings;
     }
 }
 protected function getSelectableThemes()
 {
     $configurationManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     /** @var $configurationManager \TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager */
     $settings = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'Yag', 'pi1');
     $themes = \Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($settings, 'themes');
     $selectableThemes = array();
     foreach ($themes as $themeIdentifier => $theme) {
         $themeTitle = array_key_exists('title', $theme) ? $theme['title'] : $themeIdentifier;
         $selectableThemes[$themeIdentifier] = $themeTitle;
     }
     return $selectableThemes;
 }
Example #3
0
 /**
  *
  * @param null $key settings key
  * @return array
  */
 public function getJSCompliantSettings($key = NULL)
 {
     $settings = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->settings, $key);
     return $this->convertToJSCompliantSettings($settings);
 }
 /** @test */
 public function extractingNamespaceWithEmptyNamespaceReturnsWholeArray()
 {
     $extractedValue = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->varArray, '');
     $this->assertEquals($extractedValue, $this->varArray, 'The method should return teh complete var array');
 }
Example #5
0
 /**
  * Get the TCA settings by namespace
  *
  * @param $nameSpace
  * @param null $table
  * @return array
  */
 public function getSettingsByNamespace($nameSpace, $table = null)
 {
     if ($table) {
         $this->setTable($table);
     }
     $settings = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($GLOBALS['TCA'][$this->table], $nameSpace);
     return $settings;
 }
 /**
  * Initializes TS rbac service (invoked from objectManager)
  */
 public function initializeObject()
 {
     $fullTypoScript = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService')->convertTypoScriptArrayToPlainArray($this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT));
     $this->typoScriptRbacSettings = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($fullTypoScript, 'plugin.tx_ptextbase.settings.rbac');
     $this->initGroupsToObjectAndActionsArray();
 }
 /**
  * Returns data from session for given namespace
  *
  * @param string $objectNamespace
  * @return array
  */
 public function getSessionDataByNamespace($objectNamespace)
 {
     return Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->sessionData, $objectNamespace);
 }
 /**
  * @return boolean
  */
 protected function getRenderTyposcriptFromConfiguration()
 {
     $nameSpace = implode('.', array('TYPO3_CONF_VARS.EXTCONF.pt_extbase.ajaxDispatcher.apiConfiguration', $this->extensionName, $this->controllerName, 'renderTyposcript'));
     return Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($GLOBALS, $nameSpace);
 }
 /**
  * Extracts merged GP vars for a given namespace. Merges Post vars over Get vars
  *
  * @param string $namespace
  * @return array Merged get and post vars for given namespace
  */
 public function extractPgVarsByNamespace($namespace)
 {
     return Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->getMergedPgVars(), $namespace);
 }
 /**
  * @param string $exportIdentifier
  * @return string
  * @throws Exception
  */
 public function downloadAction($exportIdentifier)
 {
     $exportSettingsPath = $this->extlistTypoScriptSettingsPath . '.export.exportConfigs.' . $exportIdentifier;
     $exportSettings = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->settings, $exportSettingsPath);
     if (!is_array($exportSettings) || empty($exportSettings)) {
         throw new Exception('No export settings found within the path ' . $exportSettingsPath, 1331644291);
     }
     $exportConfig = new Tx_PtExtlist_Domain_Configuration_Export_ExportConfig($this->configurationBuilder, $exportSettings);
     if (array_key_exists('exportListSettingsPath', $exportSettings)) {
         $exportListSettings = Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->settings, $exportSettings['exportListSettingsPath']);
     } else {
         $exportListSettings = $this->configurationBuilder->getSettings();
     }
     $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration($exportListSettings, $this->listIdentifier, false);
     $list = $extListContext->getList(true);
     $view = $this->objectManager->get($exportConfig->getViewClassName());
     $view->setConfigurationBuilder($extListContext->getConfigurationBuilder());
     $view->setExportConfiguration($exportConfig);
     $view->assign('listHeader', $list->getListHeader());
     $view->assign('listCaptions', $list->getRenderedListHeader());
     $view->assign('listData', $list->getRenderedListData());
     $view->assign('aggregateRows', $list->getRenderedAggregateListData());
     return $view->render();
 }