/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
1
<?php
23.1.2 by galaxyAbstractor
Fixed database stuff, added files to database.
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
*/
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
12
class Codeviewer extends CI_Controller {
13
23.1.2 by galaxyAbstractor
Fixed database stuff, added files to database.
14
	/**
15
	* This shows the codeviewer page
16
	*/
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
17
	public function show($course, $example, $page){
18
		$this->load->model('codeviewer/Codeviewer_model');
19
23.1.2 by galaxyAbstractor
Fixed database stuff, added files to database.
20
		$editorHTML = $this->Codeviewer_model->getCode($course, $example, $page);
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
21
22
		$doc = $this->Codeviewer_model->getDoc($course, $example, $page);
23
23.1.2 by galaxyAbstractor
Fixed database stuff, added files to database.
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"
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
28
		$this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML, "documentation" => $doc));
29
	}
30
}