public function beforeRender() { $articlesParams = array(); foreach ((array) \ArticleType::GetArticleTypes(true) as $one_art_type_name) { $one_art_type = new \ArticleType($one_art_type_name); if ($one_art_type->getFilterStatus()) { $articlesParams[] = new ComparisonOperation('type', new Operator('not', 'string'), $one_art_type->getTypeName()); } } $articlesOrders = array(array('field' => 'bylastupdate', 'dir' => 'desc')); $this->items = Article::GetList($articlesParams, $articlesOrders, 0, self::LIMIT, $count = 0); }
} $_REQUEST['section'] = $sectionFiltersArray[3]; } } } foreach ($filters as $name => $opts) { if (isset($_REQUEST[$name]) && (!empty($_REQUEST[$name]) || $_REQUEST[$name] === 0)) { $field = !empty($fields[$name]) ? $fields[$name] : $name; $articlesParams[] = new ComparisonOperation($field, new Operator($opts[0], $opts[1]), $_REQUEST[$name]); } } if (empty($_REQUEST['showtype']) || $_REQUEST['showtype'] != 'with_filtered') { // limit articles of filtered types by default foreach ((array) \ArticleType::GetArticleTypes(true) as $one_art_type_name) { $one_art_type = new \ArticleType($one_art_type_name); if ($one_art_type->getFilterStatus()) { $articlesParams[] = new ComparisonOperation('type', new Operator('not', 'string'), $one_art_type->getTypeName()); } } } // search if (isset($_REQUEST['sSearch']) && strlen($_REQUEST['sSearch']) > 0) { $search_phrase = $_REQUEST['sSearch']; //$articlesParams[] = new ComparisonOperation('search_phrase', new Operator('is', 'integer'), $search_phrase); $articlesParams[] = new ComparisonOperation('search_phrase', new Operator('like', 'string'), "__match_all." . $search_phrase); } // sorting $cols = $list->getColumnKeys(); $sortOptions = array('Number' => 'bynumber', 'Order' => 'bysectionorder', 'Name' => 'byname', 'Comments' => 'bycomments', 'Reads' => 'bypopularity', 'CreateDate' => 'bycreationdate', 'PublishDate' => 'bypublishdate'); $sortBy = 'bysectionorder'; $sortDir = 'asc';
} else { $hideShowText = $translator->trans('hide', array(), 'article_types'); $hideShowStatus = 'hide'; $hideShowImage = "is_shown.png"; } if ($currentArticleType->commentsEnabled()) { $commentChangeText = $translator->trans('deactivate', array(), 'article_types'); $commentImage = "is_shown.png"; } else { $commentChangeText = $translator->trans('activate', array(), 'article_types'); $commentImage = "is_hidden.png"; } $filterChangeValue = 1; $filterChangeText = $translator->trans('filter', array(), 'article_types'); $filterImage = "is_shown.png"; if ($currentArticleType->getFilterStatus()) { $filterChangeValue = 0; $filterChangeText = $translator->trans('list', array(), 'article_types'); $filterImage = "is_hidden.png"; } ?> <TR <?php if ($color) { $color = 0; ?> class="list_row_even"<?php } else { $color = 1; ?> class="list_row_odd"<?php }