Set("section",$section); $objListToolBar->Set("load_menu_func",""); $objListToolBar->Set("CheckClass","GroupChecks"); $listImages = array(); //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick $objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');", "swap('select', 'toolbar/tool_select.gif');", "SelectSubmit();", "tool_select.gif"); $objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');", "swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif"); /*$objListToolBar->Add("divider"); $objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ", "swap('viewmenubutton', 'toolbar/tool_view.gif');", "ShowViewMenu();","tool_view.gif");*/ $objListToolBar->AddToInitScript($listImages); $objListToolBar->AddToInitScript("fwLoadMenus();"); $order = $objConfig->Get("GroupSelect_SortOrder"); $SelectorType = GetVar('Selector'); if(!$SelectorType) $SelectorType = 'checkbox'; $source = GetVar('source'); $objGroups->Page = GetVar('lpn'); // NEW: begin $application =& kApplication::Instance(); $db =& $application->GetADODBConnection(); switch ($source) { case 'addcategory_permissions': $SelectorType = 'radio'; $exclude_sql = 'SELECT DISTINCT(GroupId) FROM '.TABLE_PREFIX.'Permissions WHERE CatId = '.$application->GetVar('CatId'); break; case 'adduser_groups': $SelectorType = 'radio'; $exclude_sql = 'SELECT GroupId FROM '.$objSession->GetEditTable('UserGroup').' WHERE PortalUserId = '.$application->GetVar('UserId'); break; default: $exclude_sql = ''; break; } $skip_groups = $exclude_sql ? $db->GetCol($exclude_sql) : Array(); $where_clause = $skip_groups ? 'GroupId NOT IN ('.implode(',', $skip_groups).')' : '1'; $objGroups->LoadGroups('(Personal = 0) AND ('.$where_clause.')', trim($objConfig->Get('GroupSelect_SortField').' '.$order)); // NEW: end $objListView = new clsListView($objListToolBar,$objGroups); $objListView->IdField = "ResourceId"; $objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; $objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Name"),1,0,$order,"width=\"20%\"","GroupSelect_SortField","GroupSelect_SortOrder","Name"); $objListView->ColumnHeaders->Add("Description", admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","GroupSelect_SortField","GroupSelect_SortOrder","Description"); $objListView->ColumnHeaders->SetSort($objConfig->Get("GroupSelect_SortField"),$order); $objListView->PrintToolBar = FALSE; $objListView->CurrentPageVar = "Page_Grouplist"; $objListView->PerPageVar = "Perpage_Grouplist"; $objListView->CheckboxName = "itemlist[]"; $objListView->TotalItemCount = $objGroups->QueryItemCount; $objListView->SelectorType = $SelectorType; $objListView->extra_env = 'destform='.GetVar('destform').'&destfield='.GetVar('destfield').'&Selector='.GetVar('Selector'); $title = 'Select Group'; int_header($objListToolBar,NULL,$title); $values = GetVar('values'); if($values) $current_value = explode(',', $values); ?>
PrintList(); ?>
" name="viewmenu">