Get('LinkReview_View'); $LinkReview_AllValue = 112; if(!is_numeric($LinkReview_View)) $LinkReview_View=112; $Review_Perpage = (int)$objConfig->Get('Perpage_LinkReviews'); if(!$Review_Perpage) $Review_Perpage="'all'"; if($LinkReview_View==$LinkReview_AllValue) { $LinkReview_ShowAll = 1; $LinkReview_Filter = ''; } else { // FILTERING CODE V. 1.2 $where_clauses = Array(); $q = ''; // Group #1: Link Statuses (active,pending,disabled) $Status = Array(); if($LinkReview_View & $Bit_Pending) $Status[] = STATUS_PENDING; if($LinkReview_View & $Bit_Active) $Status[] = STATUS_ACTIVE; if($LinkReview_View & $Bit_Disabled) $Status[] = STATUS_DISABLED; $where_clauses[] = 'Status IN ('.($Status?implode(',', $Status):'-1').')'; $LinkReview_Filter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : ''; } $list = $objSession->GetVariable('l_review_direct_search'); $objLinkReviewList = new clsItemReviewList(); $objLinkReviewList->EnablePaging=true; $objLinkReviewList->PerPageVar='Perpage_LinkReviews'; $objLinkReviewList->PageEnvar='l_var_list'; $objLinkReviewList->PageEnvarIndex='rp'; $objLinkReviewList->setPageFromENV(); $sql = 'SELECT * FROM '.$objLinkReviewList->SourceTable.' '; $where = 'WHERE (Module=\'In-Link\') AND '; if( $objSession->HasCatPermission("LINK.VIEW") ) { if(!$list) { if($LinkReview_Filter) $where.=$LinkReview_Filter; $SearchQuery = ''; } else { $SearchQuery = $objLinkReviewList->AdminSearchWhereClause($list); if($SearchQuery) { $SearchQuery = ' ('.$SearchQuery.')'.($LinkReview_Filter ? ' AND ('.$LinkReview_Filter.')' : ''); $where.=$SearchQuery; } else { if($LinkReview_Filter) $where.=$LinkReview_Filter; } } $sql.=rtrim($where,' AND ').' ORDER BY Priority DESC'; $objLinkReviewList->Query_Item($sql,false,'set_last'); $tmp=rtrim(ltrim($where,'WHERE '),' AND '); $objLinkReviewList->QueryItemCount = TableCount($objLinkReviewList->SourceTable, $tmp, 0); $CatTotal = QueryCount('SELECT * FROM '.$objLinkReviewList->SourceTable.' WHERE Module=\'In-Link\''); $caption = language("la_ItemTab_Links"); $ItemTabs->AddTab(language("la_ItemTab_Links"),"link_reviews",$objLinkReviewList->QueryItemCount, $m_tab_Links_hide,$CatTotal); } $lang_Reviews = language("la_Text_Reviews"); $TotalItemCount += $objLinkReviewList->QueryItemCount; print << var Review_Perpage = $Review_Perpage; var LinkReview_View = $LinkReview_View; var LinkTitle = '$caption'; var lang_Reviews = "$lang_Reviews"; \$fw_menus['rev.links_view_menu'] = function() { // filtring menu \$Menus['rev.links_filtring_menu'] = new Menu(lang_View); \$Menus['rev.links_filtring_menu'].addMenuItem(lang_All,"config_val('LinkReview_View', $LinkReview_AllValue);",LinkReview_View==$LinkReview_AllValue); \$Menus['rev.links_filtring_menu'].addMenuItem(lang_None,"config_val('LinkReview_View', 0);",LinkReview_View==0); \$Menus['rev.links_filtring_menu'].addMenuSeparator(); \$Menus['rev.links_filtring_menu'].addMenuItem(lang_Active,"FlipBit('LinkReview_View',LinkReview_View,6);",BitStatus(LinkReview_View,6)); \$Menus['rev.links_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('LinkReview_View',LinkReview_View,5);", BitStatus(LinkReview_View,5)); \$Menus['rev.links_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('LinkReview_View',LinkReview_View,4);",BitStatus(LinkReview_View,4)); // perpage menu \$Menus['rev.links_perpage_menu'] = new Menu(lang_PerPage); \$Menus['rev.links_perpage_menu'].addMenuItem("10","config_val('Perpage_LinkReviews', '10');",RadioIsSelected(Review_Perpage,10)); \$Menus['rev.links_perpage_menu'].addMenuItem("20","config_val('Perpage_LinkReviews', '20');",RadioIsSelected(Review_Perpage,20)); \$Menus['rev.links_perpage_menu'].addMenuItem("50","config_val('Perpage_LinkReviews', '50');",RadioIsSelected(Review_Perpage,50)); \$Menus['rev.links_perpage_menu'].addMenuItem("100","config_val('Perpage_LinkReviews', '100');",RadioIsSelected(Review_Perpage,100)); \$Menus['rev.links_perpage_menu'].addMenuItem("500","config_val('Perpage_LinkReviews', '500');",RadioIsSelected(Review_Perpage,500)); // select menu \$Menus['rev.links_select_menu'] = new Menu(lang_Select); \$Menus['rev.links_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); \$Menus['rev.links_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); \$Menus['rev.links_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); // view menu \$Menus['rev.links_view_menu'] = new Menu(LinkTitle); \$Menus['rev.links_view_menu'].addMenuItem( \$Menus['rev.links_filtring_menu'] ); \$Menus['rev.links_view_menu'].addMenuItem( \$Menus['rev.links_perpage_menu'] ); \$Menus['rev.links_view_menu'].addMenuItem( \$Menus['rev.links_select_menu'] ); } function SubmitSearch(formname, action) { var f = document.getElementById(formname); if(f) { f.Action.value = action; f.submit(); } } END; ?>