/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:
2
2
 
3
3
class Admin extends CI_Controller {
4
4
 
5
 
        /*
6
 
        * This is the index function. It will be the one called if you do not specify a
7
 
        * function in the url, example: /admin/
8
 
        */
 
5
 
9
6
        public function index() {
10
7
                $this->load->model('admin/Admin_model');
11
8
                $courses = $this->Admin_model->getCourses();
41
38
                        $this->load->view('admin/add_example', array("cid" => $cid));
42
39
                } else {
43
40
                        $this->load->model('admin/Admin_model');
44
 
                        $this->Admin_model->addExample($_POST['cid'], $_POST['example'], $_POST['description']);
 
41
                        $this->Admin_model->addExample($_POST['cid'], $_POST['example']);
45
42
                        redirect("admin/");
46
43
                }
47
44
        }
61
58
                        $this->load->view('admin/add_page', array("cid" => $cid, "example" => $example));
62
59
                } else {
63
60
                        $this->load->model('admin/Admin_model');
64
 
                        $this->Admin_model->addPage($_POST['cid'], $_POST['example'],$_POST['page']);
 
61
                        $this->Admin_model->addPage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation']);
65
62
                        redirect("admin/");
66
63
                }
67
64
        }
72
69
 
73
70
                        $this->load->model('codeviewer/Codeviewer_model');
74
71
 
75
 
                        
76
 
                        $editorHTML = $this->Codeviewer_model->getCode($cid, $example, $page);
 
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
77
 
78
 
                        //$doc = $this->Codeviewer_model->getDoc($cid, $example, $page);
 
78
                        $doc = $this->Codeviewer_model->getDoc($cid, $example, $page);
79
79
 
80
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*/));
 
81
                        $this->load->view('admin/manage_page', array("cid" => $cid, "example" => $example, "page" => $page, "documentation" => $doc));
82
82
                } else {
83
83
                        $this->load->model('admin/Admin_model');
84
 
                        $this->Admin_model->updatePage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation'], $_POST['files']);
 
84
                        $this->Admin_model->updatePage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation']);
85
85
                        redirect("admin/");
86
86
                }
87
87
        }