/** * * @param integer $uid */ public function __construct($key) { $conf = tx_templavoila_datastructureRepository::getStaticDatastructureConfiguration(); if (!isset($conf[$key])) { throw new InvalidArgumentException('Argument was supposed to be an existing datastructure', 1283192644); } $this->filename = $conf[$key]['path']; $this->setLabel($conf[$key]['title']); $this->setScope($conf[$key]['scope']); // path relative to typo3 maindir $this->setIcon('../' . $conf[$key]['icon']); }
/** * * @return boolean */ public static function getStaticDatastructureConfiguration() { $config = array(); if (!self::$staticDsInitComplete) { $extConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); if ($extConfig['staticDS.']['enable']) { tx_templavoila_staticds_tools::readStaticDsFilesIntoArray($extConfig); } self::$staticDsInitComplete = TRUE; } if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { $config = $GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures']; } if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['templavoila']['staticDataStructures'])) { $config = array_merge($config, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['templavoila']['staticDataStructures']); } $finalConfig = array(); foreach ($config as $cfg) { $key = md5($cfg['path'] . $cfg['title'] . $cfg['scope']); $finalConfig[$key] = $cfg; } return array_values($finalConfig); }