/** * Display all images of slider * * @access public * @author Nguyen Van Hiep * * @version 1.0 * @since 1.0 */ public function action_index() { $view = View::forge('admin/article/index'); $view->cats = Model_Categories::get_cat_list(true, Input::get('lang')); $view->total = (int) Model_Article::count(); $view->in_cat = null; $view->selected_cat_view = Input::get('cat') == '' ? 'cat' : Input::get('cat'); $view->selected_lang_view = Input::get('lang') == '' ? 'lang' : Input::get('lang'); $view->langs = array('' => '---'); foreach (glob(LANG_DIR . '/*', GLOB_ONLYDIR) as $lang_dir) { $short_lang = str_replace(LANG_DIR . '/', '', $lang_dir); $view->langs[$short_lang] = $short_lang; } $view->in_cat = count(Model_Article::get_articles_offset(0, 9999, Input::get('cat'), Input::get('lang'))); $config = array('pagination_url' => Uri::base() . 'admin/article?cat=' . Input::get('cat') . '&lang=' . Input::get('lang'), 'total_items' => $view->in_cat, 'per_page' => 30, 'uri_segment' => 'page', 'num_links' => 7); $pag = Pagination::forge('paging', $config); $view->arts = Model_Article::get_articles_offset($pag->offset, $pag->per_page, Input::get('cat'), Input::get('lang')); $view->pag = $pag; $this->template->title = __('art.arts'); $this->template->content = $view; }