4 * Class Catalog controls video hierarchy and searching
7 * @author Călin-Andrei Burloiu
9 class Catalog extends CI_Controller {
11 public function __construct()
13 parent::__construct();
15 //$this->lang->load('catalog');
18 public function index()
23 // Retrieve videos summary.
24 $this->load->model('videos_model');
25 foreach ($this->config->item('categories') as $id => $name)
28 $vs_data['videos'] = $this->videos_model->get_videos_summary(
29 $id, 0, $this->config->item('videos_per_row'));
32 $vs_data['category_title'] = $name ?
33 $this->lang->line("ui_categ_$name") : $name;
34 $vs_data['category_id'] = $id;
36 // Pagination (not required)
37 $vs_data['pagination'] = '';
39 $data['videos_summaries'][] =
40 $this->load->view('catalog/videos_summary_view',
44 $params = array( 'title' => $this->config->item('site_name'),
53 //'metas' => array('description'=>'','keywords'=>'')
55 $this->load->library('html_head_params', $params);
60 $this->load->view('html_begin', $this->html_head_params);
61 $this->load->view('header', array('selected_menu' => 'home'));
63 $main_params['content'] = $this->load->view('catalog/index_view', $data, TRUE);
64 $main_params['side'] = $this->load->view('side_default.php', NULL, TRUE);
65 $this->load->view('main', $main_params);
67 $this->load->view('footer');
68 $this->load->view('html_end');
71 public function test($page = 0)
73 $params = array( 'title' => 'Test - '. $this->config->item('site_name'),
81 //'metas' => array('description'=>'','keywords'=>'')
83 $this->load->library('html_head_params', $params);
88 $this->load->view('html_begin', $this->html_head_params);
89 $this->load->view('header', array('selected_menu' => 'home'));
91 $this->load->view('echo', array('output'=>'Test Page', 'clear'=>TRUE));
93 $this->load->view('footer');
94 $this->load->view('html_end');
97 public function category($category_id, $offset = 0)
102 // Retrieve videos summary.
103 $this->load->model('videos_model');
104 $vs_data['videos'] = $this->videos_model->get_videos_summary(
105 $category_id, intval($offset),
106 $this->config->item('videos_per_page'));
109 $categories = $this->config->item('categories');
110 $category_name = $categories[$category_id];
111 $vs_data['category_title'] = $category_name ?
112 $this->lang->line("ui_categ_$category_name") : $category_name;
113 $vs_data['category_id'] = $category_id;
116 $this->load->library('pagination');
117 $pg_config['base_url'] = site_url("catalog/category/$category_id/");
118 $pg_config['uri_segment'] = 4;
119 $pg_config['total_rows'] = $this->videos_model->get_videos_count(
121 $pg_config['per_page'] = $this->config->item('videos_per_page');
122 $this->pagination->initialize($pg_config);
123 $vs_data['pagination'] = $this->pagination->create_links();
126 $data['video_summary'] = $this->load->view('catalog/videos_summary_view',
129 $params = array( 'title' => $this->config->item('site_name'),
138 //'metas' => array('description'=>'','keywords'=>'')
140 $this->load->library('html_head_params', $params);
145 $this->load->view('html_begin', $this->html_head_params);
146 $this->load->view('header');
148 $main_params['content'] = $this->load->view('catalog/category_view', $data, TRUE);
149 $main_params['side'] = $this->load->view('side_default.php', NULL, TRUE);
150 $this->load->view('main', $main_params);
152 $this->load->view('footer');
153 $this->load->view('html_end');
156 public function search($query_str)
162 /* End of file catalog.php */
163 /* Location: ./application/controllers/catalog.php */