Project

General

Profile

Bug #17580 » disable_empty_tabs_v2_(trunk).patch

Administrator Admin, 2007-10-24 15:39

View differences:

/t3lib/class.t3lib_tceforms.php (working copy)
// Create parts array for the tab menu:
$parts = array();
foreach ($out_array as $idx => $sheetContent) {
$resstr = implode('', $sheetContent);
if ($resstr) {
$parts[$idx] = array(
'label' => $out_array_meta[$idx]['title'],
'content' => '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
$resstr.
'</table>'
);
foreach ($out_array as $idx => $sheetContent) {
$sContent = implode('', $sheetContent);
if ($sContent) {
$sContent = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.$sContent.'</table>';
}
$parts[$idx] = array(
'label' => $out_array_meta[$idx]['title'],
'content' => $sContent,
);
}
if (count($parts) > 1) {
// Unset the current level of tab menus:
$this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet+1));
/typo3/template.php (working copy)
$isActive = strcmp(trim($def['content']),'');
if ($isActive) {
$mouseOverOut = ' onmouseover="DTM_mouseOver(this);" onmouseout="DTM_mouseOut(this);"';
$mouseOverOut = ' onmouseover="DTM_mouseOver(this);" onmouseout="DTM_mouseOut(this);"';
if (!$foldout) {
// Create TAB cell:
$options[$tabRows][] = '
<td class="'.($isActive ? 'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$noWrap.$mouseOverOut.'>'.
($isActive ? '<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ? ' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
$def['icon'].
($def['label'] ? htmlspecialchars($def['label']) : '&nbsp;').
$this->icons($def['stateIcon'],'margin-left: 10px;').
($isActive ? '</a>' :'').
'</td>';
$titleLenCount+= strlen($def['label']);
} else {
// Create DIV layer for content:
$divs[] = '
<div class="'.($isActive ? 'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$mouseOverOut.'>'.
($isActive ? '<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ? ' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
$def['icon'].
($def['label'] ? htmlspecialchars($def['label']) : '&nbsp;').
($isActive ? '</a>' : '').
'</div>';
}
if (!$foldout) {
// Create TAB cell:
$options[$tabRows][] = '
<td class="'.($isActive ? 'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$noWrap.$mouseOverOut.'>'.
($isActive ? '<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ? ' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
$def['icon'].
($def['label'] ? htmlspecialchars($def['label']) : '&nbsp;').
$this->icons($def['stateIcon'],'margin-left: 10px;').
($isActive ? '</a>' :'').
'</td>';
$titleLenCount+= strlen($def['label']);
} else {
// Create DIV layer for content:
$divs[] = '
<div style="display: none;" id="'.$id.'-'.$index.'-DIV" class="c-tablayer">'.
($def['description'] ? '<p class="c-descr">'.nl2br(htmlspecialchars($def['description'])).'</p>' : '').
$def['content'].
'</div>';
// Create initialization string:
<div class="'.($isActive ? 'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$mouseOverOut.'>'.
($isActive ? '<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ? ' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
$def['icon'].
($def['label'] ? htmlspecialchars($def['label']) : '&nbsp;').
($isActive ? '</a>' : '').
'</div>';
}
// Create DIV layer for content:
$divs[] = '
<div style="display: none;" id="'.$id.'-'.$index.'-DIV" class="c-tablayer">'.
($def['description'] ? '<p class="c-descr">'.nl2br(htmlspecialchars($def['description'])).'</p>' : '').
$def['content'].
'</div>';
// Create initialization string:
$JSinit[] = '
DTM_array["'.$id.'"]['.$c.'] = "'.$id.'-'.$index.'";
';
if ($toggle==1) {
$JSinit[] = '
DTM_array["'.$id.'"]['.$c.'] = "'.$id.'-'.$index.'";
if (top.DTM_currentTabs["'.$id.'-'.$index.'"]) { DTM_toggle("'.$id.'","'.$index.'",1); }
';
if ($toggle==1) {
$JSinit[] = '
if (top.DTM_currentTabs["'.$id.'-'.$index.'"]) { DTM_toggle("'.$id.'","'.$index.'",1); }
';
}
}
$c++;
}
$c++;
}
// Render menu:
......
for(cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {
if (DTM_array[idBase][cnt] != idBase+"-"+index) {
document.getElementById(DTM_array[idBase][cnt]+"-DIV").style.display = "none";
document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").nodeValue = "tab";
// Only Overriding when Tab not disabled
if (document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").nodeValue != "disabled") {
document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").nodeValue = "tab";
}
}
}
}
/typo3/sysext/t3skin/stylesheets/typo3-dyntabmenu.css (working copy)
table.typo3-dyntabmenu td {
color: #E6E1B2;
border:0;
border: solid 1px #A2AAB8;
border-bottom: 0;
padding: 0;
cursor: pointer;
}
......
}
table.typo3-dyntabmenu td.disabled,
table.typo3-dyntabmenu td.disabled:hover {
table.typo3-dyntabmenu td.disabled_over {
padding: 5px 10px 5px 10px;
color: #A2AAB8;
background-color: #EFEFF4;
}
table.typo3-dyntabmenu td a {
border: solid 1px #A2AAB8;
border-bottom: 0;
padding: 5px 10px 5px 10px;
display: block;
width: auto;
(3-3/3)