$value) { $path = $pathtoroot. $value."admin/include/parser.php"; if(file_exists($path)) { include_once($path); } } unset($objEditItems); $objEditItems = new clsCatList(); $objEditItems->SourceTable = $objSession->GetEditTable("Category"); //Multiedit init $en = (int)$_GET["en"]; $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); $itemcount=$objEditItems->NumItems(); $c = $objEditItems->GetItemByIndex($en); if(!is_object($c)) { $c = new clsCategory(); $c->Set("CategoryId",0); } if($itemcount>1) { if ($en+1 == $itemcount) $en_next = -1; else $en_next = $en+1; if ($en == 0) $en_prev = -1; else $en_prev = $en-1; } $action = "m_edit_permissions"; $envar = "env=" . BuildEnv() . "&en=$en"; $section = 'in-portal:catperm_setperm'; $Module = $_GET["module"]; $GroupId = $_GET["GroupId"]; $g = $objGroups->GetItem($GroupId); $objPermList = new clsPermList($c->Get("CategoryId"),$GroupId); $objPermList->LoadPermTree($c); $objParentPerms = new clsPermList($c->Get("ParentId"),$GroupId); $p = $objCatList->GetCategory($c->Get("ParentId")); $objParentPerms->LoadPermTree($p); $ado = &GetADODBConnection(); /* page header */ $charset = GetRegionalOption('Charset'); print << In-portal END; //int_SectionHeader(); //$back_url = $rootURL."admin/category/addpermission_modules.php?env=".BuildEnv()."&GroupId=$GroupId"; $back_url = "javascript:do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);"; if($c->Get("CategoryId")>0) { $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Permissions"); $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'"; } else { $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Root")." ".prompt_language("la_Text_Category")." - "."' - ".prompt_language("la_tab_Permissions"); $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'"; } $objListToolBar = new clsToolBar(); $objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",$imagesURL."/toolbar/tool_select.gif"); //$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','admin/category/addpermission_modules.php',-1);", $imagesURL."/toolbar/tool_cancel.gif"); $objListToolBar->Add("img_cancel", "la_Cancel",$back_url,"swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","", $imagesURL."/toolbar/tool_cancel.gif"); $sec = $objSections->GetSection($section); if($c->Get("CategoryId")==0) { $sec->Set("left",NULL); $sec->Set("right",NULL); } int_header($objListToolBar,NULL,$title); if ($objSession->GetVariable("HasChanges") == 1) { ?>
".prompt_language("la_prompt_Description").""; if($c->Get("CategoryId")!=0) { echo ""; } echo "\n"; if($c->Get("CategoryId")!=0) { echo ""; } ?> Get("CategoryId")>0) { $ParentCatList = "0".$c->Get("ParentPath"); } else $ParentCatList = "0".$c->GetParentField("ParentPath","",""); $ParentCats = explode("|",$ParentCatList); $ParentCats = array_reverse($ParentCats); $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE ModuleId='$Module'"; $rs = $ado->Execute($sql); while($rs && !$rs->EOF) { $perm = $rs->fields; $Permission = $perm["PermissionName"]; $Desc = $perm["Description"]; echo "\n"; echo ""; $p = $objPermList->GetPermByName($Permission); $checked = ""; $MatchCatPath = ""; if(is_object($p)) { //echo $p->Get("Permission")." Found
\n"; if($p->Inherited) { $checked = " CHECKED"; $MatchCatPath = ""; if($c->Get("CategoryId")>0) { $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId); } else $MatchedCat = $objParentPerms->GetDefinedCategory($Permission,$GroupId); if(is_numeric($MatchedCat)) { if($MatchedCat!=0) { $mcat = $objCatList->GetCategory($MatchedCat); $MatchCatPath = language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar"); } else $MatchCatPath = language($objConfig->Get("Root_Name")); } else $MatchCatPath = ""; } } else $checked = " CHECKED"; if($c->Get("CategoryId")!=0) { echo " \n"; } else { if(is_object($p)) $p->Inherited = FALSE; } $checked = ""; $imgsrc="red"; if(is_object($p)) { if($p->Get("PermissionValue")) { $checked = " CHECKED"; $imgsrc = "green"; $current = "true"; } else { $imgsrc = "red"; $current = "false"; } $disabled = ""; if($p->Inherited) { if($c->Get("CategoryId")!=0) { $InheritValue = $current; $UnInheritValue = "false"; $disabled = "DISABLED=\"true\""; } else { $disabled = ""; $UnInheritValue = "false"; $InheritValue="false"; } } else { $disabled = ""; if($p->Get("PermissionValue")) { $InheritValue = "false"; //need to look this up! } else $InheritValue = "false"; $UnInheritValue = $current; } } else { if($c->Get("CategoryId")!=0) { $disabled = "DISABLED=\"true\""; $InheritValue = "false"; $UnInheritValue = "false"; $Matched = FALSE; $MatchCatPath = ""; $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId); if(is_numeric($MatchedCat)) { if($MatchedCat>0) { $mcat = $objCatList->GetCategory($MatchedCat); $MatchCatPath =language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar"); } else $MatchCatPath = language($objConfig->Get("Root_Name")); } else $MatchCatPath = ""; } else { $disabled = ""; $UnInheritValue = "false"; $InheritValue="false"; } } echo " \n"; if($c->Get("CategoryId")!=0) echo ""; echo "\n"; $rs->MoveNext(); } ?> ">
".prompt_language("la_ColHeader_PermInherited")."".prompt_language("la_ColHeader_PermAccess")."".prompt_language("la_ColHeader_InheritFrom")."
".prompt_language("$Desc")." [$Permission]"; echo " "; echo " $MatchCatPath