Get('TopicReview_View'); $TopicReview_AllValue = 112; if(!is_numeric($TopicReview_View)) $TopicReview_View=112; $Review_Perpage = (int)$objConfig->Get('Perpage_TopicReviews'); // TODO: add to config (in update script) if(!$Review_Perpage) $Review_Perpage="'all'"; if($TopicReview_View==$TopicReview_AllValue) { $TopicReview_ShowAll = 1; $TopicReview_Filter = ''; } else { // FILTERING CODE V. 1.2 $where_clauses = Array(); $q = ''; // Group #1: Link Statuses (active,pending,disabled) $Status = Array(); if($TopicReview_View & $Bit_Pending) $Status[] = STATUS_PENDING; if($TopicReview_View & $Bit_Active) $Status[] = STATUS_ACTIVE; if($TopicReview_View & $Bit_Disabled) $Status[] = STATUS_DISABLED; $where_clauses[] = 'Status IN ('.($Status?implode(',', $Status):'-1').')'; $TopicReview_Filter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : ''; } $list = $objSession->GetVariable('bb_review_direct_search'); $objTopicReviewList = new clsItemReviewList(); $objTopicReviewList->EnablePaging=true; $objTopicReviewList->PerPageVar='Perpage_TopicReviews'; $objTopicReviewList->PageEnvar='bb_var_list'; $objTopicReviewList->PageEnvarIndex='rp'; $objTopicReviewList->setPageFromENV(); $sql = 'SELECT * FROM '.$objLinkReviewList->SourceTable.' '; $where = 'WHERE (Module=\'In-Bulletin\') AND '; if( $objSession->HasCatPermission("TOPIC.VIEW") ) { if(!$list) { if($TopicReview_Filter) $where.=$TopicReview_Filter; $SearchQuery = ''; } else { $SearchQuery = $objTopicReviewList->AdminSearchWhereClause($list); if($SearchQuery) { $SearchQuery = ' ('.$SearchQuery.')'.($TopicReview_Filter ? ' AND ('.$TopicReview_Filter.')' : ''); $where.=$SearchQuery; } else { if($TopicReview_Filter) $where.=$TopicReview_Filter; } } $sql.=rtrim($where,' AND ').' ORDER BY Priority DESC'; $objTopicReviewList->Query_Item($sql,false,'set_last'); $tmp=rtrim(ltrim($where,'WHERE '),' AND '); $objTopicReviewList->QueryItemCount = TableCount($objTopicReviewList->SourceTable, $tmp, 0); $CatTotal = QueryCount('SELECT * FROM '.$objTopicReviewList->SourceTable.' WHERE Module=\'In-Bulletin\''); $caption = admin_language('la_ItemTab_Topics'); $ItemTabs->AddTab(admin_language("la_ItemTab_Topics"),"topic_reviews",$objTopicReviewList->QueryItemCount, $m_tab_Topic_hide,$CatTotal); } $lang_Reviews = language("la_Text_Reviews"); $TotalItemCount += $objTopicReviewList->QueryItemCount; print << var Review_Perpage = $Review_Perpage; var TopicReview_View = $TopicReview_View; var TopicTitle = '$caption'; var lang_Reviews = "$lang_Reviews"; \$fw_menus['rev.topics_view_menu'] = function() { // filtring menu \$Menus['rev.topics_filtring_menu'] = new Menu(lang_View); \$Menus['rev.topics_filtring_menu'].addMenuItem(lang_All,"config_val('TopicReview_View', $TopicReview_AllValue);",TopicReview_View==$TopicReview_AllValue); \$Menus['rev.topics_filtring_menu'].addMenuItem(lang_None,"config_val('TopicReview_View', 0);",TopicReview_View==0); \$Menus['rev.topics_filtring_menu'].addMenuSeparator(); \$Menus['rev.topics_filtring_menu'].addMenuItem(lang_Active,"FlipBit('TopicReview_View',TopicReview_View,6);",BitStatus(TopicReview_View,6)); \$Menus['rev.topics_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('TopicReview_View',TopicReview_View,5);", BitStatus(TopicReview_View,5)); \$Menus['rev.topics_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('TopicReview_View',TopicReview_View,4);",BitStatus(TopicReview_View,4)); // perpage menu \$Menus['rev.topics_perpage_menu'] = new Menu(lang_PerPage); \$Menus['rev.topics_perpage_menu'].addMenuItem("10","config_val('Perpage_TopicReviews', '10');",RadioIsSelected(Review_Perpage,10)); \$Menus['rev.topics_perpage_menu'].addMenuItem("20","config_val('Perpage_TopicReviews', '20');",RadioIsSelected(Review_Perpage,20)); \$Menus['rev.topics_perpage_menu'].addMenuItem("50","config_val('Perpage_TopicReviews', '50');",RadioIsSelected(Review_Perpage,50)); \$Menus['rev.topics_perpage_menu'].addMenuItem("100","config_val('Perpage_TopicReviews', '100');",RadioIsSelected(Review_Perpage,100)); \$Menus['rev.topics_perpage_menu'].addMenuItem("500","config_val('Perpage_TopicReviews', '500');",RadioIsSelected(Review_Perpage,500)); // select menu \$Menus['rev.topics_select_menu'] = new Menu(lang_Select); \$Menus['rev.topics_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); \$Menus['rev.topics_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); \$Menus['rev.topics_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); // view menu \$Menus['rev.topics_view_menu'] = new Menu(TopicTitle); \$Menus['rev.topics_view_menu'].addMenuItem( \$Menus['rev.topics_filtring_menu'] ); \$Menus['rev.topics_view_menu'].addMenuItem( \$Menus['rev.topics_perpage_menu'] ); \$Menus['rev.topics_view_menu'].addMenuItem( \$Menus['rev.topics_select_menu'] ); } END; ?>