/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
	*/
53.1.1 by galaxyAbstractor
fixed adminpanel and codeviewer a bit
17
	public function show($cid, $category, $subcategory, $example){
62.3.1 by a11patfr at his
Codeviewer work underway.
18
		$headData['list'] = array('headTag', 'header', 'codeviewer');
19
		$headData['scripts'] = array('ace/ace');
20
	
21
		$this->load->model('codeviewer/Codeviewer_model');
22
23
		$editorHTML = $this->Codeviewer_model->getCode($cid, $category, $subcategory, $example);
24
	
58.1.2 by a11patfr at his
First steps to working codeviewer, can now show all files.
25
		$this->load->model('user');
26
		$userInfo = array(
27
			'userType' => $this->user->getUserType(),
28
			'userName' => $this->user->getUserName()
29
		);
62.3.1 by a11patfr at his
Codeviewer work underway.
30
		
31
		
32
		// $doc = $this->Codeviewer_model->getDoc($cid, $category, $subcategory, $example);
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
33
23.1.2 by galaxyAbstractor
Fixed database stuff, added files to database.
34
		// This loads the view. It's stored in application/views/codeviewer/codeviewer.php
35
		// Do note that application/views should not be in the first argument of view()
36
		// The second argument is data to be shown in the view. "editors" => "test" would
37
		// generate an $editors variable in the view containing "test"
62.3.1 by a11patfr at his
Codeviewer work underway.
38
		$this->load->view('header', $userInfo);
39
		$this->load->view('headTag', $headData);
40
		$this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML));
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
41
	}
58.1.2 by a11patfr at his
First steps to working codeviewer, can now show all files.
42
}