@@ -11,9 +11,10 @@ |
||
11 | 11 | $this->connection["$_name"] = $_connection; |
12 | 12 | $this->currentConnection = $_connection; |
13 | 13 | |
14 | - foreach ($this->modules as &$module) |
|
15 | - if(isset($module->currentConnection)) |
|
14 | + foreach ($this->modules as &$module) { |
|
15 | + if(isset($module->currentConnection)) |
|
16 | 16 | $module->addConnection($_name, $_connection); |
17 | + } |
|
17 | 18 | } |
18 | 19 | public function setConnection( $_name ) { |
19 | 20 | $this->currentConnection = $this->connection["$_name"]; |
@@ -17,10 +17,11 @@ discard block |
||
17 | 17 | public function import( $_path, $_type = "misc" ) { |
18 | 18 | $data = file_get_contents($_path); |
19 | 19 | $data = json_decode($data); |
20 | - if( $_type == "connection" ) |
|
21 | - $this->overlayConnection($data); |
|
22 | - else |
|
23 | - $this->overlayMisc($data); |
|
20 | + if( $_type == "connection" ) { |
|
21 | + $this->overlayConnection($data); |
|
22 | + } else { |
|
23 | + $this->overlayMisc($data); |
|
24 | + } |
|
24 | 25 | } |
25 | 26 | protected function overlayConnection( $_data ) { |
26 | 27 | $this->connection = $this->obj2array($_data); |
@@ -40,8 +41,9 @@ discard block |
||
40 | 41 | return $return; |
41 | 42 | } |
42 | 43 | protected function importObject( $_object ) { |
43 | - foreach (get_object_vars($_object) as $key => $value) |
|
44 | - $this->$key = $value; |
|
44 | + foreach (get_object_vars($_object) as $key => $value) { |
|
45 | + $this->$key = $value; |
|
46 | + } |
|
45 | 47 | } |
46 | 48 | } |
47 | 49 | ?> |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | function getGitLog( $_dir = "./" ) { |
3 | - if(!file_exists($_dir)) |
|
4 | - return []; |
|
3 | + if(!file_exists($_dir)) { |
|
4 | + return []; |
|
5 | + } |
|
5 | 6 | $currentDir = getcwd(); |
6 | 7 | chdir($_dir); |
7 | 8 | $gitHistory = []; |
@@ -35,19 +36,17 @@ discard block |
||
35 | 36 | $tag = trim($tag[0]); |
36 | 37 | $gitHistory[$lastHash]['tag'] = $tag; |
37 | 38 | } |
38 | - } |
|
39 | - else if (strpos($line, 'Author') === 0) { |
|
39 | + } else if (strpos($line, 'Author') === 0) { |
|
40 | 40 | $author = explode(':', $line); |
41 | 41 | $author = trim(end($author)); |
42 | 42 | $gitHistory[$lastHash]['author'] = $author; |
43 | - } |
|
44 | - else if (strpos($line, 'Date') === 0) { |
|
43 | + } else if (strpos($line, 'Date') === 0) { |
|
45 | 44 | $date = explode(':', $line, 2); |
46 | 45 | $date = trim(end($date)); |
47 | 46 | $gitHistory[$lastHash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
47 | + } else { |
|
48 | + $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
48 | 49 | } |
49 | - else |
|
50 | - $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
51 | 50 | } |
52 | 51 | } |
53 | 52 | chdir($currentDir); |
@@ -12,9 +12,10 @@ |
||
12 | 12 | echo minifyOutput($render); |
13 | 13 | } |
14 | 14 | protected function overlayTag( $_page ) { |
15 | - foreach($this->tags as $key => $value) |
|
16 | - if(!is_array($value)) |
|
15 | + foreach($this->tags as $key => $value) { |
|
16 | + if(!is_array($value)) |
|
17 | 17 | $_page = str_replace("<_${key}_>", "$value", $_page); |
18 | + } |
|
18 | 19 | return $_page; |
19 | 20 | } |
20 | 21 | } |
@@ -26,17 +26,20 @@ |
||
26 | 26 | $this->tags["js"] = array_unique($this->tags["js"]); |
27 | 27 | $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
28 | 28 | $tempStr = ""; |
29 | - foreach ($this->tags["css"] as $i) |
|
30 | - $tempStr .= "<link rel='stylesheet' href='$i'>"; |
|
29 | + foreach ($this->tags["css"] as $i) { |
|
30 | + $tempStr .= "<link rel='stylesheet' href='$i'>"; |
|
31 | + } |
|
31 | 32 | $this->tags["css"] = $tempStr; |
32 | 33 | $tempStr = ""; |
33 | - foreach ($this->tags["js"] as $i) |
|
34 | - $tempStr .= "<script src='$i'></script>"; |
|
34 | + foreach ($this->tags["js"] as $i) { |
|
35 | + $tempStr .= "<script src='$i'></script>"; |
|
36 | + } |
|
35 | 37 | $this->tags["js"] = $tempStr; |
36 | 38 | $tempStr = ""; |
37 | 39 | $tempStr .= "<script type='text/javascript'>"; |
38 | - foreach ($this->tags["jsVariables"] as $i) |
|
39 | - $tempStr .= " $i[0] = $i[1];\n"; |
|
40 | + foreach ($this->tags["jsVariables"] as $i) { |
|
41 | + $tempStr .= " $i[0] = $i[1];\n"; |
|
42 | + } |
|
40 | 43 | $tempStr .= "</script>"; |
41 | 44 | $this->tags["jsVariables"] = $tempStr; |
42 | 45 | } |
@@ -36,10 +36,12 @@ |
||
36 | 36 | function arrayDump( $_array, $_name = "Array", $_tab = " " ) { |
37 | 37 | $position = preg_replace('/ /', '', $_tab, 1); |
38 | 38 | echo "$position<span style=\"color:rgb(230,0,0)\">$_name:</span><br>"; |
39 | - foreach ($_array as $k => $i) |
|
40 | - if(is_array($i)) |
|
39 | + foreach ($_array as $k => $i) { |
|
40 | + if(is_array($i)) |
|
41 | 41 | arrayDump( $i, $k, " $_tab" ); |
42 | - else |
|
43 | - echo "$_tab<b>$k:</b> $i<br>"; |
|
42 | + } |
|
43 | + else { |
|
44 | + echo "$_tab<b>$k:</b> $i<br>"; |
|
45 | + } |
|
44 | 46 | } |
45 | 47 | ?> |
@@ -22,8 +22,9 @@ discard block |
||
22 | 22 | $percent; |
23 | 23 | foreach (getGitLog() as $i) { |
24 | 24 | $cont++; |
25 | - if($cont % $nPerCol == 1) |
|
26 | - echo '<div class="row">'; |
|
25 | + if($cont % $nPerCol == 1) { |
|
26 | + echo '<div class="row">'; |
|
27 | + } |
|
27 | 28 | if(isset($i["tag"])) { |
28 | 29 | $percent = explode(".",$i["tag"]); |
29 | 30 | $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
@@ -32,7 +33,8 @@ discard block |
||
32 | 33 | <div class="col-lg-<?=$dim?>"> |
33 | 34 | <div class="well well-sm miniblock"> |
34 | 35 | <div class="autor"><b>Autor:</b> <?=$i["author"]?><br></div> |
35 | - <div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) echo $i["tag"]?><br></div> |
|
36 | + <div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) { |
|
37 | + echo $i["tag"]?><br></div> |
|
36 | 38 | <div class="date"><b>Date:</b> <?=$i["date"]?><br></div> |
37 | 39 | <div class="message"><b>Message:</b> <?=$i["message"]?><br></div> |
38 | 40 | <div class="progress"> |
@@ -46,6 +48,7 @@ discard block |
||
46 | 48 | <?php |
47 | 49 | if($cont % $nPerCol == 0) |
48 | 50 | echo '</div>'; |
51 | +} |
|
49 | 52 | } ?> |
50 | 53 | </div> |
51 | 54 | </div> |
@@ -20,13 +20,14 @@ |
||
20 | 20 | public function makeConnection() { |
21 | 21 | $jConfig = $this->parameters["app"]; |
22 | 22 | $connection = null; |
23 | - if( $jConfig != null && $jConfig->connection["enable"]) |
|
24 | - $connection = new Connection( |
|
23 | + if( $jConfig != null && $jConfig->connection["enable"]) { |
|
24 | + $connection = new Connection( |
|
25 | 25 | $jConfig->connection["server"] |
26 | 26 | , $jConfig->connection["database"] |
27 | 27 | , $jConfig->connection["user"] |
28 | 28 | , $jConfig->connection["password"] |
29 | 29 | ); |
30 | + } |
|
30 | 31 | $this->addConnection("base",$connection); |
31 | 32 | } |
32 | 33 | public function makeMenu() { |
@@ -1,14 +1,16 @@ |
||
1 | 1 | <?php |
2 | - if(!isset($GLOBALS["JATEPath"])) |
|
3 | - $GLOBALS["JATEPath"] = []; |
|
2 | + if(!isset($GLOBALS["JATEPath"])) { |
|
3 | + $GLOBALS["JATEPath"] = []; |
|
4 | + } |
|
4 | 5 | $commonLocations = array( |
5 | 6 | "bower_components/JATE/dist/", |
6 | 7 | "vendor/xaberr/jate/dist/", |
7 | 8 | "../../dist/" |
8 | 9 | ); |
9 | - foreach ($commonLocations as $i) |
|
10 | - if(file_exists($i."jate/coreEngine.php")) { |
|
10 | + foreach ($commonLocations as $i) { |
|
11 | + if(file_exists($i."jate/coreEngine.php")) { |
|
11 | 12 | array_push($GLOBALS["JATEPath"], $i); |
13 | + } |
|
12 | 14 | require_once($i."jate/coreEngine.php"); |
13 | 15 | break; |
14 | 16 | } |