@@ -7,8 +7,9 @@ |
||
7 | 7 | parent::__construct(); |
8 | 8 | $args = func_get_args(); |
9 | 9 | $count = func_num_args(); |
10 | - if (method_exists($this,$func='__construct'.$count)) |
|
11 | - call_user_func_array(array($this,$func),$args); |
|
10 | + if (method_exists($this,$func='__construct'.$count)) { |
|
11 | + call_user_func_array(array($this,$func),$args); |
|
12 | + } |
|
12 | 13 | } |
13 | 14 | public function __construct0() { |
14 | 15 | $this->database = null; |
@@ -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> |
@@ -30,18 +30,21 @@ |
||
30 | 30 | $tempStr = ""; |
31 | 31 | $timeParameter = "?t=".time(); |
32 | 32 | $time = ($this->parameters["app"]->cache->css == true) ? "" : $timeParameter; |
33 | - foreach ($this->tags["css"] as $i) |
|
34 | - $tempStr .= "<link rel='stylesheet' href='$i$time'>"; |
|
33 | + foreach ($this->tags["css"] as $i) { |
|
34 | + $tempStr .= "<link rel='stylesheet' href='$i$time'>"; |
|
35 | + } |
|
35 | 36 | $this->tags["css"] = $tempStr; |
36 | 37 | $tempStr = ""; |
37 | 38 | $time = ($this->parameters["app"]->cache->js == true) ? "" : $timeParameter; |
38 | - foreach ($this->tags["js"] as $i) |
|
39 | - $tempStr .= "<script src='$i$time'></script>"; |
|
39 | + foreach ($this->tags["js"] as $i) { |
|
40 | + $tempStr .= "<script src='$i$time'></script>"; |
|
41 | + } |
|
40 | 42 | $this->tags["js"] = $tempStr; |
41 | 43 | $tempStr = ""; |
42 | 44 | $tempStr .= "<script type='text/javascript'>"; |
43 | - foreach ($this->tags["jsVariables"] as $i) |
|
44 | - $tempStr .= " $i[0] = $i[1];\n"; |
|
45 | + foreach ($this->tags["jsVariables"] as $i) { |
|
46 | + $tempStr .= " $i[0] = $i[1];\n"; |
|
47 | + } |
|
45 | 48 | $tempStr .= "</script>"; |
46 | 49 | $this->tags["jsVariables"] = $tempStr; |
47 | 50 | } |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!isset($GLOBALS["JATEPath"])) |
|
3 | - $GLOBALS["JATEPath"] = []; |
|
2 | + if(!isset($GLOBALS["JATEPath"])) { |
|
3 | + $GLOBALS["JATEPath"] = []; |
|
4 | + } |
|
4 | 5 | $commonLocations = [ |
5 | 6 | "bower_components/JATE/dist/" |
6 | 7 | , "vendor/xaberr/jate/dist/" |
@@ -9,13 +10,15 @@ discard block |
||
9 | 10 | , dirname(__FILE__)."/" |
10 | 11 | ]; |
11 | 12 | $jSuccess = false; |
12 | - foreach ($commonLocations as $path) |
|
13 | - if(file_exists("${path}jate/coreEngine.php")) { |
|
13 | + foreach ($commonLocations as $path) { |
|
14 | + if(file_exists("${path}jate/coreEngine.php")) { |
|
14 | 15 | array_push($GLOBALS["JATEPath"], $path); |
16 | + } |
|
15 | 17 | require_once("${path}jate/coreEngine.php"); |
16 | 18 | $jSuccess = true; |
17 | 19 | break; |
18 | 20 | } |
19 | - if( !$jSuccess ) |
|
20 | - throw new Exception("JATE can't find coreEngine.php."); |
|
21 | -?> |
|
21 | + if( !$jSuccess ) { |
|
22 | + throw new Exception("JATE can't find coreEngine.php."); |
|
23 | + } |
|
24 | + ?> |
@@ -29,50 +29,63 @@ discard block |
||
29 | 29 | } |
30 | 30 | public function getJsVariables() { |
31 | 31 | $temp = []; |
32 | - foreach ($this->required as $i) |
|
33 | - if (is_array($i)) |
|
32 | + foreach ($this->required as $i) { |
|
33 | + if (is_array($i)) |
|
34 | 34 | array_push($temp,$i); |
35 | - foreach ($this->modules as $i) |
|
36 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
37 | - foreach ($this->files as $i) |
|
38 | - if (is_array($i)) |
|
35 | + } |
|
36 | + foreach ($this->modules as $i) { |
|
37 | + $temp = array_merge( $temp, $i->getJsVariables() ); |
|
38 | + } |
|
39 | + foreach ($this->files as $i) { |
|
40 | + if (is_array($i)) |
|
39 | 41 | array_push($temp,$i); |
42 | + } |
|
40 | 43 | return $temp; |
41 | 44 | } |
42 | 45 | public function addModules( $_mods ) { |
43 | - if(!is_array($_mods)) |
|
44 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
45 | - foreach ($_mods as $value) |
|
46 | - $this->addModule($value); |
|
46 | + if(!is_array($_mods)) { |
|
47 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
48 | + } |
|
49 | + foreach ($_mods as $value) { |
|
50 | + $this->addModule($value); |
|
51 | + } |
|
47 | 52 | } |
48 | 53 | public function addModule( $_mod ) { |
49 | - if(!is_object($_mod)) |
|
50 | - throw new InvalidArgumentException("Parameter must be a class."); |
|
51 | - if(! is_subclass_of ($_mod, "Module")) |
|
52 | - throw new InvalidArgumentException("Parameter must be a class."); |
|
54 | + if(!is_object($_mod)) { |
|
55 | + throw new InvalidArgumentException("Parameter must be a class."); |
|
56 | + } |
|
57 | + if(! is_subclass_of ($_mod, "Module")) { |
|
58 | + throw new InvalidArgumentException("Parameter must be a class."); |
|
59 | + } |
|
53 | 60 | $this->modules[$_mod->name] = $_mod; |
54 | 61 | $this->modules[$_mod->name]->parameters = &$this->parameters; |
55 | 62 | } |
56 | 63 | public function addFiles( $_files ) { |
57 | - if(!is_array($_files)) |
|
58 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
59 | - foreach ($_files as $value) |
|
60 | - $this->addFile($value); |
|
64 | + if(!is_array($_files)) { |
|
65 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
66 | + } |
|
67 | + foreach ($_files as $value) { |
|
68 | + $this->addFile($value); |
|
69 | + } |
|
61 | 70 | } |
62 | 71 | public function addFile( $_file ) { |
63 | - if(!is_string($_file)) |
|
64 | - throw new InvalidArgumentException("Parameter must be a string."); |
|
72 | + if(!is_string($_file)) { |
|
73 | + throw new InvalidArgumentException("Parameter must be a string."); |
|
74 | + } |
|
65 | 75 | array_push($this->files, $_file); |
66 | 76 | } |
67 | 77 | public function addFilesRequired( $_files ) { |
68 | - if(!is_array($_files)) |
|
69 | - throw new InvalidArgumentException("Parameter must be an array."); |
|
70 | - foreach ($_files as $value) |
|
71 | - $this->addFileRequired($value); |
|
78 | + if(!is_array($_files)) { |
|
79 | + throw new InvalidArgumentException("Parameter must be an array."); |
|
80 | + } |
|
81 | + foreach ($_files as $value) { |
|
82 | + $this->addFileRequired($value); |
|
83 | + } |
|
72 | 84 | } |
73 | 85 | public function addFileRequired( $_file ) { |
74 | - if(!is_string($_file)) |
|
75 | - throw new InvalidArgumentException("Parameter must be a string."); |
|
86 | + if(!is_string($_file)) { |
|
87 | + throw new InvalidArgumentException("Parameter must be a string."); |
|
88 | + } |
|
76 | 89 | array_push($this->required, $_file); |
77 | 90 | } |
78 | 91 | protected function addDipendences() { |
@@ -82,14 +95,17 @@ discard block |
||
82 | 95 | } |
83 | 96 | protected function getRequire( $_function, $_extenction) { |
84 | 97 | $temp = []; |
85 | - foreach ($this->required as $i) |
|
86 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
98 | + foreach ($this->required as $i) { |
|
99 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
87 | 100 | array_push($temp,$i); |
88 | - foreach ($this->modules as $i) |
|
89 | - $temp = array_merge( $temp, $i->$_function() ); |
|
90 | - foreach ($this->files as $i) |
|
91 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
101 | + } |
|
102 | + foreach ($this->modules as $i) { |
|
103 | + $temp = array_merge( $temp, $i->$_function() ); |
|
104 | + } |
|
105 | + foreach ($this->files as $i) { |
|
106 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
92 | 107 | array_push($temp,$i); |
108 | + } |
|
93 | 109 | return $temp; |
94 | 110 | } |
95 | 111 | } |