SourceTable = $objSession->GetEditTable("Topic"); $objEditItems->EnablePaging = FALSE; //Multiedit init $en = (int)$_GET["en"]; $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); $itemcount=$objEditItems->NumItems(); $c = $objEditItems->GetItemByIndex($en); 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 = "bb_edit_topic"; $envar = "env=" . BuildEnv() . "&en=$en"; //Set Section $section = 'in-bulletin:edittopic_category'; $formaction = $_SERVER["PHP_SELF"]."?".$envar; //Set Environment Variable $saveURL = $admin."/".$objSession->GetVariable('ReturnScript'); //Display header $sec = $objSections->GetSection($section); $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('save_edit_buttons','TopicEditStatus','".$saveURL."',1);","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('save_edit_buttons','TopicEditStatus','".$saveURL."',2);","tool_cancel.gif"); if($itemcount == 1) $objListToolBar->Add("divider"); $objListToolBar->Set("section",$section); $objListToolBar->Set("load_menu_func",""); $objListToolBar->Set("CheckClass","PermChecks"); $objListToolBar->Set("CheckForm","topic"); //Display header $sec = $objSections->GetSection($section); if ( isset($en_prev) || isset($en_next) ) { $url = $RootUrl."in-bulletin/admin/addtopic_category.php"; $StatusField = "TopicEditStatus"; $form = "topic"; MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); $objListToolBar->Add("divider"); } $listImages = array(); //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick $objListToolBar->Add("new_cat", "la_ToolTip_New_Category","#".$envar,"swap('new_cat','toolbar/tool_new_cat_f2.gif');", "swap('new_cat', 'toolbar/tool_new_cat.gif');", "OpenCatSelector('$envar&source=addarticle_category&destform=popup&destfield=CatList');", "tool_new_cat.gif"); $objListToolBar->Add("cat_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('cat_del','toolbar/tool_delete_f2.gif');", "if (PermChecks.itemChecked()) swap('cat_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addtopic_category', 'bb_cat_delete');", "tool_delete.gif"); $listImages[] = "PermChecks.addImage('cat_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; // Set Primary Category $objListToolBar->Add("cat_primary","la_ToolTip_SetPrimary","#", "if (PermChecks.itemChecked()) swap('cat_primary','toolbar/tool_primary_cat_f2.gif');", "if (PermChecks.itemChecked()) swap('cat_primary', 'toolbar/tool_primary_cat.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addtopic_category', 'bb_primary_cat');", "tool_primary_cat.gif"); $listImages[] = "PermChecks.addImage('cat_primary','$imagesURL/toolbar/tool_primary_cat.gif','$imagesURL/toolbar/tool_primary_cat_f3.gif',1); "; $objListToolBar->AddToInitScript($listImages); $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Topic")." '".$c->Get("TopicText")."' - ".prompt_language("la_tab_Categories"); int_header($objListToolBar,NULL,$title); if ($objSession->GetVariable("HasChanges") == 1) { ?>
UpdateMissingCacheData(); $CatList = $c->CategoryMemberList($objSession->GetEditTable("CategoryItems")); $Primary = $c->GetPrimaryCategory($objSession->GetEditTable("CategoryItems")); $catlist = array(); if(strlen($CatList)) { $cats = explode(",",$CatList); $per_page = $objConfig->Get('Perpage_LV_Catlist'); $current_page = GetVar('lpn') ? GetVar('lpn') : $objSession->GetVariable('Page_LV_CatList'); $start_from = $current_page ? ($current_page - 1) * $per_page : 0; if( !getArrayValue($cats, $start_from) ) { $current_page = 1; $start_from = 0; $objSession->SetVariable('Page_LV_CatList', $current_page); } for($i=$start_from; $i < $start_from+$per_page; $i++) { if( getArrayValue($cats, $i) === false ) break; $cat =& $objCatList->GetItem($cats[$i]); $Status = $cat->get("Status"); $catlist[$i] = $cat->Get("CachedNavbar"); if(!strlen($catlist[$i])) { $cat->UpdateCachedPath(); $catlist[$i] = $cat->Get("CachedNavbar"); } if(strlen($catlist[$i])) { $catlist[$i] = prompt_language($objConfig->Get("Root_Name")).">".$catlist[$i]; } else { $catlist[$i] = prompt_language($objConfig->Get("Root_Name")); $Status=1; } if($cats[$i]==$Primary) { $catlist[$i] .= "(".prompt_language("la_Text_Primary").")"; } $attr = array(); $attr["CachedNavbar"] = $catlist[$i]; $attr["CategoryId"]=$cats[$i]; $attr["Status"]=$Status; $objCats->AddItemFromArray($attr); } } $objListView = new clsListView($objListToolBar,$objCats); $objListView->IdField = "CategoryId"; $order = $objConfig->Get("Category_LV_Sortfield"); $SortOrder=0; if($objConfig->Get("Category_LV_Sortorder")=="asc") $SortOrder=1; $objListView->ColumnHeaders->Add("CachedNavbar",prompt_language("la_Text_Category"),1,0,$order,"width=\"30%\"","Category_LV_Sortfield","Category_LV_Sortorder","CachedNavbar"); $objListView->ColumnHeaders->SetSort($objConfig->Get("Category_LV_Sortfield"), $objConfig->Get("Category_LV_Sortorder")); $objListView->PrintToolBar = FALSE; $objListView->checkboxes = TRUE; $objListView->CurrentPageVar = "Page_LV_CatList"; $objListView->PerPageVar = "Perpage_LV_Catlist"; $objListView->CheckboxName = "itemlist[]"; $objListView->TotalItemCount = count($cats); for($i=0;$iItems);$i++) { $objListView->RowIcons[] = $objCats->Items[$i]->StatusIcon(); } $objListView->SliceItems(); print $objListView->PrintList(); ?> ">
" name="viewmenu">