@@ -11,6 +11,10 @@ |
||
11 | 11 | function arrayHtmlParser($_array) { |
12 | 12 | return travelStringArray($_array,"htmlParser"); |
13 | 13 | } |
14 | + |
|
15 | + /** |
|
16 | + * @param string $_function |
|
17 | + */ |
|
14 | 18 | function travelStringArray ( $_array, $_function ) { |
15 | 19 | if (is_array($_array)) { |
16 | 20 | foreach ($_array as $k => $v) { |
@@ -1,27 +1,27 @@ |
||
1 | 1 | <?php |
2 | 2 | function utf8ize($_array) { |
3 | - return travelStringArray($_array,"utf8_encode"); |
|
3 | + return travelStringArray($_array, "utf8_encode"); |
|
4 | 4 | } |
5 | 5 | function unutf8ize($_array) { |
6 | - return travelStringArray($_array,"utf8_decode"); |
|
6 | + return travelStringArray($_array, "utf8_decode"); |
|
7 | 7 | } |
8 | 8 | function arraySlash($_array) { |
9 | - return travelStringArray($_array,"addslashes"); |
|
9 | + return travelStringArray($_array, "addslashes"); |
|
10 | 10 | } |
11 | 11 | function arrayHtmlParser($_array) { |
12 | - return travelStringArray($_array,"htmlParser"); |
|
12 | + return travelStringArray($_array, "htmlParser"); |
|
13 | 13 | } |
14 | - function travelStringArray ( $_array, $_function ) { |
|
14 | + function travelStringArray($_array, $_function) { |
|
15 | 15 | if (is_array($_array)) { |
16 | 16 | foreach ($_array as $k => $v) { |
17 | 17 | $_array[$k] = travelStringArray($v, $_function); |
18 | 18 | } |
19 | - } else if (is_string ($_array)) { |
|
20 | - return call_user_func($_function,$_array); |
|
19 | + } else if (is_string($_array)) { |
|
20 | + return call_user_func($_function, $_array); |
|
21 | 21 | } |
22 | 22 | return $_array; |
23 | 23 | } |
24 | - function array_depth( $_array ) { |
|
24 | + function array_depth($_array) { |
|
25 | 25 | $maxDepth = 1; |
26 | 26 | foreach ($_array as $value) { |
27 | 27 | if (is_array($value)) { |
@@ -17,6 +17,10 @@ |
||
17 | 17 | }); |
18 | 18 | return $temp; |
19 | 19 | } |
20 | + |
|
21 | + /** |
|
22 | + * @param Closure $_function |
|
23 | + */ |
|
20 | 24 | function fetchInSubFolder( $_dir = "./", $_function) { |
21 | 25 | $temp = []; |
22 | 26 | if (is_dir($_dir)) { |
@@ -1,41 +1,41 @@ |
||
1 | 1 | <?php |
2 | - function subFolder( $_dir = "./" ) { |
|
3 | - $temp = fetchInSubFolder($_dir, function( $_file ) { |
|
2 | + function subFolder($_dir = "./") { |
|
3 | + $temp = fetchInSubFolder($_dir, function($_file) { |
|
4 | 4 | return true; |
5 | 5 | }); |
6 | 6 | return $temp; |
7 | 7 | } |
8 | - function subFolder_file( $_dir = "./" ) { |
|
9 | - $temp = fetchInSubFolder($_dir, function( $_file ) { |
|
8 | + function subFolder_file($_dir = "./") { |
|
9 | + $temp = fetchInSubFolder($_dir, function($_file) { |
|
10 | 10 | return !is_dir($_file); |
11 | 11 | }); |
12 | 12 | return $temp; |
13 | 13 | } |
14 | - function subFolder_dir( $_dir = "./" ) { |
|
15 | - $temp = fetchInSubFolder($_dir, function( $_file ) { |
|
14 | + function subFolder_dir($_dir = "./") { |
|
15 | + $temp = fetchInSubFolder($_dir, function($_file) { |
|
16 | 16 | return !is_file($_file); |
17 | 17 | }); |
18 | 18 | return $temp; |
19 | 19 | } |
20 | - function fetchInSubFolder( $_dir = "./", $_function) { |
|
20 | + function fetchInSubFolder($_dir = "./", $_function) { |
|
21 | 21 | $temp = []; |
22 | 22 | if (is_dir($_dir)) { |
23 | 23 | if ($dirOpened = opendir($_dir)) { |
24 | 24 | while (($file = readdir($dirOpened)) !== false) |
25 | - if( ($file !='.')&&($file !='..') ) |
|
26 | - if($_function($file)) |
|
27 | - array_push($temp,$file); |
|
25 | + if (($file != '.') && ($file != '..')) |
|
26 | + if ($_function($file)) |
|
27 | + array_push($temp, $file); |
|
28 | 28 | closedir($dirOpened); |
29 | 29 | } |
30 | 30 | } |
31 | 31 | return $temp; |
32 | 32 | } |
33 | - function require_subfolder( $_dir = "./" ) { |
|
33 | + function require_subfolder($_dir = "./") { |
|
34 | 34 | $temp = subFolder_file($_dir); |
35 | 35 | foreach ($temp as $i) |
36 | 36 | jRequire($_dir."/".$i); |
37 | 37 | } |
38 | - function require_js( $_dir = "./" ) { |
|
38 | + function require_js($_dir = "./") { |
|
39 | 39 | $tempArray = []; |
40 | 40 | $temp = subFolder_file($_dir); |
41 | 41 | foreach ($temp as $i) |
@@ -21,10 +21,11 @@ discard block |
||
21 | 21 | $temp = []; |
22 | 22 | if (is_dir($_dir)) { |
23 | 23 | if ($dirOpened = opendir($_dir)) { |
24 | - while (($file = readdir($dirOpened)) !== false) |
|
25 | - if( ($file !='.')&&($file !='..') ) |
|
24 | + while (($file = readdir($dirOpened)) !== false) { |
|
25 | + if( ($file !='.')&&($file !='..') ) |
|
26 | 26 | if($_function($file)) |
27 | 27 | array_push($temp,$file); |
28 | + } |
|
28 | 29 | closedir($dirOpened); |
29 | 30 | } |
30 | 31 | } |
@@ -32,14 +33,16 @@ discard block |
||
32 | 33 | } |
33 | 34 | function require_subfolder( $_dir = "./" ) { |
34 | 35 | $temp = subFolder_file($_dir); |
35 | - foreach ($temp as $i) |
|
36 | - jRequire($_dir."/".$i); |
|
36 | + foreach ($temp as $i) { |
|
37 | + jRequire($_dir."/".$i); |
|
38 | + } |
|
37 | 39 | } |
38 | 40 | function require_js( $_dir = "./" ) { |
39 | 41 | $tempArray = []; |
40 | 42 | $temp = subFolder_file($_dir); |
41 | - foreach ($temp as $i) |
|
42 | - array_push($tempArray, $_dir."/".$i); |
|
43 | + foreach ($temp as $i) { |
|
44 | + array_push($tempArray, $_dir."/".$i); |
|
45 | + } |
|
43 | 46 | return $tempArray; |
44 | 47 | } |
45 | 48 | ?> |
@@ -2,6 +2,10 @@ |
||
2 | 2 | function q_query( $_database, $_query, $_error ) { |
3 | 3 | return std_query( $_database, $_query, $_error, $temp ); |
4 | 4 | } |
5 | + |
|
6 | + /** |
|
7 | + * @param string $_error |
|
8 | + */ |
|
5 | 9 | function c_query( $_query, $_error ) { |
6 | 10 | global $connection; |
7 | 11 | return q_query( $connection->database, $_query, $_error ); |
@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | - function q_query( $_database, $_query, $_error ) { |
|
3 | - return std_query( $_database, $_query, $_error, $temp ); |
|
2 | + function q_query($_database, $_query, $_error) { |
|
3 | + return std_query($_database, $_query, $_error, $temp); |
|
4 | 4 | } |
5 | - function c_query( $_query, $_error ) { |
|
5 | + function c_query($_query, $_error) { |
|
6 | 6 | global $connection; |
7 | - return q_query( $connection->database, $_query, $_error ); |
|
7 | + return q_query($connection->database, $_query, $_error); |
|
8 | 8 | } |
9 | - function b_query( $_query, $_error ) { |
|
9 | + function b_query($_query, $_error) { |
|
10 | 10 | global $connection; |
11 | 11 | $temp = 0; |
12 | - std_query( $connection->database, $_query, $_error, $temp ); |
|
12 | + std_query($connection->database, $_query, $_error, $temp); |
|
13 | 13 | return $temp; |
14 | 14 | } |
15 | - function c_insert( $_query, $_error ) { |
|
16 | - return b_query( $_query, $_error ); |
|
15 | + function c_insert($_query, $_error) { |
|
16 | + return b_query($_query, $_error); |
|
17 | 17 | } |
18 | - function std_query( $_database, $_query, $_error, &$_result ) { |
|
18 | + function std_query($_database, $_query, $_error, &$_result) { |
|
19 | 19 | $query = $_database->prepare($_query); |
20 | 20 | $_result = $query->execute(); |
21 | - if(!$_result) { |
|
21 | + if (!$_result) { |
|
22 | 22 | echo "$_query<br>"; |
23 | 23 | echo "something wrong: ".$_error; |
24 | 24 | var_dump($query->errorInfo()); |
@@ -1,4 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | + /** |
|
3 | + * @param string $_path |
|
4 | + * @param integer $_stack |
|
5 | + */ |
|
2 | 6 | function requireComponent( $_path, $_local = true, $_stack = null ) { |
3 | 7 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | 8 | if(file_exists($path) && isPhp($path)) |
@@ -6,6 +10,11 @@ discard block |
||
6 | 10 | else |
7 | 11 | requireError($_path); |
8 | 12 | } |
13 | + |
|
14 | + /** |
|
15 | + * @param string $_path |
|
16 | + * @param integer $_stack |
|
17 | + */ |
|
9 | 18 | function requireComponents( $_path, $_local = true, $_stack = null ) { |
10 | 19 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | 20 | if(file_exists($path)) { |
@@ -34,10 +43,18 @@ discard block |
||
34 | 43 | requireComponents($path."/".$i, false, 0); |
35 | 44 | } |
36 | 45 | } |
46 | + |
|
47 | + /** |
|
48 | + * @param integer $_stack |
|
49 | + */ |
|
37 | 50 | function jRequire( $_path, $_local = true, $_stack = null ) { |
38 | 51 | $path = getJFolder($_path, $_local, debug_backtrace()); |
39 | 52 | require_once( $path ); |
40 | 53 | } |
54 | + |
|
55 | + /** |
|
56 | + * @param boolean $_local |
|
57 | + */ |
|
41 | 58 | function getJFolder( $_path, $_local, $_stack ) { |
42 | 59 | if($_local) { |
43 | 60 | $stackInfo = $_stack; |
@@ -1,45 +1,45 @@ |
||
1 | 1 | <?php |
2 | - function requireComponent( $_path, $_local = true, $_stack = null ) { |
|
2 | + function requireComponent($_path, $_local = true, $_stack = null) { |
|
3 | 3 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | - if(file_exists($path) && isPhp($path)) |
|
4 | + if (file_exists($path) && isPhp($path)) |
|
5 | 5 | jRequire($path, false, 0); |
6 | 6 | else |
7 | 7 | requireError($_path); |
8 | 8 | } |
9 | - function requireComponents( $_path, $_local = true, $_stack = null ) { |
|
9 | + function requireComponents($_path, $_local = true, $_stack = null) { |
|
10 | 10 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | - if(file_exists($path)) { |
|
11 | + if (file_exists($path)) { |
|
12 | 12 | $files = subFolder_file($path); |
13 | 13 | foreach ($files as $i) { |
14 | - if(isPhp($path."/".$i)) |
|
14 | + if (isPhp($path."/".$i)) |
|
15 | 15 | requireComponent($path."/".$i, false, 0); |
16 | 16 | } |
17 | 17 | } else |
18 | 18 | requireError($_path); |
19 | 19 | } |
20 | - function requireError( $_path ) { |
|
20 | + function requireError($_path) { |
|
21 | 21 | global $jConfig; |
22 | - if( $jConfig->DEBUG == 1 ) |
|
22 | + if ($jConfig->DEBUG == 1) |
|
23 | 23 | echo "Error load ($_path)<br>"; |
24 | 24 | } |
25 | - function isPhp ( $_file ) { |
|
26 | - if(!is_file($_file)) return false; |
|
25 | + function isPhp($_file) { |
|
26 | + if (!is_file($_file)) return false; |
|
27 | 27 | $info = pathinfo($_file); |
28 | 28 | return ($info["extension"] == "php") || ($info["extension"] == "PHP"); |
29 | 29 | } |
30 | - function requireModules( $_path, $_local = true, $_stack = null ) { |
|
30 | + function requireModules($_path, $_local = true, $_stack = null) { |
|
31 | 31 | $path = getJFolder($_path, $_local, debug_backtrace()); |
32 | 32 | $subFolders = subFolder_dir($path); |
33 | 33 | foreach ($subFolders as $i) { |
34 | 34 | requireComponents($path."/".$i, false, 0); |
35 | 35 | } |
36 | 36 | } |
37 | - function jRequire( $_path, $_local = true, $_stack = null ) { |
|
37 | + function jRequire($_path, $_local = true, $_stack = null) { |
|
38 | 38 | $path = getJFolder($_path, $_local, debug_backtrace()); |
39 | - require_once( $path ); |
|
39 | + require_once($path); |
|
40 | 40 | } |
41 | - function getJFolder( $_path, $_local, $_stack ) { |
|
42 | - if($_local) { |
|
41 | + function getJFolder($_path, $_local, $_stack) { |
|
42 | + if ($_local) { |
|
43 | 43 | $stackInfo = $_stack; |
44 | 44 | $folder = dirname($stackInfo[0]["file"]); |
45 | 45 | $file = "$folder/$_path"; |
@@ -1,29 +1,35 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | function requireComponent( $_path, $_local = true, $_stack = null ) { |
3 | 3 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | - if(file_exists($path) && isPhp($path)) |
|
5 | - jRequire($path, false, 0); |
|
6 | - else |
|
7 | - requireError($_path); |
|
4 | + if(file_exists($path) && isPhp($path)) { |
|
5 | + jRequire($path, false, 0); |
|
6 | + } else { |
|
7 | + requireError($_path); |
|
8 | + } |
|
8 | 9 | } |
9 | 10 | function requireComponents( $_path, $_local = true, $_stack = null ) { |
10 | 11 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | 12 | if(file_exists($path)) { |
12 | 13 | $files = subFolder_file($path); |
13 | 14 | foreach ($files as $i) { |
14 | - if(isPhp($path."/".$i)) |
|
15 | - requireComponent($path."/".$i, false, 0); |
|
15 | + if(isPhp($path."/".$i)) { |
|
16 | + requireComponent($path."/".$i, false, 0); |
|
17 | + } |
|
16 | 18 | } |
17 | - } else |
|
18 | - requireError($_path); |
|
19 | + } else { |
|
20 | + requireError($_path); |
|
21 | + } |
|
19 | 22 | } |
20 | 23 | function requireError( $_path ) { |
21 | 24 | global $jConfig; |
22 | - if( $jConfig->DEBUG == 1 ) |
|
23 | - echo "Error load ($_path)<br>"; |
|
25 | + if( $jConfig->DEBUG == 1 ) { |
|
26 | + echo "Error load ($_path)<br>"; |
|
27 | + } |
|
24 | 28 | } |
25 | 29 | function isPhp ( $_file ) { |
26 | - if(!is_file($_file)) return false; |
|
30 | + if(!is_file($_file)) { |
|
31 | + return false; |
|
32 | + } |
|
27 | 33 | $info = pathinfo($_file); |
28 | 34 | return ($info["extension"] == "php") || ($info["extension"] == "PHP"); |
29 | 35 | } |
@@ -43,8 +49,9 @@ discard block |
||
43 | 49 | $stackInfo = $_stack; |
44 | 50 | $folder = dirname($stackInfo[0]["file"]); |
45 | 51 | $file = "$folder/$_path"; |
46 | - } else |
|
47 | - $file = $_path; |
|
52 | + } else { |
|
53 | + $file = $_path; |
|
54 | + } |
|
48 | 55 | return $file; |
49 | 56 | } |
50 | 57 | ?> |
@@ -11,6 +11,10 @@ |
||
11 | 11 | $render = $this->overlayTag($page); |
12 | 12 | echo minify_output($render); |
13 | 13 | } |
14 | + |
|
15 | + /** |
|
16 | + * @param string $_page |
|
17 | + */ |
|
14 | 18 | protected function overlayTag( $_page ) { |
15 | 19 | foreach($this->data as $key => $value) { |
16 | 20 | $_page = str_replace("<_".$key."_>", "$value", $_page); |
@@ -3,16 +3,16 @@ |
||
3 | 3 | public function __construct() { |
4 | 4 | parent::__construct(); |
5 | 5 | } |
6 | - public function init( $_page ) { |
|
6 | + public function init($_page) { |
|
7 | 7 | $this->data = $_page->data; |
8 | 8 | } |
9 | - public function draw( $_template ) { |
|
9 | + public function draw($_template) { |
|
10 | 10 | $page = file_get_contents($_template); |
11 | 11 | $render = $this->overlayTag($page); |
12 | 12 | echo minify_output($render); |
13 | 13 | } |
14 | - protected function overlayTag( $_page ) { |
|
15 | - foreach($this->data as $key => $value) { |
|
14 | + protected function overlayTag($_page) { |
|
15 | + foreach ($this->data as $key => $value) { |
|
16 | 16 | $_page = str_replace("<_".$key."_>", "$value", $_page); |
17 | 17 | } |
18 | 18 | return $_page; |
@@ -35,6 +35,10 @@ discard block |
||
35 | 35 | public function addModule( $_mod ) { |
36 | 36 | $this->modules[$_mod->name] = $_mod; |
37 | 37 | } |
38 | + |
|
39 | + /** |
|
40 | + * @param string[] $_files |
|
41 | + */ |
|
38 | 42 | public function addFiles( $_files ) { |
39 | 43 | foreach ($_files as $value) |
40 | 44 | $this->addFile($value); |
@@ -47,6 +51,11 @@ discard block |
||
47 | 51 | $this->data["js"] = $this->getJs(); |
48 | 52 | $this->data["jsVariables"] = $this->getJsVariables(); |
49 | 53 | } |
54 | + |
|
55 | + /** |
|
56 | + * @param string $_function |
|
57 | + * @param string $_extenction |
|
58 | + */ |
|
50 | 59 | protected function getRequire( $_function, $_extenction) { |
51 | 60 | $temp = []; |
52 | 61 | foreach ($this->modules as $i) |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | public $data; |
7 | 7 | public function __construct() { |
8 | 8 | $this->name = get_class($this); |
9 | - $this->modules = []; |
|
9 | + $this->modules = []; |
|
10 | 10 | $this->files = []; |
11 | 11 | $this->data = []; |
12 | 12 | } |
@@ -14,32 +14,32 @@ discard block |
||
14 | 14 | // abstract public function init(); |
15 | 15 | // abstract public function draw(); |
16 | 16 | public function getCss() { |
17 | - return $this->getRequire("getCss",".css"); |
|
17 | + return $this->getRequire("getCss", ".css"); |
|
18 | 18 | } |
19 | 19 | public function getJs() { |
20 | - return $this->getRequire("getJs",".js"); |
|
20 | + return $this->getRequire("getJs", ".js"); |
|
21 | 21 | } |
22 | 22 | public function getJsVariables() { |
23 | 23 | $temp = []; |
24 | 24 | foreach ($this->modules as $i) |
25 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
25 | + $temp = array_merge($temp, $i->getJsVariables()); |
|
26 | 26 | foreach ($this->files as $i) |
27 | 27 | if (is_array($i)) |
28 | - array_push($temp,$i); |
|
28 | + array_push($temp, $i); |
|
29 | 29 | return $temp; |
30 | 30 | } |
31 | - public function addModules( $_mods ) { |
|
31 | + public function addModules($_mods) { |
|
32 | 32 | foreach ($_mods as $value) |
33 | 33 | $this->addModule($value); |
34 | 34 | } |
35 | - public function addModule( $_mod ) { |
|
35 | + public function addModule($_mod) { |
|
36 | 36 | $this->modules[$_mod->name] = $_mod; |
37 | 37 | } |
38 | - public function addFiles( $_files ) { |
|
38 | + public function addFiles($_files) { |
|
39 | 39 | foreach ($_files as $value) |
40 | 40 | $this->addFile($value); |
41 | 41 | } |
42 | - public function addFile( $_file ) { |
|
42 | + public function addFile($_file) { |
|
43 | 43 | array_push($this->files, $_file); |
44 | 44 | } |
45 | 45 | protected function addDipendences() { |
@@ -47,13 +47,13 @@ discard block |
||
47 | 47 | $this->data["js"] = $this->getJs(); |
48 | 48 | $this->data["jsVariables"] = $this->getJsVariables(); |
49 | 49 | } |
50 | - protected function getRequire( $_function, $_extenction) { |
|
50 | + protected function getRequire($_function, $_extenction) { |
|
51 | 51 | $temp = []; |
52 | 52 | foreach ($this->modules as $i) |
53 | - $temp = array_merge( $temp, $i->$_function() ); |
|
53 | + $temp = array_merge($temp, $i->$_function()); |
|
54 | 54 | foreach ($this->files as $i) |
55 | 55 | if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
56 | - array_push($temp,$i); |
|
56 | + array_push($temp, $i); |
|
57 | 57 | return $temp; |
58 | 58 | } |
59 | 59 | } |
@@ -21,23 +21,27 @@ discard block |
||
21 | 21 | } |
22 | 22 | public function getJsVariables() { |
23 | 23 | $temp = []; |
24 | - foreach ($this->modules as $i) |
|
25 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
26 | - foreach ($this->files as $i) |
|
27 | - if (is_array($i)) |
|
24 | + foreach ($this->modules as $i) { |
|
25 | + $temp = array_merge( $temp, $i->getJsVariables() ); |
|
26 | + } |
|
27 | + foreach ($this->files as $i) { |
|
28 | + if (is_array($i)) |
|
28 | 29 | array_push($temp,$i); |
30 | + } |
|
29 | 31 | return $temp; |
30 | 32 | } |
31 | 33 | public function addModules( $_mods ) { |
32 | - foreach ($_mods as $value) |
|
33 | - $this->addModule($value); |
|
34 | + foreach ($_mods as $value) { |
|
35 | + $this->addModule($value); |
|
36 | + } |
|
34 | 37 | } |
35 | 38 | public function addModule( $_mod ) { |
36 | 39 | $this->modules[$_mod->name] = $_mod; |
37 | 40 | } |
38 | 41 | public function addFiles( $_files ) { |
39 | - foreach ($_files as $value) |
|
40 | - $this->addFile($value); |
|
42 | + foreach ($_files as $value) { |
|
43 | + $this->addFile($value); |
|
44 | + } |
|
41 | 45 | } |
42 | 46 | public function addFile( $_file ) { |
43 | 47 | array_push($this->files, $_file); |
@@ -49,11 +53,13 @@ discard block |
||
49 | 53 | } |
50 | 54 | protected function getRequire( $_function, $_extenction) { |
51 | 55 | $temp = []; |
52 | - foreach ($this->modules as $i) |
|
53 | - $temp = array_merge( $temp, $i->$_function() ); |
|
54 | - foreach ($this->files as $i) |
|
55 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
56 | + foreach ($this->modules as $i) { |
|
57 | + $temp = array_merge( $temp, $i->$_function() ); |
|
58 | + } |
|
59 | + foreach ($this->files as $i) { |
|
60 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
56 | 61 | array_push($temp,$i); |
62 | + } |
|
57 | 63 | return $temp; |
58 | 64 | } |
59 | 65 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("jate.php"); |
3 | 3 | $connection = null; |
4 | - if($jConfig->connection["enable"]) |
|
4 | + if ($jConfig->connection["enable"]) |
|
5 | 5 | $connection = new Connection( |
6 | 6 | $jConfig->connection["server"] |
7 | 7 | , $jConfig->connection["database"] |
@@ -1,13 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("jate.php"); |
3 | 3 | $connection = null; |
4 | - if($jConfig->connection["enable"]) |
|
5 | - $connection = new Connection( |
|
4 | + if($jConfig->connection["enable"]) { |
|
5 | + $connection = new Connection( |
|
6 | 6 | $jConfig->connection["server"] |
7 | 7 | , $jConfig->connection["database"] |
8 | 8 | , $jConfig->connection["user"] |
9 | 9 | , $jConfig->connection["password"] |
10 | 10 | ); |
11 | + } |
|
11 | 12 | $webApp = new WebApp(); |
12 | 13 | $webApp->addPages($jConfig->pages); |
13 | 14 | $webApp->setDefaultPage($jConfig->pages[0]); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("main.php"); |
3 | - if(!isset($_GET["page"])) $_GET["page"] = "home"; |
|
3 | + if (!isset($_GET["page"])) $_GET["page"] = "home"; |
|
4 | 4 | $webApp->fetchPage($_GET["page"]); |
5 | 5 | $webApp->draw(); |
6 | 6 | ?> |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("main.php"); |
3 | - if(!isset($_GET["page"])) $_GET["page"] = "home"; |
|
3 | + if(!isset($_GET["page"])) { |
|
4 | + $_GET["page"] = "home"; |
|
5 | + } |
|
4 | 6 | $webApp->fetchPage($_GET["page"]); |
5 | 7 | $webApp->draw(); |
6 | 8 | ?> |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | $percent; |
23 | 23 | foreach (getGitLog() as $i) { |
24 | 24 | $cont++; |
25 | - if($cont % $nPerCol == 1) |
|
25 | + if ($cont % $nPerCol == 1) |
|
26 | 26 | echo '<div class="row">'; |
27 | - if(isset($i["tag"])) { |
|
28 | - $percent = explode(".",$i["tag"]); |
|
27 | + if (isset($i["tag"])) { |
|
28 | + $percent = explode(".", $i["tag"]); |
|
29 | 29 | $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
30 | 30 | } |
31 | 31 | ?> |
32 | 32 | <div class="col-lg-<?=$dim?>"> |
33 | 33 | <div class="well well-sm miniblock"> |
34 | 34 | <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> |
|
35 | + <div class="tag"><b>Tag:</b> <?php if (isset($i["tag"])) echo $i["tag"]?><br></div> |
|
36 | 36 | <div class="date"><b>Date:</b> <?=$i["date"]?><br></div> |
37 | 37 | <div class="message"><b>Message:</b> <?=$i["message"]?><br></div> |
38 | 38 | <div class="progress"> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | </div> |
45 | 45 | </div> |
46 | 46 | <?php |
47 | - if($cont % $nPerCol == 0) |
|
47 | + if ($cont % $nPerCol == 0) |
|
48 | 48 | echo '</div>'; |
49 | 49 | } ?> |
50 | 50 | </div> |
@@ -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> |