category page made, but without pagination
[living-lab-site.git] / application / controllers / catalog.php
1 <?php
2
3 /**
4  * Class Catalog controlls video hierarchy and searching
5  *
6  * @category    Controller
7  * @author              Călin-Andrei Burloiu
8  */
9 class Catalog extends CI_Controller {
10         
11         public function index()
12         {
13                 // Retrieve videos summary.
14                 $this->load->model('videos_model');
15                 $data['videos'] = $this->videos_model->get_videos_summary();
16                 
17                 $params = array(        'title' => $this->config->item('site_name'),
18                                                         //'stylesheets' => array(),
19                                                         //'javascripts' => array(),
20                                                         //'metas' => array('description'=>'','keywords'=>'')
21                                                         );
22                 $this->load->library('html_head_params', $params);
23                 $this->load->view('html_begin', $this->html_head_params);
24                 $this->load->view('header');
25                 
26                 $this->load->view('catalog/index_view', $data);
27                 
28                 $this->load->view('footer');
29                 $this->load->view('html_end');
30         }
31         
32         public function test()
33         {
34                 $this->load->helper('url');
35                 
36                 echo '<a href="/">link</a>';
37         }
38         
39         public function category($category_id)
40         {
41                 // Retrieve videos summary.
42                 $this->load->model('videos_model');
43                 $data['videos'] = $this->videos_model->get_videos_summary($category_id);
44                 $categories = $this->config->item('categories');
45                 $data['category'] = $categories[$category_id];
46                 $data['category_id'] = $category_id;
47                 
48                 $params = array(        'title' => $this->config->item('site_name'),
49                                                         'stylesheets' => array('catalog.css'),
50                                                         //'javascripts' => array(),
51                                                         //'metas' => array('description'=>'','keywords'=>'')
52                                                         );
53                 $this->load->library('html_head_params', $params);
54                 $this->load->view('html_begin', $this->html_head_params);
55                 $this->load->view('header');
56                 
57                 $this->load->view('catalog/category_view', $data);
58                 
59                 $this->load->view('footer');
60                 $this->load->view('html_end');
61         }
62         
63         public function search($query_str)
64         {
65                 echo $query_str;
66         }
67 }
68
69 /* End of file catalog.php */
70 /* Location: ./application/controllers/catalog.php */