/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/cms.php

  • Committer: Gustav Hartvigsson
  • Date: 2013-05-26 19:52:16 UTC
  • mfrom: (90.1.10 lenasys2)
  • Revision ID: gustav.hartvigsson@gmail.com-20130526195216-fw2cqewtfn9qn539
merged Jonsson:s branch:


    Updated branch.

    Updated getActiveCourse in user-model, and fixed so bannermenu- and cms-view uses it.
    Removed links from bannermenu-view.
    Fixed so cms is loaded in home-controller when user is logged in.
    Added function for expand collapse courses in bannermenu-view.


    Removed coursemenu and statsmenu and replaced it with new combined sidemenu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
                        $this->load->model('user', '', TRUE);
12
12
                        $this->load->model('admin/admin_model', '', TRUE);
13
13
                }
14
 
                //Temporary function to be able to be logged in to reach the page
 
14
                
 
15
                /*
 
16
                 *Temporary function to be able to be logged in to reach the page
 
17
                 */
15
18
                public function tempLogin() {
16
19
                        $this->load->model('user');
17
20
                        $loginDetails = array(
28
31
                        $this->session->unset_userdata('authenticated');
29
32
                        redirect(base_url().'home', 'refresh');
30
33
                }
 
34
                
31
35
                /*
32
36
                 *      This function runs when the user navigates directly to this controller
33
37
                 */
50
54
                        $activeCourse = $this->user->getActiveCourse();
51
55
                        //Creates an array with all courses.
52
56
                        $courses = $this->admin_model->getCourses();
53
 
                        $categories = $this->admin_model->getCategories($activeCourse);
 
57
                        //Creates an array with all categories for active course
 
58
                        $categories = $this->admin_model->getCategories($activeCourse['courseID']);
 
59
                        
54
60
                        //Creates an array with the variables that the bannermenu-view is expecting.
55
61
                        $data = array(
56
62
                                'userType' => $userType,
62
68
                        
63
69
                        //Creates an array with the necessary css- and jsfiles needed for the views that are about to be shown.
64
70
                        $headTagData = array(
65
 
                                'cssFiles' => array('bannermenu', 'coursemenu', 'statsMenu', 'dummieContent'),//cms tillfällig sida
 
71
                                'cssFiles' => array('bannermenu', 'sidemenu', 'dummieContent'),//cms tillfällig sida
66
72
                                'jsFiles' => array('bannermenu')
67
73
                        );
68
74
                        
70
76
                        $this->load->view('headTag', array('headTagData' => $headTagData));     
71
77
                        
72
78
                        $this->load->view('bannermenu', $data);
73
 
                        $this->load->view('coursemenu', $data);
74
 
                        $this->load->view('statsMenu');
 
79
                        $this->load->view('sidemenu', $data);
75
80
                        $this->load->view('dummieContent');
76
81
                }
77
82
        }