/** * Generates the module content * * @return string HTML content */ function moduleContent() { global $BE_USER, $LANG, $BACK_PATH; require_once PATH_txdam . 'lib/class.tx_dam_config.php'; tx_dam_config::init(true); $config = tx_dam_config::_getConfig(); if (!is_array($config)) { $config = array(); } unset($config['pageUserTSconfig.']); if ($this->pObj->MOD_SETTINGS['tx_dam_tools_config.func'] === 'merged') { $config = $config['mergedTSconfig.']; } $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); $tmpl->tt_track = 0; // Do not log time-performance information $tmpl->fixedLgd = 0; $tmpl->linkObjects = 0; $tmpl->bType = ''; $tmpl->ext_expandAllNotes = 1; $tmpl->ext_noPMicons = 1; $content = ''; $content .= $this->pObj->doc->section($LANG->getLL('tx_dam_tools_config.title'), '', 0, 1); $content .= $this->pObj->doc->spacer(10); $content .= ' <!-- DAM TSconfig Tree: --> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap="nowrap">' . $tmpl->ext_getObjTree($config, '', '') . '</td> </tr> </table>'; $content .= ' <br /><br /><hr /> <h4>Legend:</h4> <ul> <li><strong>mergedTSconfig</strong> Merged configuration fetched from different sources. This is used by the system.</li> <li><strong>definedTSconfig</strong> Configuration set by PHP with tx_dam::config_setValue().</li> <li><strong>userTSconfig</strong> User TSconfig</li> <li><strong>pageTSconfig</strong> Page TSconfig</li> <li><strong>*.setup</strong> <em>setup</em> maps to <em>tx_dam</em> from TSconfig</li> </ul>'; return $content; }
/** * Init dam config values - which means they are fetched from TSConfig * * @param boolean $force Will force the initialization to be done again except definedTSconfig set by config_setValue * @return void */ function config_init($force = false) { require_once PATH_txdam . 'lib/class.tx_dam_config.php'; tx_dam_config::init($force); }
/** * Returns the value/properties of a TS-object as given by $objectString, eg. 'options.dontMountAdminMounts' * Nice (general!) function for returning a part of a TypoScript array! * * @param string $objectString Pointer to an "object" in the TypoScript array, fx. 'options.dontMountAdminMounts' * @param array $config TSconfig array * @return array An array with two keys, "value" and "properties" where "value" is a string with the value of the object string and "properties" is an array with the properties of the object string. */ function _getTSConfigObject($objectString, $config) { $TSConf = array(); $parts = explode('.', $objectString, 2); $key = $parts[0]; if (trim($key)) { if (count($parts) > 1 && trim($parts[1])) { // Go on, get the next level if (is_array($config[$key . '.'])) { $TSConf = tx_dam_config::_getTSConfigObject($parts[1], $config[$key . '.']); } } else { $TSConf['value'] = $config[$key]; $TSConf['properties'] = $config[$key . '.']; } } return $TSConf; }