/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/application/controllers/codeviewer.php

  • Committer: Gustav Hatvigsson
  • Date: 2013-05-28 13:19:00 UTC
  • mfrom: (115.2.1 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130528131900-e2df2btpzbjodzgj
Merged Fransson:s changes and fixed a conflict.

Fixed so that codeviewer uses the new headermenu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        */
22
22
        public function show($cid = null, $category = null, $subcategory = null, $example = null){
23
23
                if(!is_null($cid) && !is_null($category) && !is_null($subcategory) && !is_null($example)){
 
24
                        
24
25
                        $headTagData['cssFiles'] = array('headTag', 'header', 'codeviewer');
25
26
                        $headTagData['jsFiles'] = array('ace/ace', 'header');
26
 
                        $this->load->model('user');                     
 
27
                        
 
28
                        $this->load->model('codeviewer/Codeviewer_model');
 
29
                        $this->load->model('user', '', TRUE);
 
30
                        $this->load->model('admin/admin_model', '', TRUE);
 
31
                        
 
32
                        $editorHTML = $this->Codeviewer_model->getCode($cid, $category, $subcategory, $example);
 
33
                        
 
34
                        $activeCourse = $this->user->getActiveCourse();
27
35
                        $userInfo = array(
28
36
                                'userType' => $this->user->getUserType(),
29
 
                                'userName' => $this->user->getUserName()
 
37
                                'userName' => $this->user->getUserName(),
 
38
                                'courses' => $this->admin_model->getCourses(),
 
39
                                'categories' => $this->admin_model->getCategories($activeCourse['courseID']),
 
40
                                'activeCourse' => $activeCourse
30
41
                        );
31
 
                        $this->load->view('headTag', array('headTagData' => $headTagData));
32
 
                        $this->load->view('header', $userInfo);
33
 
                        $this->load->model('codeviewer/Codeviewer_model');
34
 
                        $editorHTML = $this->Codeviewer_model->getCode($cid, $category, $subcategory, $example);
 
42
                        
35
43
                        $this->load->helper('form');
 
44
                        
36
45
                        // $doc = $this->Codeviewer_model->getDoc($cid, $category, $subcategory, $example);
37
46
                        // This loads the view. It's stored in application/views/codeviewer/codeviewer.php
38
47
                        // Do note that application/views should not be in the first argument of view()
39
48
                        // The second argument is data to be shown in the view. "editors" => "test" would
40
49
                        // generate an $editors variable in the view containing "test"
 
50
                        $this->load->view('headTag', array('headTagData' => $headTagData));
 
51
                        $this->load->view('bannermenu', $userInfo);
41
52
                        $this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML));
42
53
                } else {
43
54
                        /*Redirects to the startpage if no arguments are supplied.*/