Index: class.tx_templavoila_extdeveval.php =================================================================== --- class.tx_templavoila_extdeveval.php (revision 29083) +++ class.tx_templavoila_extdeveval.php (working copy) @@ -151,22 +151,27 @@ * @return array */ function getDataStructures() { + $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); + $staticDS = ($extConf['staticDS.']['enable']); // Select all static Data Structures and add to array: - if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { - foreach($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'] as $staticDS) { - $staticDS['_STATIC'] = 1; - $fileReference = t3lib_div::getFileAbsFileName($staticDS['path']); - if (@is_file($fileReference)) { - $staticDS['_languageMode'] = $this->DSlanguageMode(t3lib_div::getUrl($fileReference)); - } else { - $staticDS['_languageMode'] = 'ERROR: File not found'; + if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { + foreach($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'] as $staticDataStructure) { + if ($staticDS || (!$staticDS && $staticDS['scope'] != 1 && $staticDS['scope'] != 2)) { + $staticDataStructure['_STATIC'] = 1; + $fileReference = t3lib_div::getFileAbsFileName($staticDataStructure['path']); + if (@is_file($fileReference)) { + $staticDataStructure['_languageMode'] = $this->DSlanguageMode(t3lib_div::getUrl($fileReference)); + } else { + $staticDataStructure['_languageMode'] = 'ERROR: File not found'; + } + if ($staticDataStructure['_languageMode']!='Disabled') { + $dsRecords[$staticDataStructure['scope']][] = $staticDataStructure; + } } - if ($row['_languageMode']!='Disabled') { - $dsRecords[$staticDS['scope']][] = $staticDS; - } } - } else { + } + if (!$staticDS) { // Select all Data Structures in the PID and put into an array: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', Index: mod1/class.tx_templavoila_mod1_wizards.php =================================================================== --- mod1/class.tx_templavoila_mod1_wizards.php (revision 29083) +++ mod1/class.tx_templavoila_mod1_wizards.php (working copy) @@ -262,7 +262,7 @@ $storageFolderPID = $this->apiObj->getStorageFolderPid($positionPid); $tmplHTML = array(); - $staticDS = (count($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])); + $staticDS = $this->pObj->staticDS; // look for TCEFORM.pages.tx_templavoila_ds.removeItems / TCEFORM.pages.tx_templavoila_to.removeItems $disallowedPageTemplateItems = $this->getDisallowedTSconfigItemsByFieldName ($positionPid, 'tx_templavoila_ds'); Index: mod1/db_new_content_el.php =================================================================== --- mod1/db_new_content_el.php (revision 29083) +++ mod1/db_new_content_el.php (working copy) @@ -94,8 +94,8 @@ // Internal, static: var $doc; // Internal backend template object + protected $extConf; // Templavoila extension configuration - // Internal, dynamic: var $include_once = array(); // Includes a list of files to include between init() and main() - see init() var $content; // Used to accumulate the content of the module. @@ -115,6 +115,8 @@ $this->include_once = array_merge($this->include_once,$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']); } + $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); + // Setting internal vars: $this->id = intval(t3lib_div::_GP('id')); $this->parentRecord = t3lib_div::_GP('parentRecord'); @@ -406,15 +408,18 @@ $positionPid = $this->id; $dataStructureRecords = array(); $storageFolderPID = $this->apiObj->getStorageFolderPid($positionPid); + $staticDS = ($this->extConf['staticDS.']['enable']); - if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { // Fetch static data structures which are stored in XML files: foreach($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'] as $staticDataStructureArr) { - $staticDataStructureArr['_STATIC'] = TRUE; - $dataStructureRecords[$staticDataStructureArr['path']] = $staticDataStructureArr; + if ($staticDS || (!$staticDS && $staticDS['scope'] != 1 && $staticDS['scope'] != 2)) { + $staticDataStructureArr['_STATIC'] = TRUE; + $dataStructureRecords[$staticDataStructureArr['path']] = $staticDataStructureArr; + } } - } else { + } + if (!$staticDS) { // Fetch data structures stored in the database: $addWhere = $this->buildRecordWhere('tx_templavoila_datastructure'); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_templavoila_datastructure', 'pid=' . intval($storageFolderPID) . ' AND scope=2' . $addWhere . t3lib_BEfunc::deleteClause('tx_templavoila_datastructure') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_datastructure')); Index: mod2/index.php =================================================================== --- mod2/index.php (revision 29085) +++ mod2/index.php (working copy) @@ -114,13 +114,18 @@ var $tFileList=array(); var $errorsWarnings=array(); + var $extConf; // holds the extconf configuration + var $staticDS = FALSE; // Boolean; if true DS records are file based + var $cm1Link = '../cm1/index.php'; - function init() { - parent::init(); - $this->templatesDir = $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'templates/'; - } + function init() { + parent::init(); + $this->templatesDir = $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'templates/'; + $this->extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['templavoila']); + $this->staticDS = ($this->extConf['staticDS.']['enable']); + } /** * Preparing menu content @@ -349,14 +354,18 @@ global $LANG; + $dsRecords = array(); // Select all static Data Structures and add to array: - if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { + if (is_array($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'])) { foreach($GLOBALS['TBE_MODULES_EXT']['xMOD_tx_templavoila_cm1']['staticDataStructures'] as $staticDS) { - $staticDS['_STATIC'] = 1; - $dsRecords[$staticDS['scope']][] = $staticDS; + if ($this->staticDS || (!$this->staticDS && $staticDS['scope'] != 1 && $staticDS['scope'] != 2)) { + $staticDS['_STATIC'] = 1; + $dsRecords[$staticDS['scope']][] = $staticDS; + } } - } else { + } + if (!$this->staticDS) { // Select all Data Structures in the PID and put into an array: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', @@ -365,7 +374,6 @@ '', 'title' ); - $dsRecords = array(); while($res && false !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) { t3lib_BEfunc::workspaceOL('tx_templavoila_datastructure',$row); $dsRecords[$row['scope']][] = $row; @@ -373,6 +381,7 @@ $GLOBALS['TYPO3_DB']->sql_free_result($res); } + // Select all Template Records in PID: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'cruser_id,crdate,tstamp,uid,title, parent, fileref, sys_language_uid, datastructure, rendertype,localprocessing, previewicon,description,fileref_mtime,fileref_md5',