12
12
class Codeviewer extends CI_Controller {
14
/*Temporarily redirects the user to the startpage*/
15
public function index(){
15
20
* This shows the codeviewer page
17
public function show($course, $example, $page){
22
public function show($cid, $category, $subcategory, $example){
23
$headTagData['cssFiles'] = array('headTag', 'header', 'codeviewer');
24
$headTagData['jsFiles'] = array('ace/ace', 'header');
18
26
$this->load->model('codeviewer/Codeviewer_model');
20
$editorHTML = $this->Codeviewer_model->getCode($course, $example, $page);
22
$doc = $this->Codeviewer_model->getDoc($course, $example, $page);
28
$editorHTML = $this->Codeviewer_model->getCode($cid, $category, $subcategory, $example);
30
$this->load->model('user');
33
'userType' => $this->user->getUserType(),
34
'userName' => $this->user->getUserName()
37
$this->load->helper('form');
39
// $doc = $this->Codeviewer_model->getDoc($cid, $category, $subcategory, $example);
24
41
// This loads the view. It's stored in application/views/codeviewer/codeviewer.php
25
42
// Do note that application/views should not be in the first argument of view()
26
43
// The second argument is data to be shown in the view. "editors" => "test" would
27
44
// generate an $editors variable in the view containing "test"
28
$this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML, "documentation" => $doc));
45
$this->load->view('headTag', array('headTagData' => $headTagData));
46
$this->load->view('header', $userInfo);
47
$this->load->view('codeviewer/codeviewer', array("editors" => $editorHTML));
b'\\ No newline at end of file'