first stage finished: ready to publish to production; does not support users and...
[living-lab-site.git] / application / controllers / catalog.php
index 087275d..3ed020f 100644 (file)
@@ -43,13 +43,9 @@ class Catalog extends CI_Controller {
                
                $params = array(        'title' => $this->config->item('site_name'),
                                                        'css' => array(
-                                                               'catalog.css', 
-                                                               'jquery-ui.css'
-                                                       ),
-                                                       'js' => array(
-                                                               'jquery.js',
-                                                               'jquery-ui.js'
+                                                               'catalog.css'
                                                        ),
+                                                       //'js' => array(),
                                                        //'metas' => array('description'=>'','keywords'=>'')
                                                        );
                $this->load->library('html_head_params', $params);
@@ -71,13 +67,8 @@ class Catalog extends CI_Controller {
        public function test($page = 0)
        {
                $params = array(        'title' => 'Test - '. $this->config->item('site_name'),
-                                                       'css' => array(
-                                                               'jquery-ui.css'
-                                                               ),
-                                                       'js' => array(
-                                                               'jquery.js',
-                                                               'jquery-ui.js'
-                                                       ),
+                                                       //'css' => array(),
+                                                       //'js' => array(),
                                                        //'metas' => array('description'=>'','keywords'=>'')
                        );
                $this->load->library('html_head_params', $params);
@@ -94,24 +85,25 @@ class Catalog extends CI_Controller {
                $this->load->view('html_end');
        }
        
-       public function category($category_id, $offset = 0)
+       public function category($category_name, $offset = 0)
        {
                // **
                // ** LOADING MODEL
                // **
+               // Video Category
+               $categories = $this->config->item('categories');
+               $category_id = array_search($category_name, $categories);
+               $vs_data['category_name'] = $category_name;
+               $vs_data['category_id'] = $category_id;
+               $vs_data['category_title'] = $category_name ?
+               $this->lang->line("ui_categ_$category_name") : $category_name;          
+               
                // Retrieve videos summary.
                $this->load->model('videos_model');
                $vs_data['videos'] = $this->videos_model->get_videos_summary(
-                       $category_id, intval($offset),
+                       $vs_data['category_id'], intval($offset),
                        $this->config->item('videos_per_page'));
                
-               // Video Category
-               $categories = $this->config->item('categories');
-               $category_name = $categories[$category_id];
-               $vs_data['category_title'] = $category_name ?
-                       $this->lang->line("ui_categ_$category_name") : $category_name;
-               $vs_data['category_id'] = $category_id;
-               
                // Pagination
                $this->load->library('pagination');
                $pg_config['base_url'] = site_url("catalog/category/$category_id/");
@@ -128,13 +120,9 @@ class Catalog extends CI_Controller {
                
                $params = array(        'title' => $this->config->item('site_name'),
                                                        'css' => array(
-                                                               'catalog.css', 
-                                                               'jquery-ui.css'
-                                                       ),
-                                                       'js' => array(
-                                                               'jquery.js',
-                                                               'jquery-ui.js'
+                                                               'catalog.css'
                                                        ),
+                                                       //'js' => array(),
                                                        //'metas' => array('description'=>'','keywords'=>'')
                                                        );
                $this->load->library('html_head_params', $params);
@@ -146,8 +134,7 @@ class Catalog extends CI_Controller {
                $this->load->view('header');
                
                $main_params['content'] = $this->load->view('catalog/category_view', $data, TRUE);
-               // TODO: side
-               $main_params['side'] = '<h1>Side Box</h1><p>TODO: Put side box content here</p>';
+               $main_params['side'] = $this->load->view('side_default.php', NULL, TRUE);
                $this->load->view('main', $main_params);
                
                $this->load->view('footer');