Project

General

Profile

Bug #23757 ยป 16024_tca_itemlabel_multiple_values.patch

Administrator Admin, 2010-10-16 23:40

View differences:

t3lib/class.t3lib_positionmap.php (Arbeitskopie)
// Traverse the columns here:
foreach($colPosArray as $kk => $vv) {
$row1.='<td align="center" width="'.round(100/$count).'%"><span class="uppercase"><strong>'.
$this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','colPos',$vv),1),$vv).
$this->wrapColumnHeader(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $vv), $vv).
'</strong></span></td>';
$row2.='<td valign="top" nowrap="nowrap">'.
implode('<br />',$lines[$kk]).
t3lib/class.t3lib_befunc.php (Arbeitskopie)
}
if ($row['shortcut_mode'] != t3lib_pageSelect::SHORTCUT_MODE_NONE) {
$label.=', '.$LANG->sL($TCA['pages']['columns']['shortcut_mode']['label']).' '.
$LANG->sL(self::getLabelFromItemlist('pages', 'shortcut_mode', $row['shortcut_mode']));
self::getLabelFromItemlist('pages', 'shortcut_mode', $row['shortcut_mode']);
}
$parts[] = $LANG->sL($TCA['pages']['columns']['shortcut']['label']).' '.$label;
} elseif ($row['doktype']=='7') {
......
$fe_groups = array();
foreach (t3lib_div::intExplode(',', $row['fe_group']) as $fe_group) {
if ($fe_group<0) {
$fe_groups[] = $LANG->sL(self::getLabelFromItemlist('pages', 'fe_group', $fe_group));
$fe_groups[] = self::getLabelFromItemlist('pages', 'fe_group', $fe_group);
} else {
$lRec = self::getRecordWSOL('fe_groups', $fe_group, 'title');
$fe_groups[] = $lRec['title'];
......
*/
public static function getLabelFromItemlist($table, $col, $key) {
global $TCA;
$labels = array();
$allKeys = explode(',', $key);
// Load full TCA for $table
t3lib_div::loadTCA($table);
// Check, if there is an "items" array:
if (is_array($TCA[$table]) && is_array($TCA[$table]['columns'][$col]) && is_array($TCA[$table]['columns'][$col]['config']['items'])) {
// Traverse the items-array...
foreach ($TCA[$table]['columns'][$col]['config']['items'] as $k => $v) {
// ... and return the first found label where the value was equal to $key
if (!strcmp($v[1], $key)) return $v[0];
$itemList = $TCA[$table]['columns'][$col]['config']['items'];
foreach ($itemList as $item) {
if (in_array($item[1], $allKeys)) {
$labels[] = $GLOBALS['LANG']->sL($item[0]);
}
}
}
return implode(', ', $labels);
}
/**
......
switch((string)$theColConf['type']) {
case 'radio':
$l = self::getLabelFromItemlist($table, $col, $value);
$l = $GLOBALS['LANG']->sL($l);
break;
case 'select':
if ($theColConf['MM']) {
typo3/sysext/beuser/mod/index.php (Arbeitskopie)
case 'pagetypes_select':
$pageTypes = explode(',',$v);
foreach ($pageTypes as &$vv) {
$vv = $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('pages','doktype',$vv));
$vv = t3lib_BEfunc::getLabelFromItemlist('pages', 'doktype', $vv);
}
$out[$k] = implode('<br />',$pageTypes);
break;
typo3/sysext/cms/layout/class.tx_cms_layout.php (Arbeitskopie)
break;
case 'list':
$out .= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','list_type'), 1) . ' ' .
$GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','list_type',$row['list_type']),1).'<br />';
t3lib_BEfunc::getLabelFromItemlist('tt_content','list_type',$row['list_type']) . '<br />';
$hookArr = array();
$hookOut = '';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']])) {
......
$out.= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','select_key'),1).' '.$row['select_key'].'<br />';
}
$out .= $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','pages',$row['pages']), 1) . '<br />';
$out .= t3lib_BEfunc::getLabelFromItemlist('tt_content','pages',$row['pages']) . '<br />';
break;
case 'script':
$out.= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','select_key'),1).' '.$row['select_key'].'<br />';
typo3/sysext/cms/layout/db_layout.php (Arbeitskopie)
if (strcmp($cRow['colPos'],$colPos)) {
$colPos=$cRow['colPos'];
$opt[]='<option value=""></option>';
$opt[]='<option value="_EDIT_COL:'.$colPos.'">__'.$LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','colPos',$colPos),1).':__</option>';
$opt[]='<option value="_EDIT_COL:'.$colPos.'">__' . t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $colPos) . ':__</option>';
}
$inValue = 'tt_content:'.$cRow['uid'];
$is_selected+=intval($edit_record==$inValue);
    (1-1/1)