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

  • Committer: a11patfr at his
  • Date: 2013-05-16 11:35:20 UTC
  • mto: This revision was merged to the branch mainline in revision 73.
  • Revision ID: a11patfr@student.his.se-20130516113520-3ly4v5978budn6yj
Codeviewer working?

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
                $query = $this->db->get();
19
19
                $outarr = array();
 
20
                $column1 = 0;
 
21
                $column2 = 0;
 
22
                foreach ($query->result() as $row) {
 
23
                        if ($row->columnNr == 1) $column1++;            
 
24
                        if ($row->columnNr == 2) $column2++;            
 
25
                }
20
26
                foreach ($query->result() as $row) { //creats array with array consisting of columnNr and code file.
21
27
                        $output = "";
22
 
                        $output .= '<div class="classcontainer">';
 
28
                        if($row->columnNr == 1 && $column1 == 1 ) {
 
29
                                $output .= '<div class="singleColumn1">';
 
30
                        } else if($row->columnNr == 1 && $column1 == 2) {
 
31
                                $output .= '<div class="doubleColumn1">';
 
32
                        } else if($row->columnNr == 2 && $column2 == 1) {
 
33
                                $output .= '<div class="singleColumn2">';
 
34
                        } else if($row->columnNr == 2 && $column2 == 2) {
 
35
                                $output .= '<div class="doubleColumn2">';
 
36
                        } else if($row->columnNr == 2 && $column2 == 3) {
 
37
                                $output .= '<div class="tripleColumn2">';
 
38
                        } else {
 
39
                                $output .= '<div class="tripleColumn2">';
 
40
                        }
 
41
 
23
42
                        if($row->fileType == 'Code') {
24
 
                                $output .= '<div class="editorinfo"><span class="codeLanguage">'.$row->codeLanguage.'</span><span class="codeFilename">'.$row->fileName.'</span></div>';
 
43
                                $filename = $row->fileName;
 
44
                                $pieces = explode("/", $filename);
 
45
                                $filename = $pieces[4];
 
46
                                $output .= '<div class="editorinfo"><span class="codeLanguage">'.$row->codeLanguage.'</span><span class="codeFilename">'.$filename.'</span></div>';
25
47
                                $output .= '<div id="ace_'.str_replace(".", "", $row->fileName).'" class="ace">';
26
48
                                $output .= $row->dataBlob;
27
49
                                $output .= '</div>';
28
50
 
29
 
                                $output .=  '<script type="text/javascript">
 
51
                                $output .= '<script type="text/javascript">
30
52
                                var Range = require("ace/range").Range;
31
53
                                var editor = ace.edit("ace_'.str_replace(".", "", $row->fileName).'");
32
54
                                editor.setTheme("ace/theme/eclipse");