Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 9:07 PM

in-portal

Index: trunk/kernel/admin/include/toolbar/browse.php
===================================================================
--- trunk/kernel/admin/include/toolbar/browse.php (revision 249)
+++ trunk/kernel/admin/include/toolbar/browse.php (revision 250)
@@ -1,782 +1,778 @@
<?php
global $objConfig,$objSections,$section, $rootURL,$adminURL, $admin, $imagesURL,$envar,
$m_var_list_update,$objCatList, $homeURL, $upURL, $objSession,$CatScopeClause,$DefaultTab;
global $CategoryFilter,$TotalItemCount;
global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed;
global $hideSelectAll;
/* bit place holders for category view menu */
$Bit_Active=64;
$Bit_Pending=32;
$Bit_Disabled=16;
$Bit_New=8;
$Bit_Pop=4;
$Bit_Hot=2;
$Bit_Ed=1;
if( isset($_GET['SetTab']) )
{
if($_GET["SetTab"] != "categories")
{
$m_tab_CatTab_Hide = 1;
$DefaultTab = $_GET["SetTab"];
}
else
{
$DefaultTab="categories";
$m_tab_CatTab_Hide = 0;
}
}
else
$m_tab_CatTab_Hide = (int)$objConfig->Get("CatTab_Hide");
$CategoryView = $objConfig->Get("Category_View");
if(!is_numeric($CategoryView))
{
$CategoryView = 127;
}
$Category_Sortfield = $objConfig->Get("Category_Sortfield");
if(!strlen($Category_Sortfield))
$Category_Sortfield = "Name";
$Category_Sortorder = $objConfig->Get("Category_Sortorder");
if(!strlen($Category_Sortorder))
$Category_Sortorder = "desc";
$Perpage_Category = (int)$objConfig->Get("Perpage_Category");
if(!$Perpage_Category)
$Perpage_Category="'all'";
if($CategoryView == 127)
{
$Category_ShowAll = 1;
}
else
{
$Category_ShowAll=0;
$Status = array();
$Mod = array();
if($CategoryView & $Bit_Pending)
$Status[] = STATUS_PENDING;
if($CategoryView & $Bit_Active)
$Status[] = STATUS_ACTIVE;
if($CategoryView & $Bit_Disabled)
$Status[] = STATUS_DISABLED;
if(count($Status))
{
$CategoryFilter .= " AND (Status IN (".implode(",",$Status).") ";
}
else
$CategoryFilter .= " AND ((Status=-1) ";
if($CategoryView & $Bit_Ed)
{
$CategoryFilter .= " OR (EditorsPick=1) ";
}
if($CategoryView & $Bit_New)
{
$cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400);
$CategoryFilter .= " OR (CreatedOn > ".$cutoff.") ";
}
$CategoryFilter .= ")";
}
$list = $objSession->GetVariable("SearchWord");
if(strlen($list))
{
$CatScope = $objSession->GetVariable("SearchScope");
switch($CatScope)
{
case 0 :
$CatScopeClause = "";
break;
case 1:
$cat = $objCatList->CurrentCategoryID();
if($cat>0)
{
$allcats = $objCatList->AllSubCats($cat);
if(count($allcats)>0)
{
$catlist = implode(",",$allcats);
$CatScopeClause = " CategoryId IN ($catlist) ";
}
}
break;
case 2:
$CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID();
break;
}
}
else
$CatScopeClause="";
$Cat_Paste = "false";
if($objCatList->ItemsOnClipboard()>0)
$Cat_Paste = "true";
$CurrentCat = $objCatList->CurrentCategoryID();
if($CurrentCat>0)
{
$c = $objCatList->GetItem($CurrentCat);
$CurrentRes = (int)$c->Get("ResourceId");
}
else
$CurrentRes =0;
$mnuClearSearch = language("la_SearchMenu_Clear");
$mnuNewSearch = language("la_SearchMenu_New");
$mnuSearchCategory = language("la_SearchMenu_Categories");
$lang_New = language("la_Text_New");
$lang_Hot = language("la_Text_Hot");
$lang_EdPick = language("la_prompt_EditorsPick");
$lang_Pop = language("la_Text_Pop");
$lang_Rating = language("la_prompt_Rating");
$lang_Hits = language("la_prompt_Hits");
$lang_Votes = language("la_prompt_Votes");
$lang_Name = language("la_prompt_Name");
$lang_Categories = language("la_ItemTab_Categories");
$lang_Description = language("la_prompt_Description");
$lang_MetaKeywords = language("la_prompt_MetaKeywords");
$lang_SubSearch = language("la_prompt_SubSearch");
$lang_Within = language("la_Text_Within");
$lang_Current = language("la_Text_Current");
$lang_Active = language("la_Text_Active");
$lang_SubCats = language("la_Text_SubCats");
$lang_SubItems = language("la_Text_Subitems");
print <<<END
<script language="JavaScript">
var Category_Sortfield = '$Category_Sortfield';
var Category_Sortorder = '$Category_Sortorder';
var Category_Perpage = $Perpage_Category;
var Category_ShowAll = $Category_ShowAll;
var CategoryView = $CategoryView;
var default_tab = "$DefaultTab";
var Categories_Paste = $Cat_Paste;
var CurrentCat = $CurrentCat;
var CurrentRes = $CurrentRes;
PasteButton = PasteButton || Categories_Paste;
//JS Language variables
var lang_New = "$lang_New";
var lang_Hot = "$lang_Hot";
var lang_EdPick = "$lang_EdPick";
var lang_Pop = "$lang_Pop";
var lang_Rating = "$lang_Rating";
var lang_Hits = "$lang_Hits";
var lang_Votes = "$lang_Votes";
var lang_Name = "$lang_Name";
var lang_Categories = "$lang_Categories";
var lang_Description = "$lang_Description";
var lang_MetaKeywords = "$lang_MetaKeywords";
var lang_SubSearch = "$lang_SubSearch";
var lang_Within="$lang_Within";
var lang_Current = "$lang_Current";
var lang_Active = "$lang_Active";
var lang_SubCats = "$lang_SubCats";
var lang_SubItems = "$lang_SubItems";
var m_tab_CatTab_hide = $m_tab_CatTab_Hide;
var hostname = '$rootURL';
var env = '$envar';
var actionlist = new Array();
var homeURL = "$homeURL";
var upURL = "$upURL";
function InitPage()
{
addCommonActions();
initToolbar('mainToolBar', actionHandler);
initCheckBoxes();
toggleMenu();
}
function AddButtonAction(actionname,actionval)
{
var item = new Array(actionname,actionval);
actionlist[actionlist.length] = item;
}
function actionHandler(button)
{
//alert('a button has been pressed!');
for(i=0; i<actionlist.length;i++)
{
a = actionlist[i];
if(button.action==a[0])
{
//alert('Button action '+a[0]+' is '+a[1]);
eval(a[1]);
break;
}
}
}
function addCommonActions()
{
AddButtonAction('upcat',"get_to_server(upURL,'');");// UP
AddButtonAction('homecat',"get_to_server(homeURL,'');"); //home
AddButtonAction('new_cat',"get_to_server('$adminURL/category/addcategory.php',env+'&new=1');"); //new cat
AddButtonAction('editcat',"edit_current(); "); //edit current
AddButtonAction('edit',"check_submit('','edit');"); //edit
AddButtonAction('delete',"check_submit('$admin/browse','delete');"); //delete
AddButtonAction('approve',"check_submit('$admin/browse','approve');"); //approve
AddButtonAction('decline',"check_submit('$admin/browse','decline');"); //decline
AddButtonAction('cut',"check_submit('$admin/browse','cut');"); //cut
AddButtonAction('copy',"check_submit('$admin/browse','copy');"); //copy
AddButtonAction('paste',"get_to_server('$adminURL/browse.php',env+'&Action=m_paste');"); //paste
AddButtonAction('move_up',"check_submit('$admin/browse','move_up');"); //up
AddButtonAction('move_down',"check_submit('$admin/browse','move_down');"); //down
AddButtonAction('print',"window.print();"); //print ?
AddButtonAction('view',"toggleMenu(); window.FW_showMenu(window.cat_menu,getRealLeft(button) - ((document.all) ? 6 : -2),getRealTop(button)+32);");
AddButtonAction('search_a',"setSearchMenu(); window.FW_showMenu(window.SearchMenu,getRealLeft(button)-134 - ((document.all) ? 8 : -1),getRealTop(button)+22);");
AddButtonAction('search_b',"search_submit();");
AddButtonAction('search_c',"new_search_submit();");
}
function AdminCatNav(url)
{
f = document.getElementById("admin_search");
if(f)
{
f.action = url;
new_search_submit();
}
}
function search_submit()
{
f = document.getElementById("admin_search");
if(f)
{
//alert('Setting SearchWord to ' + f.value);
f.Action.value = "m_SearchWord";
f.submit();
}
}
function new_search_submit()
{
var newSearchInput = document.getElementById("NewSearch");
if (newSearchInput) newSearchInput.value = 1;
search_submit();
}
function ClearSearch()
{
//alert('Clearing Search');
f = document.getElementById("admin_search");
if(f)
{
f.Action.value = "m_ClearSearch";
f.submit();
}
}
function SetSearchType(value)
{
f = document.getElementById("admin_search");
if(f)
{
f.SearchType.value = value;
}
}
function SetSearchScope(value)
{
f = document.getElementById("admin_search");
if(f)
{
f.SearchScope.value = value;
}
}
function ToggleNewSearch()
{
f = document.getElementById("admin_search");
if(f)
{
value = f.NewSearch.value;
if(value==1)
{
f.NewSearch.value=0;
}
else
f.NewSearch.value=1;
}
}
function isNewSearch()
{
f = document.getElementById("admin_search");
if(f)
{
return f.NewSearch.value;
}
else return 0;
}
function get_to_server(path,attr)
{
if(attr.length>0)
path = path + '?'+attr;
window.location.href=path;
return true;
}
function check_submit(page,actionValue)
{
if (actionValue.match(/delete$/)) {
if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
}
var formname = '';
var action_prefix ='';
if ((activeTab) && (!isAnyChecked('categories')))
{
form_name = activeTab.id;
action_prefix = activeTab.getAttribute("ActionPrefix");
if(page.length==0)
page = activeTab.getAttribute("EditURL");
}
else
{
form_name = 'categories';
action_prefix = 'm_cat_';
if(page.length==0)
page="$admin" + '/category/addcategory';
}
var f = document.getElementsByName(form_name+'_form')[0];
if(f)
{
f.Action.value = action_prefix + actionValue;
f.action = '$rootURL' + page + '.php?'+ env;
//alert(f.name+ ' is submitting to '+ f.action + ' action=' + f.Action.value);
f.submit();
}
} // check submit
function edit_current()
{
if(CurrentCat==0)
{
get_to_server('$adminURL/category/addcategory_permissions.php',env+'&item=0');
}
else
get_to_server('$adminURL/category/addcategory.php',env+'&item=$CurrentRes');
}
function flip_current(field_suffix)
{
if(activeTab)
{
field = activeTab.getAttribute("tabTitle")+field_suffix;
return flip(eval(field));
}
}
function config_current(field_suffix,value)
{
if(activeTab)
{
field = activeTab.getAttribute("tabTitle")+field_suffix;
config_val(field,value);
}
}
function getSType(type,value)
{
f = document.getElementById("admin_search");
if(f)
{
if (f.SearchType.value == type) return 2; else return 0;
} else return 0;
}
function getSScope(scope)
{
f = document.getElementById("admin_search");
if(f)
{
if (f.SearchScope.value == scope) return 2; else return 0;
} else return 0;
}
function setSearchMenu()
{
window.SearchMenu = new Menu("search");
SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all'));
SearchMenu.addMenuSeparator()
SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories'));
param = "";
for (var i = 0; i < tabIDs.length; i++)
{
d = document.getElementById(tabIDs[i]);
if(d)
{
tabname = d.getAttribute("tabTitle");
param = "SetSearchType('"+tabname+"');";
SearchMenu.addMenuItem(tabname,param,getSType(tabname));
}
}
SearchMenu.addMenuSeparator();
SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0));
SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch());
SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2));
SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1));
SearchMenu.addMenuSeparator();
window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();","");
window.triedToWriteMenus = false;
window.SearchMenu.writeMenus();
}
function Category_SortMenu(caption)
{
menu_sorting = new Menu(caption);
menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc'));
menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc'));
menu_sorting.addMenuSeparator();
menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');","");
menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name'));
menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description'));
menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn'));
menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty'));
menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems'));
return menu_sorting;
}
function Category_FilterMenu(caption)
{
menu_filter = new Menu(caption);
menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127);
menu_filter.addMenuSeparator();
menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6));
menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5));
menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4));
menu_filter.addMenuSeparator();
menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3));
menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0));
return menu_filter;
}
function toggleMenu()
{
//var tab_title = GetTabTitle(activeTab.id);
//alert(tab_title);
if ((document.getElementById('categories').active) && (activeTab))
{
filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();';
window.cat_menu_filter_sub = Category_FilterMenu(lang_Categories);
window.sub_menu_filter_sub = eval(filterfunc);
window.cat_menu_filter = new Menu(lang_View);
cat_menu_filter.addMenuItem(cat_menu_filter_sub);
cat_menu_filter.addMenuItem(sub_menu_filter_sub);
}
else
{
if (document.getElementById('categories').active)
{
window.cat_menu_filter = Category_FilterMenu(lang_View);
}
if (activeTab)
{
filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();';
window.cat_menu_filter = eval(filterfunc);
}
} // Filter
//Sorting
if ((document.getElementById('categories').active) && (activeTab))
{
//Sort->Categories
sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu();';
window.cat_menu_sorting_sub = Category_SortMenu(lang_Categories);
window.sub_menu_sorting_sub = eval(sortfunc);
window.cat_menu_sorting = new Menu(lang_Sort);
cat_menu_sorting.addMenuItem(cat_menu_sorting_sub);
cat_menu_sorting.addMenuItem(sub_menu_sorting_sub);
}
else
{
if (document.getElementById('categories').active)
{
window.cat_menu_sorting = Category_SortMenu(lang_Sort);
} // categories
if (activeTab)
{
window.cat_menu_sorting = Category_SortMenu(lang_Sort);
}
} // && Sorting
if ((document.getElementById('categories').active) && (activeTab))
{
window.cat_menu_select_sub = new Menu(lang_Categories);
cat_menu_select_sub.addMenuItem(lang_All,"javascript:selectAllC('categories');","");
cat_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');","");
cat_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('categories');","");
selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu();";
window.sub_menu_select_sub = eval(selectfunc);
// sub_menu_select_sub.addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');","");
// sub_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');","");
// sub_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');","");
END;
if (!$hideSelectAll) {
echo "
window.cat_menu_select = new Menu(lang_Select);
cat_menu_select.addMenuItem(cat_menu_select_sub);
cat_menu_select.addMenuItem(sub_menu_select_sub);";
}
print <<<END
}
else
{
if (document.getElementById('categories').active)
{
window.cat_menu_select = new Menu(lang_Select);
cat_menu_select.addMenuItem(lang_All,"javascript:selectAllC('categories');","");
cat_menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');","");
cat_menu_select.addMenuItem(lang_Invert,"javascript:invert('categories');","");
}
END;
if (!$hideSelectAll) {
echo ' if (activeTab)
{
window.cat_menu_select = new Menu(lang_Select);
cat_menu_select.addMenuItem(lang_All,"javascript:selectAllC(\'"+activeTab.id+"\');","");
cat_menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll(\'"+activeTab.id+"\');","");
cat_menu_select.addMenuItem(lang_Invert,"javascript:invert(\'"+activeTab.id+"\');","");
} ';
}
print <<<END
} // && Select
if(activeTab)
{
pagefunc = activeTab.getAttribute("tabTitle")+"_PerPageMenu();";
window.PerPageMenu = eval(pagefunc);
}
window.cat_menu = new Menu("root");
if ((document.getElementById('categories').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_filter);
if ((document.getElementById('categories').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_sorting);
if(activeTab) window.cat_menu.addMenuItem(PerPageMenu);
if ((document.getElementById('categories').active) || (activeTab)) window.cat_menu.addMenuItem(cat_menu_select);
window.triedToWriteMenus = false;
window.cat_menu.writeMenus();
}
function toggleCategoriesA(tabHeader, instant)
{
var categories = document.getElementById('categories');
if (!categories) return;
toggleCategories(instant);
tabHeader.setAttribute("background", '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif")
var images = tabHeader.getElementsByTagName("IMG");
if (images.length < 1) return;
images[0].src = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "divider_up" : "divider_dn") + ".gif";
}
function toggleCategoriesB(tabHeader, instant)
{
var categories = document.getElementById('categories');
if (!categories) return;
toggleCategories(instant);
document.getElementById('l_cat').background = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active_l" : "tab_inactive_l") + ".gif"
document.getElementById('m_cat').background = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif"
document.getElementById('m1_cat').background = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif"
document.getElementById('r_cat').background = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active_r" : "tab_inactive_r") + ".gif"
//tabHeader.setAttribute("background", '$imagesURL'+'/itemtabs/' + ((categories.active) ? "tab_active" : "tab_inactive") + ".gif")
var images = tabHeader.getElementsByTagName("IMG");
if (images.length < 1) return;
images[0].src = '$imagesURL'+'/itemtabs/' + ((categories.active) ? "divider_up" : "divider_dn") + ".gif";
}
function toggleTabA(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 = "";
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;
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;
var tab = document.getElementById(tabIDs[i]);
if (!tab) continue;
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";
}
}
-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 = "";
-
- 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;
-
- 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;
-
- var tab = document.getElementById(tabIDs[i]);
- if (!tab) continue;
-
- 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";
- }
-}
+ 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 = "";
+
+ 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;
+
+ 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");
+ }
+
+ var images = tabHeader.getElementsByTagName("IMG");
+ if (images.length < 1) continue;
+
+ images[0].src = "$imagesURL/itemtabs/" + ((tab.active) ? "divider_up" : "divider_empty") + ".gif";
+ }
+ }
+
+ 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+')';
+ }
</script>
END;
?>
Property changes on: trunk/kernel/admin/include/toolbar/browse.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property

Event Timeline