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

  • Committer: galaxyAbstractor
  • Date: 2013-04-11 13:59:06 UTC
  • mto: (23.2.1 lenasys)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: galaxyabstractor@gmail.com-20130411135906-tohvazsxmw77otid
Removed codeigniter user guide, shouldn't be in the repo
Added and implemented CKEditor Wysiwyg editor for editing of pages
Made already uploaded code files visible as you edit a page
Implemented Adams dropdown menu in codeviewer

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
        public function index() {
7
7
                $this->load->model('admin/Admin_model');
8
8
                $courses = $this->Admin_model->getCourses();
 
9
                $this->load->view('admin/header', array("title" => "Index"));
9
10
                $this->load->view('admin/index', array("courses" => $courses));
10
11
        }
11
12
 
13
14
                
14
15
                if(!isset($_POST['cid'])){
15
16
                        $this->load->helper('form');
 
17
                        $this->load->view('admin/header', array("title" => "Add course"));
16
18
                        $this->load->view('admin/add_course');
17
19
                } else {
18
20
                        $this->load->model('admin/Admin_model');
24
26
        public function manageCourse($cid) {
25
27
                $this->load->model('admin/Admin_model');
26
28
                $examples = $this->Admin_model->getExamples($cid);
 
29
                $this->load->view('admin/header', array("title" => "Manage course - ".$cid));
27
30
                $this->load->view('admin/manage_course', array("examples" => $examples, "cid" => $cid));
28
31
        }
29
32
 
31
34
                
32
35
                if(!isset($_POST['example'])){
33
36
                        $this->load->helper('form');
 
37
                        $this->load->view('admin/header', array("title" => "Add example"));
34
38
                        $this->load->view('admin/add_example', array("cid" => $cid));
35
39
                } else {
36
40
                        $this->load->model('admin/Admin_model');
42
46
        public function manageExample($cid, $example) {
43
47
                $this->load->model('admin/Admin_model');
44
48
                $pages = $this->Admin_model->getPages($cid, $example);
 
49
                $this->load->view('admin/header', array("title" => "Manage example - ".$example." - ".$cid));
45
50
                $this->load->view('admin/manage_example', array("pages" => $pages, "cid" => $cid, "example" => $example));
46
51
        }
47
52
 
49
54
                
50
55
                if(!isset($_POST['page'])){
51
56
                        $this->load->helper('form');
 
57
                        $this->load->view('admin/header', array("title" => "Add page"));
52
58
                        $this->load->view('admin/add_page', array("cid" => $cid, "example" => $example));
53
59
                } else {
54
60
                        $this->load->model('admin/Admin_model');
60
66
        public function managePage($cid, $example, $page) {
61
67
                if(!isset($_POST['documentation'])){
62
68
                        $this->load->helper('form');
63
 
                        $this->load->view('admin/manage_page', array("cid" => $cid, "example" => $example, "page" => $page));
 
69
 
 
70
                        $this->load->model('codeviewer/Codeviewer_model');
 
71
 
 
72
                        $files = $this->Codeviewer_model->getFiles($cid, $example,$page);
 
73
                        $editorHTML = "";
 
74
                        foreach ($files as $file) {
 
75
                                $editorHTML .= $this->Codeviewer_model->showFile($file, "html");
 
76
                        }
 
77
 
 
78
                        $doc = $this->Codeviewer_model->getDoc($cid, $example, $page);
 
79
 
 
80
                        $this->load->view('admin/header', array("editors" => $editorHTML, "title" => "Manage page - ".$page." - ".$example." - ".$cid));
 
81
                        $this->load->view('admin/manage_page', array("cid" => $cid, "example" => $example, "page" => $page, "documentation" => $doc));
64
82
                } else {
65
83
                        $this->load->model('admin/Admin_model');
66
84
                        $this->Admin_model->updatePage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation']);