/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: Gustav Hartvigsson
  • Date: 2013-04-12 17:00:09 UTC
  • mfrom: (23.1.4 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130412170009-gla04s3anpjep68p
Merging implementation group one's team bnanch in to trunk.
This is also end of this cycle.

Good work guys.

20130412.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
class Admin extends CI_Controller {
4
4
 
5
 
 
 
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
        */
6
9
        public function index() {
7
10
                $this->load->model('admin/Admin_model');
8
11
                $courses = $this->Admin_model->getCourses();
38
41
                        $this->load->view('admin/add_example', array("cid" => $cid));
39
42
                } else {
40
43
                        $this->load->model('admin/Admin_model');
41
 
                        $this->Admin_model->addExample($_POST['cid'], $_POST['example']);
 
44
                        $this->Admin_model->addExample($_POST['cid'], $_POST['example'], $_POST['description']);
42
45
                        redirect("admin/");
43
46
                }
44
47
        }
58
61
                        $this->load->view('admin/add_page', array("cid" => $cid, "example" => $example));
59
62
                } else {
60
63
                        $this->load->model('admin/Admin_model');
61
 
                        $this->Admin_model->addPage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation']);
 
64
                        $this->Admin_model->addPage($_POST['cid'], $_POST['example'],$_POST['page']);
62
65
                        redirect("admin/");
63
66
                }
64
67
        }
69
72
 
70
73
                        $this->load->model('codeviewer/Codeviewer_model');
71
74
 
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
 
                        }
 
75
                        
 
76
                        $editorHTML = $this->Codeviewer_model->getCode($cid, $example, $page);
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']);
 
84
                        $this->Admin_model->updatePage($_POST['cid'], $_POST['example'],$_POST['page'], $_POST['documentation'], $_POST['files']);
85
85
                        redirect("admin/");
86
86
                }
87
87
        }