Project

General

Profile

Feature #15193 » 1822_v2.diff

Administrator Admin, 2010-02-06 15:47

View differences:

typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
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.
var $externalTables = array(); // Array of tables to be listed by the Web > Page module in addition to the default tables.
var $descrTable; // "Pseudo" Description -table name
var $defLangBinding=FALSE; // If set true, the language mode of tt_content elements will be rendered with hard binding between default language content elements and their translations!
......
t3lib_div::loadTCA($table);
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;
return $this->getExternalTables($id, $table);
} 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.
......
}
}
/**
* Renders an external table from page id
*
* @param integer Page id
* @param string name of the table
* @return string HTML for the listing
*/
function getExternalTables($id, $table) {
$type = $GLOBALS['SOBE']->MOD_SETTINGS[$table];
if (!isset($type)) {
$type = 0;
}
$fList = $this->externalTables[$table][$type]['fList']; // eg. "name;title;email;company,image"
// The columns are separeted by comma ','.
// Values separated by semicolon ';' are shown in the same column.
$icon = $this->externalTables[$table][$type]['icon'];
$addWhere = $this->externalTables[$table][$type]['addWhere'];
// Create listing
$out = $this->makeOrdinaryList($table, $id, $fList, $icon, $addWhere);
return $out;
}
/**
* Renders records from the pages table from page id
* (Used to get information about the page tree content by "Web>Info"!)
*
typo3/sysext/cms/layout/db_layout.php (working copy)
var $MOD_MENU=array(); // Menu configuration
var $MOD_SETTINGS=array(); // Module settings (session variable)
var $include_once=array(); // Array, where files to include is accumulated in the init() function
var $externalTables = array(); // Array of tables to be listed by the Web > Page module in addition to the default tables
// Internal, dynamic:
var $content; // Module output accumulation
......
$this->search_levels = t3lib_div::_GP('search_levels');
$this->showLimit = t3lib_div::_GP('showLimit');
$this->returnUrl = t3lib_div::_GP('returnUrl');
$this->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables'];
// Load page info array:
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
......
'showDescriptions' => '',
'disableRTE' => '',
'function' => array(
0 => $LANG->getLL('m_function_0'),
1 => $LANG->getLL('m_function_1'),
0 => $LANG->getLL('m_function_0'),
2 => $LANG->getLL('m_function_2'),
3 => $LANG->getLL('pageInformation')
),
......
)
);
// example settings:
// $TYPO3_CONF_VARS['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
// array ('default' => array(
// 'MENU' => 'LLL:EXT:tx_myext/locallang_db.xml:menuDefault',
// 'fList' => 'title,description,image',
// 'icon' => TRUE),
if (is_array($this->externalTables)) {
foreach ($this->externalTables as $table => $tableSettings) {
// delete the default settings from above
if (is_array($this->MOD_MENU[$table])) {
unset ($this->MOD_MENU[$table]);
}
if (is_array($tableSettings)) {
foreach ($tableSettings as $key => $settings) {
$this->MOD_MENU[$table][$key] = $LANG->sL($settings['MENU']);
}
}
}
}
// First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page. Add these to language selector.
$res = $this->exec_languageQuery($this->id);
while($lrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
......
$dblist->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0;
if (!$dblist->nextThree) $dblist->nextThree = 1;
$dblist->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables'];
$dblist->externalTables = $this->externalTables;
// 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);
......
break;
}
} else {
if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) {
$h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET['.$table.']',$this->MOD_SETTINGS[$table],$this->MOD_MENU[$table],'db_layout.php','');
} else {
$h_func = '';
}
}
// Start the dblist object:
$dblist->itemsLimitSingleTable = 1000;
(3-3/4)