/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 Hatvigsson
  • Date: 2013-05-28 09:02:36 UTC
  • mfrom: (90.1.13 lenasys2)
  • Revision ID: gustav.hartvigsson@gmail.com-20130528090236-91bqpnjeqfxfoh8e
Merged Jonsson:s changes:

Changed so that cms-controller loads filetree (before known as examplesController, examplesBody, examplesMenu).
Also changed to describing filenames and names for attributes and functions in css, php-view and in model that is used for this.
Started working on cmsindex-view and -css.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
                        //Load required library
11
11
                        $this->load->model('user', '', TRUE);
12
12
                        $this->load->model('admin/admin_model', '', TRUE);
 
13
                        $this->load->model('filetree');
13
14
                }
14
15
                
15
16
                /*
66
67
                                'activeCourse' => $activeCourse
67
68
                        );
68
69
                        
 
70
                        //Creates an array with the variables that the cmsindex-view is expecting.
 
71
                        $filetree = array();
 
72
                        
 
73
                        //Categories
 
74
                        $categories = $this->filetree->getCategories($data['activeCourse']['courseID']);
 
75
                        foreach ($categories as $category) {
 
76
                                $filetree[$category->categoryName] = array();
 
77
                                
 
78
                                //Sub categories
 
79
                                $subcategories = $this->filetree->getSubCategories($category->categoryName, $data['activeCourse']['courseID']);
 
80
                                foreach ($subcategories as $subcategory) {
 
81
                                        $filetree[$category->categoryName][$subcategory->subCategoryName] = array();
 
82
                                        
 
83
                                        //Examples
 
84
                                        $filetree[$category->categoryName][$subcategory->subCategoryName]['examples'] = array();
 
85
                                        $examples = $this->filetree->getExamples($subcategory->subCategoryName, $category->categoryName, $data['activeCourse']['courseID']);
 
86
                                        foreach ($examples as $example) {
 
87
                                                $filetree[$category->categoryName][$subcategory->subCategoryName]['examples'][] = $example->exampleName;
 
88
                                        }
 
89
                                        
 
90
                                        //Quizzes
 
91
                                        $filetree[$category->categoryName][$subcategory->subCategoryName]['quizzes'] = array();
 
92
                                        $quizzes = $this->filetree->getQuizzes($subcategory->subCategoryName, $category->categoryName, $data['activeCourse']['courseID']);
 
93
                                        foreach ($quizzes as $quiz) {
 
94
                                                $filetree[$category->categoryName][$subcategory->subCategoryName]['quizzes'][] = $quiz->quizNr;
 
95
                                        }
 
96
                                }
 
97
                        }
 
98
                        
69
99
                        //Creates an array with the necessary css- and jsfiles needed for the views that are about to be shown.
70
100
                        $headTagData = array(
71
 
                                'cssFiles' => array('bannermenu', 'sidemenu', 'dummieContent'),//cms tillfällig sida
 
101
                                'cssFiles' => array('bannermenu', 'sidemenu', 'cmsindex'),
72
102
                                'jsFiles' => array('bannermenu')
73
103
                        );
74
104
                        
77
107
                        
78
108
                        $this->load->view('bannermenu', $data);
79
109
                        $this->load->view('sidemenu', $data);
80
 
                        $this->load->view('dummieContent');
 
110
                        $this->load->view('cmsindex', array('filetree' => $filetree));
81
111
                }
82
112
        }
83
113
?>