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

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-11 16:45:55 UTC
  • mfrom: (23.2.1 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130411164555-ljhmrb2ys3xatogt
commited implementation group one's team branch.
20130411.

Merge proposal comment:
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:
1
1
<?php
2
 
/**
3
 
* This is a controller. It links the views related to the codeviewer together with the model, which holds
4
 
* the logic.  
5
 
*
6
 
* Function names equals path. Example: codeviewer/show in the url calls the function show in the controller
7
 
* codeviewer (this file below).
8
 
*
9
 
* The params after the url equals the input arguments of the function. Function show() has 3 arguments
10
 
* and therefore requires 3 arguments to be given in the url, like so: codeviewer/show/courseid/exampleid/pageid
11
 
*/
 
2
 
12
3
class Codeviewer extends CI_Controller {
13
4
 
14
 
        /**
15
 
        * This shows the codeviewer page
16
 
        */
17
5
        public function show($course, $example, $page){
18
6
                $this->load->model('codeviewer/Codeviewer_model');
19
7
 
20
 
                $editorHTML = $this->Codeviewer_model->getCode($course, $example, $page);
 
8
                $files = $this->Codeviewer_model->getFiles($course, $example,$page);
 
9
                $editorHTML = "";
 
10
                foreach ($files as $file) {
 
11
                        $editorHTML .= $this->Codeviewer_model->showFile($file, "html");
 
12
                }
21
13
 
22
14
                $doc = $this->Codeviewer_model->getDoc($course, $example, $page);
23
15
 
24
 
                // This loads the view. It's stored in application/views/codeviewer/codeviewer.php
25
 
                // Do note that application/views should not be in the first argument of view()
26
 
                // The second argument is data to be shown in the view. "editors" => "test" would
27
 
                // generate an $editors variable in the view containing "test"
28
16
                $this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML, "documentation" => $doc));
29
17
        }
30
18
}
 
 
b'\\ No newline at end of file'