Index: trunk/kernel/admin/include/toolbar/browse.php =================================================================== diff -u -r13 -r250 --- trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 13) +++ trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 250) @@ -694,88 +694,84 @@ } } -function toggleTabB(tabId, atm) -{ - var hl = document.getElementById("hidden_line"); - var activeTabId; + function toggleTabB(tabId, atm) + { + var hl = document.getElementById("hidden_line"); + var activeTabId; - if (activeTab) activeTabId = activeTab.id; - if (activeTabId == tabId) - { - var devider = document.getElementById("tabsDevider"); - devider.style.display = ""; + if (activeTab) activeTabId = activeTab.id; + if (activeTabId == tabId) + { + var devider = document.getElementById("tabsDevider"); + devider.style.display = ""; - unselectAll(tabId); - var tab = document.getElementById(tabId); - tab.active = false; - activeTab = null; - collapseTab = tab; - toolbar.setTab(null); - showTab(); - } + unselectAll(tabId); + var tab = document.getElementById(tabId); + tab.active = false; + activeTab = null; + collapseTab = tab; + toolbar.setTab(null); + showTab(); + } + else + { + if (activeTab) + toggleTab(tabId, true) + else + toggleTab(tabId, atm) + if (hl) hl.style.display = "none"; + } + tab_hdr = document.getElementById('tab_headers'); + if (!tab_hdr) return; + + // process all module tabs + var active_str = ''; + for(var i = 0; i < tabIDs.length; i++) + { + var tabHeader; + TDs = tab_hdr.getElementsByTagName("TD"); + for (var j = 0; j < TDs.length; j++) + if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i]) + { + tabHeader = TDs[j]; + break; + } + if (!tabHeader) continue; - else - { - if (activeTab) toggleTab(tabId, true) - else toggleTab(tabId, atm) + var tab = document.getElementById(tabIDs[i]); + if (!tab) continue; + active_str = (tab.active) ? "tab_active" : "tab_inactive"; + + if (TDs[j].getAttribute("tabHeaderOf") == tabId) { + // module tab is selected + SetBackground('l_' + tabId, "$imagesURL/itemtabs/" + active_str + "_l.gif"); + SetBackground('m_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif"); + SetBackground('m1_' + tabId, "$imagesURL/itemtabs/" + active_str + ".gif"); + SetBackground('r_' + tabId, "$imagesURL/itemtabs/" + active_str + "_r.gif"); + } + else + { + // module tab is not selected + SetBackground('l_' +tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_l.gif"); + SetBackground('m_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif"); + SetBackground('m1_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + ".gif"); + SetBackground('r_' + tabIDs[i], "$imagesURL/itemtabs/" + active_str + "_r.gif"); + } - if (hl) hl.style.display = "none"; - } - tab_hdr = document.getElementById('tab_headers'); - if (!tab_hdr) return; + var images = tabHeader.getElementsByTagName("IMG"); + if (images.length < 1) continue; - for (var i = 0; i < tabIDs.length; i++) - { - var tabHeader; - TDs = tab_hdr.getElementsByTagName("TD"); - for (var j = 0; j < TDs.length; j++) - if (TDs[j].getAttribute("tabHeaderOf") == tabIDs[i]) - { - tabHeader = TDs[j]; - break; - } - if (!tabHeader) continue; + images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif"; + } + } - var tab = document.getElementById(tabIDs[i]); - if (!tab) continue; + function SetBackground(element_id, img_url) + { + // set background image of element specified by id + var el = document.getElementById(element_id); + el.style.backgroundImage = 'url('+img_url+')'; + } - if (TDs[j].getAttribute("tabHeaderOf") == tabId) { - cell = document.getElementById('l_' + tabId); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active_l" : "tab_inactive_l") + ".gif" - - cell = document.getElementById('m_' + tabId); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif" - - cell = document.getElementById('m1_' + tabId); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif" - - cell = document.getElementById('r_' + tabId); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active_r" : "tab_inactive_r") + ".gif" - } - else { - cell = document.getElementById('l_' + tabIDs[i]); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active_l" : "tab_inactive_l") + ".gif" - - cell = document.getElementById('m_' + tabIDs[i]); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif" - - cell = document.getElementById('m1_' + tabIDs[i]); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif" - - cell = document.getElementById('r_' + tabIDs[i]); - cell.background = "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active_r" : "tab_inactive_r") + ".gif" - } - - -// tabHeader.setAttribute("background", "$imagesURL/itemtabs/" + ((tab.active) ? "tab_active" : "tab_inactive") + ".gif") - - var images = tabHeader.getElementsByTagName("IMG"); - if (images.length < 1) continue; - - images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif"; - } -} - END;