Commit b6e2908d authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added visual response to backend module selection in the menus; The class attribute of the menu items is changed when a module is selected. The default stylesheet is modified so this results in the current module being highlighted in the menu.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@328 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 3e3accfd
2004-05-28 Kasper Skårhøj,,, <kasper@typo3.com>
* Added visual response to backend module selection in the menus; The class attribute of the menu items is changed when a module is selected. The default stylesheet is modified so this results in the current module being highlighted in the menu.
2004-05-27 Kasper Skårhøj,,, <kasper@typo3.com>
* Fixed various things in file processing, t3lib_extFileFunc et al.
......
......@@ -281,15 +281,46 @@ class SC_alt_main {
busy.loginRefreshed();
busy_checkLoginTimeout_timer();
/**
* Highlight module:
*/
var currentlyHighLightedId = "";
var currentlyHighLighted_restoreValue = "";
function highlightModuleMenuItem(trId, mainModule) {
// Get document object:
if (top.menu && top.menu.document) {
var docObj = top.menu.document;
var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-row-HL";
} else if (top.topmenuFrame && top.topmenuFrame.document) {
var docObj = top.topmenuFrame.document;
var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-HL";
}
if (docObj) {
// Reset old:
if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId)) {
docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class").nodeValue = currentlyHighLighted_restoreValue;
}
// Set new:
currentlyHighLightedId = trId;
if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId)) {
var classAttribObject = docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class");
currentlyHighLighted_restoreValue = classAttribObject.nodeValue;
classAttribObject.nodeValue = HLclass;
}
}
}
/**
* Function used to switch switch module.
*/
var currentModuleLoaded = "";
function goToModule(modName,cMR_flag) { //
var cMR = 0;
if (cMR_flag) cMR=1;
if (cMR_flag) cMR = 1;
currentModuleLoaded=modName;
currentModuleLoaded = modName;
switch(modName) {'.$goToModule_switch.'
}
......
......@@ -147,6 +147,7 @@ class alt_menu_functions {
}
$moduleKey = $moduleName.'_tab';
$moduleCSSId = 'ID_'.t3lib_div::md5int($moduleName);
// Creating image icon
$image = @getimagesize($this->mIconFile($LANG->moduleLabels['tabs_images'][$moduleKey],$backPath));
......@@ -162,22 +163,24 @@ class alt_menu_functions {
// Creating the various links:
$label = $LANG->moduleLabels['tabs'][$moduleKey];
$JScmd='this.selectedIndex=0;';
if ($link && $prefix) $link=$prefix.rawurlencode($link);
if ($link && !$dontLink) {
$JScmd='top.content.location=top.getModuleUrl(top.TS.PATH_typo3+\''.$this->wrapLinkWithAB($link).'\');';
$label='<a href="#" onclick="top.goToModule(\''.$moduleName.'\');'.$onBlur.'return false;">'.$label.'</a>'; // && !$link_sub
$mIcons[]='<a href="#" onclick="top.goToModule(\''.$moduleName.'\');'.$onBlur.'return false;">'.$descr3_imageCode.'</a>';
$mJScmds[]="case '".$moduleName."': \n ".$JScmd." \n break;";
$label = '<a href="#" onclick="top.goToModule(\''.$moduleName.'\');'.$onBlur.'return false;">'.$label.'</a>'; // && !$link_sub
$mIcons[] = '<a href="#" onclick="top.goToModule(\''.$moduleName.'\');'.$onBlur.'return false;" class="c-mainitem" id="'.$moduleCSSId.'">'.$descr3_imageCode.'</a>';
$JScmd = '
top.content.location=top.getModuleUrl(top.TS.PATH_typo3+\''.$this->wrapLinkWithAB($link).'\');
top.highlightModuleMenuItem("'.$moduleCSSId.'",1);';
$mJScmds[] = "case '".$moduleName."': \n ".$JScmd." \n break;";
}
# $selectItems[] = '<option value="'.htmlspecialchars($JScmd).'">'.htmlspecialchars($LANG->moduleLabels['tabs'][$moduleKey]).'</option>';
$selectItems[] = '<option value="top.goToModule(\''.$moduleName.'\');">'.htmlspecialchars($LANG->moduleLabels['tabs'][$moduleKey]).'</option>';
$label='&nbsp;<b>'.$label.'</b>&nbsp;';
// Creating a main item for the vertical menu (descr=0)
$menuCode.='
<tr class="c-mainitem">
<tr class="c-mainitem" id="'.$moduleCSSId.'">
<td colspan="3">'.$imageCode.'<span class="c-label">'.$label.'</span></td>
</tr>';
......@@ -209,6 +212,7 @@ class alt_menu_functions {
$link = $subInfo['script'];
$subKey = $moduleName.'_'.$subName.'_tab';
$moduleCSSId = 'ID_'.t3lib_div::md5int($moduleName.'_'.$subName);
// Creating image icon
$image = @getimagesize($this->mIconFile($LANG->moduleLabels['tabs_images'][$subKey],$backPath));
......@@ -241,7 +245,8 @@ class alt_menu_functions {
// Command for the selector box:
$JScmd = "
top.content.location=top.getModuleUrl(top.TS.PATH_typo3+'".$this->wrapLinkWithAB($link)."'".$addJS.');
top.fsMod.currentMainLoaded="'.$moduleName.'";';
top.fsMod.currentMainLoaded="'.$moduleName.'";
';
// If there is a frameset script in place:
if (!$BE_USER->uc['condensedMode'] && $moduleInfo['navFrameScript']) {
......@@ -269,17 +274,23 @@ class alt_menu_functions {
"'.$this->wrapLinkWithAB($link).'"'.$addJS.'
);
top.fsMod.currentMainLoaded="'.$moduleName.'";
}';
}
';
}
$selectItems[] = '<option value="top.goToModule(\''.$moduleName.'_'.$subName.'\');">'.htmlspecialchars('- '.$label).'</option>';
$onClickString = htmlspecialchars('top.goToModule(\''.$moduleName.'_'.$subName.'\');'.$onBlur.'return false;');
$flabel='<a href="#" onclick="'.$onClickString.'"'.$label_descr.'>'.htmlspecialchars($label).'</a>';
$mIcons[]='<a href="#" onclick="'.$onClickString.'"'.$label_descr.'>'.$descr3_imageCode.'</a>';
$mJScmds[]="case '".$moduleName.'_'.$subName."': \n ".$JScmd." \n break;";
$flabel = '<a href="#" onclick="'.$onClickString.'"'.$label_descr.'>'.htmlspecialchars($label).'</a>';
$mIcons[] = '<a href="#" onclick="'.$onClickString.'"'.$label_descr.' class="c-subitem" id="'.$moduleCSSId.'">'.$descr3_imageCode.'</a>';
$JScmd.= '
top.highlightModuleMenuItem("'.$moduleCSSId.'");';
$mJScmds[] = "case '".$moduleName.'_'.$subName."': \n ".$JScmd." \n break;";
}
$subCode.='
<tr class="c-subitem-row">
<tr class="c-subitem-row" id="'.$moduleCSSId.'">
<td></td>
<td align="center">'.(!$BE_USER->uc['hideSubmoduleIcons']?$imageCode:'').'</td>
<td class="c-subitem-label">'.$flabel.'</td>
......
......@@ -168,7 +168,12 @@ BODY#typo3-alt-topmenu-dummy-php { background-image: url(gfx/alt_topmenu_back_du
BODY#typo3-alt-topmenu-dummy-php-iconmenu { background-image: url(gfx/alt_topmenu_back_full.gif); margin-top: 8px; margin-left: 6px; }
TABLE#typo3-topMenu TR TD {white-space: nowrap; vertical-align: top; }
TABLE#typo3-topMenu TR TD.c-logout, TABLE#typo3-topMenu TR TD.c-admin {padding-left: 20px;}
TABLE#typo3-topMenu TR TD.c-menu IMG {margin: 0px 1px 0px 1px;}
TABLE#typo3-topMenu TR TD.c-menu IMG {margin: 2px 1px 0px 1px; }
TABLE#typo3-topMenu TR TD.c-menu A.c-subitem { padding: 3px 0px 0px 0px; }
TABLE#typo3-topMenu TR TD.c-menu A.c-subitem-HL {background-color: #D9D5C9; padding: 3px 3px 0px 3px; border: 1px solid black; }
TABLE#typo3-topMenu TR TD.c-menu A.c-mainitem { padding: 3px 0px 0px 0px; }
TABLE#typo3-topMenu TR TD.c-menu A.c-mainitem-HL {background-color: #D9D5C9; padding: 3px 3px 0px 3px; border: 1px solid black; }
/* Tab menu (template.php) */
TABLE#typo3-tabmenu { margin-top:5px; }
......@@ -192,12 +197,18 @@ TABLE#typo3-about-modules TR.c-mainitem TD IMG { vertical-align: middle; paddin
BODY#typo3-alt-menu-php { margin: 2px 0px 0px 2px; }
BODY#typo3-alt-menu-php A { text-decoration: none; }
TABLE#typo3-vmenu TR.c-mainitem TD { background-color: #D9D9D8; padding: 1px 1px 1px 1px; border: #9BA1A8 1px solid; vertical-align: middle;}
TABLE#typo3-vmenu TR.c-endrow TD {height: 5px;}
TABLE#typo3-vmenu TR.c-first TD {height: 2px;}
TABLE#typo3-vmenu TR.c-mainitem TD SPAN.c-label A { text-decoration : underline; }
TABLE#typo3-vmenu TR.c-mainitem TD IMG { vertical-align: middle; margin-right: 2px;}
TABLE#typo3-vmenu TR.c-mainitem TD SPAN.c-label { position: relative; top: 1px;}
TABLE#typo3-vmenu TR.c-mainitem-HL TD { background-color: #AAAAAA; padding: 1px 1px 1px 1px; border: #9BA1A8 1px solid; vertical-align: middle;}
TABLE#typo3-vmenu TR.c-mainitem-HL TD SPAN.c-label A { text-decoration : underline; }
TABLE#typo3-vmenu TR.c-mainitem-HL TD IMG { vertical-align: middle; margin-right: 2px;}
TABLE#typo3-vmenu TR.c-mainitem-HL TD SPAN.c-label { position: relative; top: 1px;}
TABLE#typo3-vmenu TR.c-endrow TD {height: 5px;}
TABLE#typo3-vmenu TR.c-first TD {height: 2px;}
TABLE#typo3-vmenu TD.c-subitem-label A { display: block; width: 100%; }
TABLE#typo3-vmenu TD.c-subitem-label A:hover { background: #FFFBF7; }
TABLE#typo3-vmenu TR.c-subitem-row { }
TABLE#typo3-vmenu TR.c-subitem-row-HL { background-color: #D9D5C9; }
DIV#typo3-alt-menu-php-logininfo { text-align: center; width: 90px; margin-top:15px; margin-bottom: 15px;}
DIV#typo3-alt-menu-php-logininfo P { margin-top:5px; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment