var $ext_function=0; // If set to "1", will link a big button to content element wizard.
var $doEdit=1; // If true, elements will have edit icons (probably this is whethere the user has permission to edit the page content). Set externally.
var $agePrefixes = ' min| hrs| days| yrs'; // Age prefixes for displaying times. May be set externally to localized values.
+ var $externalTables = array(); // Array of tables which is configured to be listed by the Web > Page module in addition to the default tables.
// External, static: Configuration of tt_content element display:
var $tt_contentConfig = Array (
// Load full table definition:
t3lib_div::loadTCA($table);
- // Branch out based on table name:
- // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
- switch($table) {
- case 'pages':
- return $this->getTable_pages($id);
- break;
- case 'tt_content':
- return $this->getTable_tt_content($id);
- break;
- case 'fe_users':
- return $this->getTable_fe_users($id);
- break;
- case 'sys_note':
- return $this->getTable_sys_note($id);
- break;
- case 'tt_board':
- return $this->getTable_tt_board($id);
- break;
- case 'tt_address':
- return $this->getTable_tt_address($id);
- break;
- case 'tt_links':
- return $this->getTable_tt_links($id);
- break;
- case 'tt_guest':
- return $this->getTable_tt_guest($id);
- break;
- case 'tt_news':
- return $this->getTable_tt_news($id);
- break;
- case 'tt_calender':
- return $this->getTable_tt_calender($id);
- break;
- case 'tt_products':
- return $this->getTable_tt_products($id);
- break;
+ if (isset($this->externalTables[$table])) {
+ $fList = $this->externalTables[$table][0]['fList']; // eg. "name;title;email;company,image"
+ $icon = $this->externalTables[$table][0]['icon']; // Boolean,
+
+ // Create listing
+ $out = $this->makeOrdinaryList($table, $id, $fList, $icon);
+ return $out;
+ } else {
+ // Branch out based on table name:
+ // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
+ switch($table) {
+ case 'pages':
+ return $this->getTable_pages($id);
+ break;
+ case 'tt_content':
+ return $this->getTable_tt_content($id);
+ break;
+ case 'fe_users':
+ return $this->getTable_fe_users($id);
+ break;
+ case 'sys_note':
+ return $this->getTable_sys_note($id);
+ break;
+ case 'tt_board':
+ return $this->getTable_tt_board($id);
+ break;
+ case 'tt_address':
+ return $this->getTable_tt_address($id);
+ break;
+ case 'tt_links':
+ return $this->getTable_tt_links($id);
+ break;
+ case 'tt_guest':
+ return $this->getTable_tt_guest($id);
+ break;
+ case 'tt_news':
+ return $this->getTable_tt_news($id);
+ break;
+ case 'tt_calender':
+ return $this->getTable_tt_calender($id);
+ break;
+ case 'tt_products':
+ return $this->getTable_tt_products($id);
+ break;
+ }
}
}
// Initialize:
$this->activeTables=array();
- $theTables=explode(',','tt_content,fe_users,tt_address,tt_links,tt_board,tt_guest,tt_calender,tt_products,tt_news'); // NOTICE: This serves double function: Both being tables names (all) and for most others also being extension keys for the extensions they are related to!
+ $theTables = explode(',','tt_content,fe_users,tt_address,tt_links,tt_board,tt_guest,tt_calender,tt_products,tt_news'); // NOTICE: This serves double function: Both being tables names (all) and for most others also being extension keys for the extensions they are related to!
+
+ // External tables:
+ if (is_array($this->externalTables)) {
+ $theTables = array_unique(array_merge($theTables, array_keys($this->externalTables)));
+ }
// Traverse tables to check:
foreach($theTables as $tName) {
// Check access and whether the proper extensions are loaded:
- if ($GLOBALS['BE_USER']->check('tables_select',$tName) && (t3lib_extMgm::isLoaded($tName)||t3lib_div::inList('fe_users,tt_content',$tName))) {
+ if ($GLOBALS['BE_USER']->check('tables_select',$tName) && (t3lib_extMgm::isLoaded($tName)||t3lib_div::inList('fe_users,tt_content',$tName) || isset($this->externalTables[$tName]))) {
// Make query to count records from page:
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $tName, 'pid='.intval($id).t3lib_BEfunc::deleteClause($tName));
$dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
if (!$dblist->nextThree) $dblist->nextThree = 1;
+ $dblist->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables'];
+
// Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!)
- $h_menu=$dblist->getTableMenu($this->id);
+ $h_menu = $dblist->getTableMenu($this->id);
// Initialize other variables:
$h_func='';
// Load full table definitions:
t3lib_div::loadTCA($table);
- // Creating special conditions for each table:
- switch($table) {
- case 'tt_board':
- $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_board]',$this->MOD_SETTINGS['tt_board'],$this->MOD_MENU['tt_board'],'db_layout.php','');
- break;
- case 'tt_address':
- $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_address]',$this->MOD_SETTINGS['tt_address'],$this->MOD_MENU['tt_address'],'db_layout.php','');
- break;
- case 'tt_links':
- $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_links]',$this->MOD_SETTINGS['tt_links'],$this->MOD_MENU['tt_links'],'db_layout.php','');
- break;
- case 'tt_calender':
- $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_calender]',$this->MOD_SETTINGS['tt_calender'],$this->MOD_MENU['tt_calender'],'db_layout.php','');
- break;
- case 'tt_products':
- $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_products]',$this->MOD_SETTINGS['tt_products'],$this->MOD_MENU['tt_products'],'db_layout.php','');
- break;
- case 'tt_guest':
- case 'tt_news':
- case 'fe_users':
- // Nothing
- break;
- case 'tt_content':
- $q_count = $this->getNumberOfHiddenElements();
- $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,'SET[tt_content_showHidden]',$this->MOD_SETTINGS['tt_content_showHidden'],'db_layout.php','').(!$q_count?$GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE')):$LANG->getLL('hiddenCE').' ('.$q_count.')');
-
- $dblist->tt_contentConfig['showCommands'] = 1; // Boolean: Display up/down arrows and edit icons for tt_content records
- $dblist->tt_contentConfig['showInfo'] = 1; // Boolean: Display info-marks or not
- $dblist->tt_contentConfig['single'] =0; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
-
- // Setting up the tt_content columns to show:
- if (is_array($TCA['tt_content']['columns']['colPos']['config']['items'])) {
- $colList=array();
- foreach($TCA['tt_content']['columns']['colPos']['config']['items'] as $temp) {
- $colList[]=$temp[1];
+ if (!isset($dblist->externalTables[$table])) {
+ // Creating special conditions for each table:
+ switch($table) {
+ case 'tt_board':
+ $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_board]',$this->MOD_SETTINGS['tt_board'],$this->MOD_MENU['tt_board'],'db_layout.php','');
+ break;
+ case 'tt_address':
+ $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_address]',$this->MOD_SETTINGS['tt_address'],$this->MOD_MENU['tt_address'],'db_layout.php','');
+ break;
+ case 'tt_links':
+ $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_links]',$this->MOD_SETTINGS['tt_links'],$this->MOD_MENU['tt_links'],'db_layout.php','');
+ break;
+ case 'tt_calender':
+ $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_calender]',$this->MOD_SETTINGS['tt_calender'],$this->MOD_MENU['tt_calender'],'db_layout.php','');
+ break;
+ case 'tt_products':
+ $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_products]',$this->MOD_SETTINGS['tt_products'],$this->MOD_MENU['tt_products'],'db_layout.php','');
+ break;
+ case 'tt_guest':
+ case 'tt_news':
+ case 'fe_users':
+ // Nothing
+ break;
+ case 'tt_content':
+ $q_count = $this->getNumberOfHiddenElements();
+ $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,'SET[tt_content_showHidden]',$this->MOD_SETTINGS['tt_content_showHidden'],'db_layout.php','').(!$q_count?$GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE')):$LANG->getLL('hiddenCE').' ('.$q_count.')');
+
+ $dblist->tt_contentConfig['showCommands'] = 1; // Boolean: Display up/down arrows and edit icons for tt_content records
+ $dblist->tt_contentConfig['showInfo'] = 1; // Boolean: Display info-marks or not
+ $dblist->tt_contentConfig['single'] = 0; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
+
+ // Setting up the tt_content columns to show:
+ if (is_array($TCA['tt_content']['columns']['colPos']['config']['items'])) {
+ $colList = array();
+ foreach($TCA['tt_content']['columns']['colPos']['config']['items'] as $temp) {
+ $colList[] = $temp[1];
+ }
+ } else { // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
+ $colList = array('1','0','2','3');
+ }
+ if (strcmp($this->colPosList,'')) {
+ $colList = array_intersect(t3lib_div::intExplode(',',$this->colPosList),$colList);
}
- } else { // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
- $colList=array('1','0','2','3');
- }
- if (strcmp($this->colPosList,'')) {
- $colList=array_intersect(t3lib_div::intExplode(',',$this->colPosList),$colList);
- }
- // If only one column found, display the single-column view.
- if (count($colList)==1) {
- $dblist->tt_contentConfig['single'] =1; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
- $dblist->tt_contentConfig['showSingleCol']=current($colList); // The column(s) to show if single mode (under each other)
- }
- $dblist->tt_contentConfig['cols'] = implode(',',$colList); // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
- $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
- $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
-
- // If the function menu is set to "Language":
- if ($this->MOD_SETTINGS['function']==2) {
- $dblist->tt_contentConfig['single'] = 0;
- $dblist->tt_contentConfig['languageMode'] = 1;
- $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
- $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language;
- }
- break;
+ // If only one column found, display the single-column view.
+ if (count($colList)==1) {
+ $dblist->tt_contentConfig['single'] = 1; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
+ $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other)
+ }
+ $dblist->tt_contentConfig['cols'] = implode(',',$colList); // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
+ $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
+ $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
+
+ // If the function menu is set to "Language":
+ if ($this->MOD_SETTINGS['function']==2) {
+ $dblist->tt_contentConfig['single'] = 0;
+ $dblist->tt_contentConfig['languageMode'] = 1;
+ $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
+ $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language;
+ }
+ break;
+ }
+ } else {
+ $h_func = '';
}
// Start the dblist object: