simple interface ready: index page which lists all video assets and watch page to...
[living-lab-site.git] / application / controllers / video.php
1 <?php
2
3 /**
4  * Class Video controlls video items handling: watching, commenting, rating,
5  * adding etc.
6  *
7  * @category    Controller
8  * @author              Călin-Andrei Burloiu
9  */
10 class Video extends CI_Controller {
11
12         public function __construct()
13         {
14                 parent::__construct();
15         }
16         
17         public function index()
18         {
19                 
20         }
21         
22         /**
23          * The page used for watching a video
24          *
25          * @param       string $id      DB id of the video
26          * @param       string $name    `name` of the video from DB
27          * @param       string $plugin  video plugin ('vlc', 'html5'). If it's set 
28          * to NULL or 'auto', the plugin is automatically selected.
29          */
30         public function watch($id, $name = NULL, $plugin = NULL)
31         {
32                 $this->load->helper('url');
33                 
34                 // Retrieve video information.
35                 $this->load->model('videos_model');
36                 $data['video'] = $this->videos_model->get_video($id, $name);
37                 $data['plugin'] = ($plugin === NULL ? 'auto' : $plugin);
38                 
39                 // Display page.
40                 $params = array(        'title' => $data['video']['title'] . ' -- '
41                                                                 . $this->config->item('site_name'),
42                                                         'stylesheets' => array('jquery-ui.css', 'NextSharePC-interface.css'),
43                                                         'javascripts' => array('jquery.min.js', 'jquery-ui.min.js', 'NextSharePC-interface.js'),
44                                                         //'metas' => array('description'=>'','keywords'=>'')
45                                                         );
46                 $this->load->library('html_head_params', $params);
47                 $this->load->view('html_begin', $this->html_head_params);
48                 $this->load->view('header');
49                 
50                 $this->load->view('video/watch_view', $data);
51                 
52                 $this->load->view('footer');
53                 $this->load->view('html_end');
54         }
55 }
56
57 /* End of file video.php */
58 /* Location: ./application/controllers/video.php */