Feature #14458 » 0000624-list_mmTable_titles_v6.diff
t3lib/class.t3lib_befunc.php 20 Dec 2004 20:31:37 -0000 | ||
---|---|---|
* @param string $value is the value of that field from a selected record
|
||
* @param integer $fixed_lgd_chars is the max amount of characters the value may occupy
|
||
* @param boolean $defaultPassthrough flag means that values for columns that has no conversion will just be pass through directly (otherwise cropped to 200 chars or returned as "N/A")
|
||
* @param integer uid of the current record
|
||
* @return string
|
||
*/
|
||
function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0) {
|
||
function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0,$uid=0) {
|
||
global $TCA;
|
||
// Load full TCA for $table
|
||
t3lib_div::loadTCA($table);
|
||
... | ... | |
break;
|
||
case 'select':
|
||
if ($theColConf['MM']) {
|
||
$l='N/A';
|
||
// Display the title of MM related records in lists
|
||
$MMres = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
|
||
$theColConf['foreign_table'].'.'.$TCA[$theColConf['foreign_table']]['ctrl']['label'],
|
||
$table,
|
||
$theColConf['MM'],
|
||
$theColConf['foreign_table'],
|
||
'AND '.$table.'.uid ='.$uid,
|
||
'',$orderBy=$TCA[$theColConf['foreign_table']]['ctrl']['label']
|
||
);
|
||
if ($MMres) {
|
||
while($MMrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMres)) {
|
||
$mmlA[] = $MMrow[$TCA[$theColConf['foreign_table']]['ctrl']['label']];
|
||
}
|
||
if (is_array($mmlA)) {
|
||
$l=implode(', ',$mmlA);
|
||
} else {
|
||
$l = 'N/A';
|
||
}
|
||
}
|
||
} else {
|
||
$l=t3lib_BEfunc::getLabelFromItemlist($table,$col,$value);
|
||
$l=$GLOBALS['LANG']->sL($l);
|
||
... | ... | |
* @param string Field name
|
||
* @param string Field value
|
||
* @param integer $fixed_lgd_chars is the max amount of characters the value may occupy
|
||
* @param integer uid of the current record
|
||
* @return string
|
||
* @see getProcessedValue()
|
||
*/
|
||
function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0) {
|
||
function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0,$uid=0) {
|
||
global $TCA;
|
||
$fVnew = t3lib_BEfunc::getProcessedValue($table,$fN,$fV,$fixed_lgd_chars);
|
||
$fVnew = t3lib_BEfunc::getProcessedValue($table,$fN,$fV,$fixed_lgd_chars,0,$uid);
|
||
if (!isset($fVnew)) {
|
||
if (is_array($TCA[$table])) {
|
||
if ($fN==$TCA[$table]['ctrl']['tstamp'] || $fN==$TCA[$table]['ctrl']['crdate']) {
|
typo3/class.db_list_extra.inc 20 Dec 2004 20:31:38 -0000 | ||
---|---|---|
$theData = Array();
|
||
foreach($this->fieldArray as $fCol) {
|
||
if ($fCol==$titleCol) {
|
||
$recTitle = t3lib_BEfunc::getProcessedValueExtra($table,$fCol,$row[$fCol],100,$row['uid']);
|
||
$theData[$fCol] = $this->linkWrapItems($table,$row['uid'],$recTitle,$row);
|
||
} elseif ($fCol=='pid') {
|
||
$theData[$fCol]=$row[$fCol];
|
||
... | ... | |
} elseif ($fCol=='_LOCALIZATION_b') {
|
||
// Do nothing, has been done above.
|
||
} else {
|
||
$theData[$fCol]=htmlspecialchars(t3lib_BEfunc::getProcessedValueExtra($table,$fCol,$row[$fCol],100));
|
||
$theData[$fCol]=htmlspecialchars(t3lib_BEfunc::getProcessedValueExtra($table,$fCol,$row[$fCol],100,$row['uid']));
|
||
}
|
||
}
|
||
typo3/sysext/cms/layout/class.tx_cms_layout.php 20 Dec 2004 20:31:38 -0000 | ||
---|---|---|
if ($fieldName==$thumbsCol) { // If the column is a thumbnail column:
|
||
$out[$fieldName] = $this->thumbCode($row,$table,$fieldName);
|
||
} else { // ... otherwise just render the output:
|
||
$out[$fieldName] = nl2br(htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fieldName,$row[$fieldName]),250))));
|
||
$out[$fieldName] = nl2br(htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fieldName,$row[$fieldName],0,0,$row['uid']),250))));
|
||
}
|
||
} else { // Each field is separated by <br /> and shown in the same cell (If not a TCA field, then explode the field name with ";" and check each value there as a TCA configured field)
|
||
$theFields = explode(';',$fieldName);
|
||
... | ... | |
if ($TCA[$table]['columns'][$fName2]) {
|
||
$out[$fieldName].= '<b>'.$GLOBALS['LANG']->sL($TCA[$table]['columns'][$fName2]['label'],1).'</b>'.
|
||
' '.
|
||
htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fName2,$row[$fName2]),25)).
|
||
htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fName2,$row[$fName2],0,0,$row['uid']),25)).
|
||
'<br />';
|
||
}
|
||
}
|