Get('NewsReview_View'); $NewsReview_AllValue = 112; if(!is_numeric($NewsReview_View)) $NewsReview_View=112; $Review_Perpage = (int)$objConfig->Get('Perpage_NewsReviews'); if(!$Review_Perpage) $Review_Perpage="'all'"; if($NewsReview_View==$NewsReview_AllValue) { $NewsReview_ShowAll = 1; $NewsReview_Filter = ''; } else { // FILTERING CODE V. 1.2 $where_clauses = Array(); $q = ''; // Group #1: Link Statuses (active,pending,disabled) $Status = Array(); if($NewsReview_View & $Bit_Pending) $Status[] = STATUS_PENDING; if($NewsReview_View & $Bit_Active) $Status[] = STATUS_ACTIVE; if($NewsReview_View & $Bit_Disabled) $Status[] = STATUS_DISABLED; $where_clauses[] = 'Status IN ('.($Status?implode(',', $Status):'-1').')'; $NewsReview_Filter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : ''; } $list = $objSession->GetVariable('n_review_direct_search'); $objArticleReviewList = new clsItemReviewList(); $objArticleReviewList->EnablePaging=true; $objArticleReviewList->PerPageVar='Perpage_NewsReviews'; $objArticleReviewList->PageEnvar='n_var_list'; $objArticleReviewList->PageEnvarIndex='rp'; $objArticleReviewList->setPageFromENV(); $sql = 'SELECT * FROM '.$objArticleReviewList->SourceTable.' '; $where = 'WHERE (Module=\'In-News\') AND '; if( $objSession->HasCatPermission("NEWS.VIEW") ) { if(!$list) { if($NewsReview_Filter) $where.=$NewsReview_Filter; $SearchQuery = ''; } else { $SearchQuery = $objArticleReviewList->AdminSearchWhereClause($list); if($SearchQuery) { $SearchQuery = ' ('.$SearchQuery.')'.($NewsReview_Filter ? ' AND ('.$NewsReview_Filter.')' : ''); $where.=$SearchQuery; } else { if($NewsReview_Filter) $where.=$NewsReview_Filter; } } $sql.=rtrim($where,' AND ').' ORDER BY Priority DESC'; $objArticleReviewList->Query_Item($sql,false,'set_last'); $tmp=rtrim(ltrim($where,'WHERE '),' AND '); $objArticleReviewList->QueryItemCount = TableCount($objArticleReviewList->SourceTable, $tmp, 0); $CatTotal = QueryCount('SELECT * FROM '.$objArticleReviewList->SourceTable.' WHERE Module=\'In-News\''); $caption = language("la_ItemTab_News"); $ItemTabs->AddTab(language("la_ItemTab_News"),"news_reviews",$objArticleReviewList->QueryItemCount, $m_tab_News_hide,$CatTotal); } $lang_Reviews = language("la_Text_Reviews"); $TotalItemCount += $objArticleReviewList->QueryItemCount; print << var Review_Perpage = $Review_Perpage; var NewsReview_View = $NewsReview_View; var NewsTitle = '$caption'; var lang_Reviews = "$lang_Reviews"; \$fw_menus['rev.articles_view_menu'] = function() { // filtring menu \$Menus['rev.articles_filtring_menu'] = new Menu(lang_View); \$Menus['rev.articles_filtring_menu'].addMenuItem(lang_All,"config_val('NewsReview_View', $NewsReview_AllValue);",NewsReview_View==$NewsReview_AllValue); \$Menus['rev.articles_filtring_menu'].addMenuItem(lang_None,"config_val('NewsReview_View', 0);",NewsReview_View==0); \$Menus['rev.articles_filtring_menu'].addMenuSeparator(); \$Menus['rev.articles_filtring_menu'].addMenuItem(lang_Active,"FlipBit('NewsReview_View',NewsReview_View,6);",BitStatus(NewsReview_View,6)); \$Menus['rev.articles_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('NewsReview_View',NewsReview_View,5);", BitStatus(NewsReview_View,5)); \$Menus['rev.articles_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('NewsReview_View',NewsReview_View,4);",BitStatus(NewsReview_View,4)); // perpage menu \$Menus['rev.articles_perpage_menu'] = new Menu(lang_PerPage); \$Menus['rev.articles_perpage_menu'].addMenuItem("10","config_val('Perpage_NewsReviews', '10');",RadioIsSelected(Review_Perpage,10)); \$Menus['rev.articles_perpage_menu'].addMenuItem("20","config_val('Perpage_NewsReviews', '20');",RadioIsSelected(Review_Perpage,20)); \$Menus['rev.articles_perpage_menu'].addMenuItem("50","config_val('Perpage_NewsReviews', '50');",RadioIsSelected(Review_Perpage,50)); \$Menus['rev.articles_perpage_menu'].addMenuItem("100","config_val('Perpage_NewsReviews', '100');",RadioIsSelected(Review_Perpage,100)); \$Menus['rev.articles_perpage_menu'].addMenuItem("500","config_val('Perpage_NewsReviews', '500');",RadioIsSelected(Review_Perpage,500)); // select menu \$Menus['rev.articles_select_menu'] = new Menu(lang_Select); \$Menus['rev.articles_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); \$Menus['rev.articles_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); \$Menus['rev.articles_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); // view menu \$Menus['rev.articles_view_menu'] = new Menu(NewsTitle); \$Menus['rev.articles_view_menu'].addMenuItem( \$Menus['rev.articles_filtring_menu'] ); \$Menus['rev.articles_view_menu'].addMenuItem( \$Menus['rev.articles_perpage_menu'] ); \$Menus['rev.articles_view_menu'].addMenuItem( \$Menus['rev.articles_select_menu'] ); } END; ?>