13
13
$this->db->where("Containers.subcategoryName", $subcategory);
14
14
$this->db->where("Containers.exampleName", $example);
15
15
$this->db->where("Containers.courseID", $cid);
16
$this->db->not_like("Containers.fileName", $cid."/".$category."/".$subcategory."/".$example."/documentation");
16
//$this->db->not_like("Containers.fileName", $cid."/".$category."/".$subcategory."/".$example."/documentation");
18
18
$query = $this->db->get();
20
foreach ($query->result() as $row) {
21
$output .= '<div class="editorinfo">'.$row->codeLanguage.' '.$row->fileName.'</div>';
22
$output .= '<div id="ace_'.str_replace(".", "", $row->fileName).'" class="ace">';
23
$output .= $row->dataBlob;
26
$output .= '<script type="text/javascript">
27
var Range = require("ace/range").Range;
28
var editor = ace.edit("ace_'.str_replace(".", "", $row->fileName).'");
29
editor.setTheme("ace/theme/merbivore");
30
editor.getSession().setMode("ace/mode/'.$row->codeLanguage.'");
31
editor.setReadOnly(true);
32
editor.setShowPrintMargin(false);
33
editor.setDisplayIndentGuides(false);
34
editor.setHighlightSelectedWord(true);
35
lines = editor.getSession().getLength();
36
$("#ace_'.str_replace(".", "", $row->fileName).'").height(Math.min(500,lines*16));
37
aceeditors.push("ace_'.str_replace(".", "", $row->fileName).'");';
40
for($i = 0; $i < count($interestingrows); $i++) {
41
$output .= 'editor.getSession().addMarker(new Range('.$interestingrows[$i][0].', 0, '
42
.$interestingrows[$i][1].', Number.POSITIVE_INFINITY), "interesting", "text",false);';
20
foreach ($query->result() as $row) { //creats array with array consisting of columnNr and code file.
22
if($row->fileType == 'Code') {
23
$output .= '<div class="editorinfo">'.$row->codeLanguage.' '.$row->fileName.'</div>';
24
$output .= '<div id="ace_'.str_replace(".", "", $row->fileName).'" class="ace">';
25
$output .= $row->dataBlob;
28
$output .= '<script type="text/javascript">
29
var Range = require("ace/range").Range;
30
var editor = ace.edit("ace_'.str_replace(".", "", $row->fileName).'");
31
editor.setTheme("ace/theme/eclipse");
32
editor.getSession().setMode("ace/mode/'.$row->codeLanguage.'");
33
editor.setReadOnly(true);
34
editor.setShowPrintMargin(false);
35
editor.setDisplayIndentGuides(false);
36
editor.setHighlightSelectedWord(true);
37
lines = editor.getSession().getLength();
38
$("#ace_'.str_replace(".", "", $row->fileName).'").height(Math.min(500,lines*16));
39
aceeditors.push("ace_'.str_replace(".", "", $row->fileName).'");';
42
for($i = 0; $i < count($interestingrows); $i++) {
43
$output .= 'editor.getSession().addMarker(new Range('.$interestingrows[$i][0].', 0, '
44
.$interestingrows[$i][1].', Number.POSITIVE_INFINITY), "interesting", "text",false);';
47
$output .= '</script>';
48
$outarr[] = array($row->columnNr,$output);
49
} else if($row->fileType == 'Text') {
50
$output .= $row->dataBlob;
51
$outarr[] = array($row->columnNr,$output);
45
$output .= '</script>';
52
60
function getDoc($cid, $category, $subcategory, $example){
53
61
$this->db->select('dataBlob');
54
62
$this->db->from('Files');