@@ -16,15 +16,17 @@ |
||
16 | 16 | public function queryFetch( $_query ) { |
17 | 17 | $result = $this->stdQuery($_query); |
18 | 18 | $rows = []; |
19 | - while($row = $result->fetch_assoc()) |
|
20 | - $rows[] = $row; |
|
19 | + while($row = $result->fetch_assoc()) { |
|
20 | + $rows[] = $row; |
|
21 | + } |
|
21 | 22 | return $rows; |
22 | 23 | } |
23 | 24 | public function queryArray( $_query ) { |
24 | 25 | $result = $this->stdQuery($_query); |
25 | 26 | $rows = []; |
26 | - while($row = $result->fetch_array()) |
|
27 | - $rows[] = $row; |
|
27 | + while($row = $result->fetch_array()) { |
|
28 | + $rows[] = $row; |
|
29 | + } |
|
28 | 30 | return $rows; |
29 | 31 | } |
30 | 32 | protected function stdQuery( $_query ) { |
@@ -1,48 +1,48 @@ |
||
1 | 1 | <?php |
2 | 2 | jRequire("ConnectionInterface.php"); |
3 | 3 | class ConnectionMysqliAdapter implements ConnectionAdapterInterface { |
4 | - public $connection; |
|
5 | - public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
6 | - try { |
|
7 | - $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db ); |
|
8 | - } catch( Exception $error ) { |
|
9 | - Debug::fatal($error->getMessage()); |
|
10 | - exit(); |
|
11 | - } |
|
12 | - } |
|
13 | - public function query( $_query ) { |
|
14 | - $this->stdQuery($_query); |
|
15 | - return true; |
|
16 | - } |
|
17 | - public function queryInsert( $_query ) { |
|
18 | - $this->stdQuery($_query); |
|
19 | - return $this->connection->insert_id; |
|
20 | - } |
|
21 | - public function queryFetch( $_query ) { |
|
22 | - $result = $this->stdQuery($_query); |
|
23 | - $rows = []; |
|
24 | - while($row = $result->fetch_assoc()) |
|
25 | - $rows[] = $row; |
|
26 | - return $rows; |
|
27 | - } |
|
28 | - public function queryArray( $_query ) { |
|
29 | - $result = $this->stdQuery($_query); |
|
30 | - $rows = []; |
|
31 | - while($row = $result->fetch_array()) |
|
32 | - $rows[] = $row; |
|
33 | - return $rows; |
|
34 | - } |
|
35 | - protected function stdQuery( $_query ) { |
|
36 | - $database = $this->connection; |
|
37 | - $result = $database->query($_query); |
|
38 | - if(!$result) { |
|
39 | - Debug::fatal([ |
|
40 | - "query" => $_query, |
|
41 | - "error" => $database->error |
|
42 | - ]); |
|
43 | - exit(); |
|
44 | - } |
|
45 | - return $result; |
|
46 | - } |
|
4 | + public $connection; |
|
5 | + public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
6 | + try { |
|
7 | + $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db ); |
|
8 | + } catch( Exception $error ) { |
|
9 | + Debug::fatal($error->getMessage()); |
|
10 | + exit(); |
|
11 | + } |
|
12 | + } |
|
13 | + public function query( $_query ) { |
|
14 | + $this->stdQuery($_query); |
|
15 | + return true; |
|
16 | + } |
|
17 | + public function queryInsert( $_query ) { |
|
18 | + $this->stdQuery($_query); |
|
19 | + return $this->connection->insert_id; |
|
20 | + } |
|
21 | + public function queryFetch( $_query ) { |
|
22 | + $result = $this->stdQuery($_query); |
|
23 | + $rows = []; |
|
24 | + while($row = $result->fetch_assoc()) |
|
25 | + $rows[] = $row; |
|
26 | + return $rows; |
|
27 | + } |
|
28 | + public function queryArray( $_query ) { |
|
29 | + $result = $this->stdQuery($_query); |
|
30 | + $rows = []; |
|
31 | + while($row = $result->fetch_array()) |
|
32 | + $rows[] = $row; |
|
33 | + return $rows; |
|
34 | + } |
|
35 | + protected function stdQuery( $_query ) { |
|
36 | + $database = $this->connection; |
|
37 | + $result = $database->query($_query); |
|
38 | + if(!$result) { |
|
39 | + Debug::fatal([ |
|
40 | + "query" => $_query, |
|
41 | + "error" => $database->error |
|
42 | + ]); |
|
43 | + exit(); |
|
44 | + } |
|
45 | + return $result; |
|
46 | + } |
|
47 | 47 | } |
48 | 48 | ?> |
@@ -2,40 +2,40 @@ |
||
2 | 2 | jRequire("ConnectionInterface.php"); |
3 | 3 | class ConnectionMysqliAdapter implements ConnectionAdapterInterface { |
4 | 4 | public $connection; |
5 | - public function __construct( $_srv, $_db, $_usr, $_pass ) { |
|
5 | + public function __construct($_srv, $_db, $_usr, $_pass) { |
|
6 | 6 | try { |
7 | - $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db ); |
|
8 | - } catch( Exception $error ) { |
|
7 | + $this->connection = new mysqli($_srv, $_usr, $_pass, $_db); |
|
8 | + } catch (Exception $error) { |
|
9 | 9 | Debug::fatal($error->getMessage()); |
10 | 10 | exit(); |
11 | 11 | } |
12 | 12 | } |
13 | - public function query( $_query ) { |
|
13 | + public function query($_query) { |
|
14 | 14 | $this->stdQuery($_query); |
15 | 15 | return true; |
16 | 16 | } |
17 | - public function queryInsert( $_query ) { |
|
17 | + public function queryInsert($_query) { |
|
18 | 18 | $this->stdQuery($_query); |
19 | 19 | return $this->connection->insert_id; |
20 | 20 | } |
21 | - public function queryFetch( $_query ) { |
|
21 | + public function queryFetch($_query) { |
|
22 | 22 | $result = $this->stdQuery($_query); |
23 | 23 | $rows = []; |
24 | - while($row = $result->fetch_assoc()) |
|
24 | + while ($row = $result->fetch_assoc()) |
|
25 | 25 | $rows[] = $row; |
26 | 26 | return $rows; |
27 | 27 | } |
28 | - public function queryArray( $_query ) { |
|
28 | + public function queryArray($_query) { |
|
29 | 29 | $result = $this->stdQuery($_query); |
30 | 30 | $rows = []; |
31 | - while($row = $result->fetch_array()) |
|
31 | + while ($row = $result->fetch_array()) |
|
32 | 32 | $rows[] = $row; |
33 | 33 | return $rows; |
34 | 34 | } |
35 | - protected function stdQuery( $_query ) { |
|
35 | + protected function stdQuery($_query) { |
|
36 | 36 | $database = $this->connection; |
37 | 37 | $result = $database->query($_query); |
38 | - if(!$result) { |
|
38 | + if (!$result) { |
|
39 | 39 | Debug::fatal([ |
40 | 40 | "query" => $_query, |
41 | 41 | "error" => $database->error |
@@ -8,20 +8,20 @@ discard block |
||
8 | 8 | parent::__construct(); |
9 | 9 | $args = func_get_args(); |
10 | 10 | $count = func_num_args(); |
11 | - if (method_exists($this,$func='__construct'.$count)) |
|
12 | - call_user_func_array(array($this,$func),$args); |
|
11 | + if (method_exists($this, $func = '__construct'.$count)) |
|
12 | + call_user_func_array(array($this, $func), $args); |
|
13 | 13 | } |
14 | 14 | public function __construct0() { |
15 | 15 | $this->database = null; |
16 | 16 | } |
17 | - public function __construct4 ( $_srv, $_db, $_usr, $_pass ) { |
|
17 | + public function __construct4($_srv, $_db, $_usr, $_pass) { |
|
18 | 18 | $this->setConnection($_srv, $_db, $_usr, $_pass, "pdo"); |
19 | 19 | } |
20 | - public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
20 | + public function __construct5($_srv, $_db, $_usr, $_pass, $_type) { |
|
21 | 21 | $type = $this->getConnectionType($_type); |
22 | 22 | $this->setConnection($_srv, $_db, $_usr, $_pass, $type); |
23 | 23 | } |
24 | - protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
24 | + protected function setConnection($_srv, $_db, $_usr, $_pass, $_type) { |
|
25 | 25 | switch ($_type) { |
26 | 26 | case "mysqli": |
27 | 27 | $this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass); |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | $this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass); |
31 | 31 | break; |
32 | 32 | } |
33 | - $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
|
33 | + $this->setConnectionParameters($_srv, $_db, $_usr, $_pass); |
|
34 | 34 | } |
35 | - protected function getConnectionType( $_type ) { |
|
35 | + protected function getConnectionType($_type) { |
|
36 | 36 | foreach ($_type as $key => $value) |
37 | - if($value) |
|
37 | + if ($value) |
|
38 | 38 | return $key; |
39 | 39 | return "pdo"; |
40 | 40 | } |
41 | - protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
|
41 | + protected function setConnectionParameters($_srv, $_db, $_usr, $_pass) { |
|
42 | 42 | $this->info = []; |
43 | 43 | $this->info["server"] = $_srv; |
44 | 44 | $this->info["database"] = $_db; |
@@ -8,8 +8,9 @@ discard block |
||
8 | 8 | parent::__construct(); |
9 | 9 | $args = func_get_args(); |
10 | 10 | $count = func_num_args(); |
11 | - if (method_exists($this,$func='__construct'.$count)) |
|
12 | - call_user_func_array(array($this,$func),$args); |
|
11 | + if (method_exists($this,$func='__construct'.$count)) { |
|
12 | + call_user_func_array(array($this,$func),$args); |
|
13 | + } |
|
13 | 14 | } |
14 | 15 | public function __construct0() { |
15 | 16 | $this->database = null; |
@@ -33,9 +34,10 @@ discard block |
||
33 | 34 | $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
34 | 35 | } |
35 | 36 | protected function getConnectionType( $_type ) { |
36 | - foreach ($_type as $key => $value) |
|
37 | - if($value) |
|
37 | + foreach ($_type as $key => $value) { |
|
38 | + if($value) |
|
38 | 39 | return $key; |
40 | + } |
|
39 | 41 | return "pdo"; |
40 | 42 | } |
41 | 43 | protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
@@ -2,51 +2,51 @@ |
||
2 | 2 | jRequire("../Module/Module.php"); |
3 | 3 | requireComponents("Adapters"); |
4 | 4 | class Connection extends Module { |
5 | - public $database; |
|
6 | - public $info; |
|
7 | - public function __construct() { |
|
8 | - parent::__construct(); |
|
9 | - $args = func_get_args(); |
|
10 | - $count = func_num_args(); |
|
11 | - if (method_exists($this,$func='__construct'.$count)) |
|
12 | - call_user_func_array(array($this,$func),$args); |
|
13 | - } |
|
14 | - public function __construct0() { |
|
15 | - $this->database = null; |
|
16 | - } |
|
17 | - public function __construct4 ( $_srv, $_db, $_usr, $_pass ) { |
|
18 | - $this->setConnection($_srv, $_db, $_usr, $_pass, "pdo"); |
|
19 | - } |
|
20 | - public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
21 | - $type = $this->getConnectionType($_type); |
|
22 | - $this->setConnection($_srv, $_db, $_usr, $_pass, $type); |
|
23 | - } |
|
24 | - protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
25 | - switch ($_type) { |
|
26 | - case "mysqli": |
|
27 | - $this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass); |
|
28 | - break; |
|
29 | - case "postgresql": |
|
30 | - $this->database = new ConnectionPostgresqlAdapter($_srv, $_db, $_usr, $_pass); |
|
31 | - break; |
|
32 | - default: |
|
33 | - $this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass); |
|
34 | - break; |
|
35 | - } |
|
36 | - $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
|
37 | - } |
|
38 | - protected function getConnectionType( $_type ) { |
|
39 | - foreach ($_type as $key => $value) |
|
40 | - if($value) |
|
41 | - return $key; |
|
42 | - return "pdo"; |
|
43 | - } |
|
44 | - protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
|
45 | - $this->info = []; |
|
46 | - $this->info["server"] = $_srv; |
|
47 | - $this->info["database"] = $_db; |
|
48 | - $this->info["user"] = $_usr; |
|
49 | - $this->info["password"] = $_pass; |
|
50 | - } |
|
5 | + public $database; |
|
6 | + public $info; |
|
7 | + public function __construct() { |
|
8 | + parent::__construct(); |
|
9 | + $args = func_get_args(); |
|
10 | + $count = func_num_args(); |
|
11 | + if (method_exists($this,$func='__construct'.$count)) |
|
12 | + call_user_func_array(array($this,$func),$args); |
|
13 | + } |
|
14 | + public function __construct0() { |
|
15 | + $this->database = null; |
|
16 | + } |
|
17 | + public function __construct4 ( $_srv, $_db, $_usr, $_pass ) { |
|
18 | + $this->setConnection($_srv, $_db, $_usr, $_pass, "pdo"); |
|
19 | + } |
|
20 | + public function __construct5 ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
21 | + $type = $this->getConnectionType($_type); |
|
22 | + $this->setConnection($_srv, $_db, $_usr, $_pass, $type); |
|
23 | + } |
|
24 | + protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) { |
|
25 | + switch ($_type) { |
|
26 | + case "mysqli": |
|
27 | + $this->database = new ConnectionMysqliAdapter($_srv, $_db, $_usr, $_pass); |
|
28 | + break; |
|
29 | + case "postgresql": |
|
30 | + $this->database = new ConnectionPostgresqlAdapter($_srv, $_db, $_usr, $_pass); |
|
31 | + break; |
|
32 | + default: |
|
33 | + $this->database = new ConnectionPdoAdapter($_srv, $_db, $_usr, $_pass); |
|
34 | + break; |
|
35 | + } |
|
36 | + $this->setConnectionParameters( $_srv, $_db, $_usr, $_pass); |
|
37 | + } |
|
38 | + protected function getConnectionType( $_type ) { |
|
39 | + foreach ($_type as $key => $value) |
|
40 | + if($value) |
|
41 | + return $key; |
|
42 | + return "pdo"; |
|
43 | + } |
|
44 | + protected function setConnectionParameters( $_srv, $_db, $_usr, $_pass) { |
|
45 | + $this->info = []; |
|
46 | + $this->info["server"] = $_srv; |
|
47 | + $this->info["database"] = $_db; |
|
48 | + $this->info["user"] = $_usr; |
|
49 | + $this->info["password"] = $_pass; |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | ?> |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | jRequire("../Module/Module.php"); |
3 | 3 | class Router extends Module { |
4 | - public function __construct() { |
|
5 | - parent::__construct(); |
|
6 | - } |
|
7 | - public function getPage() { |
|
8 | - $request = $this->parameters["app"]->server["REQUEST_URI"]; |
|
9 | - $base = $this->parameters["app"]->server["RELATIVE"]; |
|
10 | - $url = str_replace($base, "", $request); |
|
11 | - $url = explode("/", $url); |
|
12 | - return $url; |
|
13 | - } |
|
4 | + public function __construct() { |
|
5 | + parent::__construct(); |
|
6 | + } |
|
7 | + public function getPage() { |
|
8 | + $request = $this->parameters["app"]->server["REQUEST_URI"]; |
|
9 | + $base = $this->parameters["app"]->server["RELATIVE"]; |
|
10 | + $url = str_replace($base, "", $request); |
|
11 | + $url = explode("/", $url); |
|
12 | + return $url; |
|
13 | + } |
|
14 | 14 | } |
15 | 15 | ?> |
@@ -6,7 +6,7 @@ |
||
6 | 6 | } |
7 | 7 | public function getPage() { |
8 | 8 | $request = $this->parameters["app"]->server["REQUEST_URI"]; |
9 | - $base = $this->parameters["app"]->server["RELATIVE"]; |
|
9 | + $base = $this->parameters["app"]->server["RELATIVE"]; |
|
10 | 10 | $url = str_replace($base, "", $request); |
11 | 11 | $url = explode("/", $url); |
12 | 12 | return $url; |
@@ -1,49 +1,49 @@ |
||
1 | 1 | <?php |
2 | 2 | requireComponent("../Query/Query.php"); |
3 | 3 | class Html extends Query { |
4 | - public function __construct( $_parameters = [ "app" => null, "page" => null] ) { |
|
5 | - parent::__construct(); |
|
6 | - $this->data["template"] = ""; |
|
7 | - $this->tags["brand"] = ""; |
|
8 | - $this->tags["brandImg"] = ""; |
|
9 | - $this->tags["menu"] = ""; |
|
10 | - $this->tags["title"] = ""; |
|
11 | - $this->tags["subtitle"] = ""; |
|
12 | - $this->tags["content"] = ""; |
|
13 | - $this->tags["outContent"] = ""; |
|
14 | - $this->tags["footer"] = ""; |
|
15 | - $this->tags["pagePath"] = []; |
|
16 | - $this->tags["css"] = []; |
|
17 | - $this->tags["js"] = []; |
|
18 | - $this->tags["jsVariables"] = []; |
|
19 | - $this->tags["metaDescription"] = []; |
|
20 | - $this->tags["metaKeywords"] = []; |
|
21 | - $this->tags["metaAuthor"] = []; |
|
22 | - $this->parameters = $_parameters; |
|
23 | - $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
24 | - } |
|
25 | - public function uniforma() { |
|
26 | - $this->addDipendences(); |
|
27 | - $this->tags["css"] = array_unique($this->tags["css"]); |
|
28 | - $this->tags["js"] = array_unique($this->tags["js"]); |
|
29 | - $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
30 | - $tempStr = ""; |
|
31 | - $timeParameter = "?t=".time(); |
|
32 | - $time = ($this->parameters["app"]->cache->css == true) ? "" : $timeParameter; |
|
33 | - foreach ($this->tags["css"] as $i) |
|
34 | - $tempStr .= "<link rel='stylesheet' href='$i$time'>"; |
|
35 | - $this->tags["css"] = $tempStr; |
|
36 | - $tempStr = ""; |
|
37 | - $time = ($this->parameters["app"]->cache->js == true) ? "" : $timeParameter; |
|
38 | - foreach ($this->tags["js"] as $i) |
|
39 | - $tempStr .= "<script src='$i$time'></script>"; |
|
40 | - $this->tags["js"] = $tempStr; |
|
41 | - $tempStr = ""; |
|
42 | - $tempStr .= "<script type='text/javascript'>"; |
|
43 | - foreach ($this->tags["jsVariables"] as $i) |
|
44 | - $tempStr .= " $i[0] = $i[1];\n"; |
|
45 | - $tempStr .= "</script>"; |
|
46 | - $this->tags["jsVariables"] = $tempStr; |
|
47 | - } |
|
4 | + public function __construct( $_parameters = [ "app" => null, "page" => null] ) { |
|
5 | + parent::__construct(); |
|
6 | + $this->data["template"] = ""; |
|
7 | + $this->tags["brand"] = ""; |
|
8 | + $this->tags["brandImg"] = ""; |
|
9 | + $this->tags["menu"] = ""; |
|
10 | + $this->tags["title"] = ""; |
|
11 | + $this->tags["subtitle"] = ""; |
|
12 | + $this->tags["content"] = ""; |
|
13 | + $this->tags["outContent"] = ""; |
|
14 | + $this->tags["footer"] = ""; |
|
15 | + $this->tags["pagePath"] = []; |
|
16 | + $this->tags["css"] = []; |
|
17 | + $this->tags["js"] = []; |
|
18 | + $this->tags["jsVariables"] = []; |
|
19 | + $this->tags["metaDescription"] = []; |
|
20 | + $this->tags["metaKeywords"] = []; |
|
21 | + $this->tags["metaAuthor"] = []; |
|
22 | + $this->parameters = $_parameters; |
|
23 | + $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
24 | + } |
|
25 | + public function uniforma() { |
|
26 | + $this->addDipendences(); |
|
27 | + $this->tags["css"] = array_unique($this->tags["css"]); |
|
28 | + $this->tags["js"] = array_unique($this->tags["js"]); |
|
29 | + $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
30 | + $tempStr = ""; |
|
31 | + $timeParameter = "?t=".time(); |
|
32 | + $time = ($this->parameters["app"]->cache->css == true) ? "" : $timeParameter; |
|
33 | + foreach ($this->tags["css"] as $i) |
|
34 | + $tempStr .= "<link rel='stylesheet' href='$i$time'>"; |
|
35 | + $this->tags["css"] = $tempStr; |
|
36 | + $tempStr = ""; |
|
37 | + $time = ($this->parameters["app"]->cache->js == true) ? "" : $timeParameter; |
|
38 | + foreach ($this->tags["js"] as $i) |
|
39 | + $tempStr .= "<script src='$i$time'></script>"; |
|
40 | + $this->tags["js"] = $tempStr; |
|
41 | + $tempStr = ""; |
|
42 | + $tempStr .= "<script type='text/javascript'>"; |
|
43 | + foreach ($this->tags["jsVariables"] as $i) |
|
44 | + $tempStr .= " $i[0] = $i[1];\n"; |
|
45 | + $tempStr .= "</script>"; |
|
46 | + $this->tags["jsVariables"] = $tempStr; |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | ?> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | requireComponent("../Query/Query.php"); |
3 | 3 | class Html extends Query { |
4 | - public function __construct( $_parameters = [ "app" => null, "page" => null] ) { |
|
4 | + public function __construct($_parameters = ["app" => null, "page" => null]) { |
|
5 | 5 | parent::__construct(); |
6 | 6 | $this->data["template"] = ""; |
7 | 7 | $this->tags["brand"] = ""; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | public function uniforma() { |
26 | 26 | $this->addDipendences(); |
27 | - $this->tags["css"] = array_unique($this->tags["css"]); |
|
27 | + $this->tags["css"] = array_unique($this->tags["css"]); |
|
28 | 28 | $this->tags["js"] = array_unique($this->tags["js"]); |
29 | 29 | $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
30 | 30 | $tempStr = ""; |
@@ -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,89 +1,89 @@ |
||
1 | 1 | <?php |
2 | 2 | jRequire("../Query/Query.php"); |
3 | 3 | class Menu extends Query { |
4 | - public function __construct() { |
|
5 | - parent::__construct(); |
|
6 | - } |
|
7 | - public function init() { |
|
8 | - $menu = $this->queryFetch("SELECT * FROM menu WHERE flag_active = 1 ORDER BY `order`"); |
|
9 | - $temp = []; |
|
10 | - foreach ($menu as $i) { |
|
11 | - if($i["fk_menu"] == 0) { |
|
12 | - $pk_menu = $i["pk_menu"]; |
|
13 | - array_push($temp, array("label" => $i["label"], "link" => $i["link"], "submenu" => [], "relative" => false)); |
|
14 | - $submenu = $this->queryFetch("SELECT * FROM menu WHERE fk_menu = $pk_menu ORDER BY `order`"); |
|
15 | - if($submenu) |
|
16 | - foreach ($submenu as $j) |
|
17 | - array_push( $temp[count($temp)-1]["submenu"], array("label" => $j["label"], "link" => $j["link"], "submenu" => [], "relative" => false) ); |
|
18 | - } |
|
19 | - } |
|
20 | - $this->tags["menu"] = $temp; |
|
21 | - return $temp; |
|
22 | - } |
|
23 | - public function draw() { |
|
24 | - $temp = ""; |
|
25 | - $host = $this->parameters["app"]->server["HTTP_HOST"]; |
|
26 | - $uri = $this->parameters["app"]->server["REQUEST_URI"]; |
|
27 | - $actualLink = "http://$host$uri"; |
|
28 | - $relative = $this->parameters["app"]->server["RELATIVE"]; |
|
29 | - foreach ($this->tags["menu"] as $i) { |
|
30 | - $prePath = ""; |
|
31 | - if($i["relative"]) |
|
32 | - $prePath = $relative; |
|
33 | - $active = $this->isSubString($actualLink, array_merge(array_column($i["submenu"], 'link'), array($i["link"]))) ? "active" : ""; |
|
34 | - if( is_array($i["submenu"]) && count($i["submenu"])<1) |
|
35 | - $temp .= "<li class='$active'><a href='$prePath$i[link]'>$i[label]</a></li>"; |
|
36 | - else { |
|
37 | - $temp .= "<li class='dropdown $active'>"; |
|
38 | - $temp .= |
|
39 | - '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'. |
|
40 | - $i["label"]. |
|
41 | - '<span class="caret"></span>'. |
|
42 | - '</a>'. |
|
43 | - '<ul class="dropdown-menu">'; |
|
44 | - foreach ($i["submenu"] as $j) { |
|
45 | - $prePath = ""; |
|
46 | - if($j["relative"]) |
|
47 | - $prePath = $relative; |
|
48 | - $temp .= "<li><a href='$prePath$j[link]'>$j[label]</a></li>"; |
|
49 | - } |
|
50 | - $temp .= "</ul></li>"; |
|
51 | - } |
|
52 | - } |
|
53 | - return $temp; |
|
54 | - } |
|
55 | - protected function isSubString( $_string, $_list) { |
|
56 | - $success = false; |
|
57 | - foreach ($_list as $i) |
|
58 | - if(strpos($_string,$i) !== false) |
|
59 | - $success = true; |
|
60 | - return $success; |
|
61 | - } |
|
62 | - public function loginWithUser() { |
|
63 | - $this->init(); |
|
64 | - $temp = []; |
|
65 | - if(!isset($_SESSION["username"])) |
|
66 | - $_SESSION["username"] ="guest"; |
|
67 | - $user = $_SESSION["username"]; |
|
68 | - $blackList = $this->queryFetch( |
|
69 | - "SELECT user.*,user_section.* |
|
4 | + public function __construct() { |
|
5 | + parent::__construct(); |
|
6 | + } |
|
7 | + public function init() { |
|
8 | + $menu = $this->queryFetch("SELECT * FROM menu WHERE flag_active = 1 ORDER BY `order`"); |
|
9 | + $temp = []; |
|
10 | + foreach ($menu as $i) { |
|
11 | + if($i["fk_menu"] == 0) { |
|
12 | + $pk_menu = $i["pk_menu"]; |
|
13 | + array_push($temp, array("label" => $i["label"], "link" => $i["link"], "submenu" => [], "relative" => false)); |
|
14 | + $submenu = $this->queryFetch("SELECT * FROM menu WHERE fk_menu = $pk_menu ORDER BY `order`"); |
|
15 | + if($submenu) |
|
16 | + foreach ($submenu as $j) |
|
17 | + array_push( $temp[count($temp)-1]["submenu"], array("label" => $j["label"], "link" => $j["link"], "submenu" => [], "relative" => false) ); |
|
18 | + } |
|
19 | + } |
|
20 | + $this->tags["menu"] = $temp; |
|
21 | + return $temp; |
|
22 | + } |
|
23 | + public function draw() { |
|
24 | + $temp = ""; |
|
25 | + $host = $this->parameters["app"]->server["HTTP_HOST"]; |
|
26 | + $uri = $this->parameters["app"]->server["REQUEST_URI"]; |
|
27 | + $actualLink = "http://$host$uri"; |
|
28 | + $relative = $this->parameters["app"]->server["RELATIVE"]; |
|
29 | + foreach ($this->tags["menu"] as $i) { |
|
30 | + $prePath = ""; |
|
31 | + if($i["relative"]) |
|
32 | + $prePath = $relative; |
|
33 | + $active = $this->isSubString($actualLink, array_merge(array_column($i["submenu"], 'link'), array($i["link"]))) ? "active" : ""; |
|
34 | + if( is_array($i["submenu"]) && count($i["submenu"])<1) |
|
35 | + $temp .= "<li class='$active'><a href='$prePath$i[link]'>$i[label]</a></li>"; |
|
36 | + else { |
|
37 | + $temp .= "<li class='dropdown $active'>"; |
|
38 | + $temp .= |
|
39 | + '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'. |
|
40 | + $i["label"]. |
|
41 | + '<span class="caret"></span>'. |
|
42 | + '</a>'. |
|
43 | + '<ul class="dropdown-menu">'; |
|
44 | + foreach ($i["submenu"] as $j) { |
|
45 | + $prePath = ""; |
|
46 | + if($j["relative"]) |
|
47 | + $prePath = $relative; |
|
48 | + $temp .= "<li><a href='$prePath$j[link]'>$j[label]</a></li>"; |
|
49 | + } |
|
50 | + $temp .= "</ul></li>"; |
|
51 | + } |
|
52 | + } |
|
53 | + return $temp; |
|
54 | + } |
|
55 | + protected function isSubString( $_string, $_list) { |
|
56 | + $success = false; |
|
57 | + foreach ($_list as $i) |
|
58 | + if(strpos($_string,$i) !== false) |
|
59 | + $success = true; |
|
60 | + return $success; |
|
61 | + } |
|
62 | + public function loginWithUser() { |
|
63 | + $this->init(); |
|
64 | + $temp = []; |
|
65 | + if(!isset($_SESSION["username"])) |
|
66 | + $_SESSION["username"] ="guest"; |
|
67 | + $user = $_SESSION["username"]; |
|
68 | + $blackList = $this->queryFetch( |
|
69 | + "SELECT user.*,user_section.* |
|
70 | 70 | FROM user |
71 | 71 | INNER JOIN user_x_section |
72 | 72 | ON user.pk_user = user_x_section.fk_user |
73 | 73 | INNER JOIN user_section |
74 | 74 | ON user_section.pk_user_section = user_x_section.fk_user_section |
75 | 75 | WHERE user.username = '$user'" |
76 | - ); |
|
77 | - foreach ($this->tags["menu"] as $i) { |
|
78 | - $success = true; |
|
79 | - $k = $i["label"]; |
|
80 | - foreach ($blackList as $j) |
|
81 | - if( $j["section"] == $k) |
|
82 | - $success = false; |
|
83 | - if($success) |
|
84 | - array_push($temp,$i); |
|
85 | - } |
|
86 | - $this->tags["menu"] = $temp; |
|
87 | - } |
|
76 | + ); |
|
77 | + foreach ($this->tags["menu"] as $i) { |
|
78 | + $success = true; |
|
79 | + $k = $i["label"]; |
|
80 | + foreach ($blackList as $j) |
|
81 | + if( $j["section"] == $k) |
|
82 | + $success = false; |
|
83 | + if($success) |
|
84 | + array_push($temp,$i); |
|
85 | + } |
|
86 | + $this->tags["menu"] = $temp; |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | ?> |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | $menu = $this->queryFetch("SELECT * FROM menu WHERE flag_active = 1 ORDER BY `order`"); |
9 | 9 | $temp = []; |
10 | 10 | foreach ($menu as $i) { |
11 | - if($i["fk_menu"] == 0) { |
|
11 | + if ($i["fk_menu"] == 0) { |
|
12 | 12 | $pk_menu = $i["pk_menu"]; |
13 | 13 | array_push($temp, array("label" => $i["label"], "link" => $i["link"], "submenu" => [], "relative" => false)); |
14 | 14 | $submenu = $this->queryFetch("SELECT * FROM menu WHERE fk_menu = $pk_menu ORDER BY `order`"); |
15 | - if($submenu) |
|
15 | + if ($submenu) |
|
16 | 16 | foreach ($submenu as $j) |
17 | - array_push( $temp[count($temp)-1]["submenu"], array("label" => $j["label"], "link" => $j["link"], "submenu" => [], "relative" => false) ); |
|
17 | + array_push($temp[count($temp) - 1]["submenu"], array("label" => $j["label"], "link" => $j["link"], "submenu" => [], "relative" => false)); |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | $this->tags["menu"] = $temp; |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | $relative = $this->parameters["app"]->server["RELATIVE"]; |
29 | 29 | foreach ($this->tags["menu"] as $i) { |
30 | 30 | $prePath = ""; |
31 | - if($i["relative"]) |
|
31 | + if ($i["relative"]) |
|
32 | 32 | $prePath = $relative; |
33 | 33 | $active = $this->isSubString($actualLink, array_merge(array_column($i["submenu"], 'link'), array($i["link"]))) ? "active" : ""; |
34 | - if( is_array($i["submenu"]) && count($i["submenu"])<1) |
|
34 | + if (is_array($i["submenu"]) && count($i["submenu"]) < 1) |
|
35 | 35 | $temp .= "<li class='$active'><a href='$prePath$i[link]'>$i[label]</a></li>"; |
36 | 36 | else { |
37 | 37 | $temp .= "<li class='dropdown $active'>"; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | '<ul class="dropdown-menu">'; |
44 | 44 | foreach ($i["submenu"] as $j) { |
45 | 45 | $prePath = ""; |
46 | - if($j["relative"]) |
|
46 | + if ($j["relative"]) |
|
47 | 47 | $prePath = $relative; |
48 | 48 | $temp .= "<li><a href='$prePath$j[link]'>$j[label]</a></li>"; |
49 | 49 | } |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | } |
53 | 53 | return $temp; |
54 | 54 | } |
55 | - protected function isSubString( $_string, $_list) { |
|
55 | + protected function isSubString($_string, $_list) { |
|
56 | 56 | $success = false; |
57 | 57 | foreach ($_list as $i) |
58 | - if(strpos($_string,$i) !== false) |
|
58 | + if (strpos($_string, $i) !== false) |
|
59 | 59 | $success = true; |
60 | 60 | return $success; |
61 | 61 | } |
62 | 62 | public function loginWithUser() { |
63 | 63 | $this->init(); |
64 | 64 | $temp = []; |
65 | - if(!isset($_SESSION["username"])) |
|
66 | - $_SESSION["username"] ="guest"; |
|
65 | + if (!isset($_SESSION["username"])) |
|
66 | + $_SESSION["username"] = "guest"; |
|
67 | 67 | $user = $_SESSION["username"]; |
68 | 68 | $blackList = $this->queryFetch( |
69 | 69 | "SELECT user.*,user_section.* |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | $success = true; |
79 | 79 | $k = $i["label"]; |
80 | 80 | foreach ($blackList as $j) |
81 | - if( $j["section"] == $k) |
|
81 | + if ($j["section"] == $k) |
|
82 | 82 | $success = false; |
83 | - if($success) |
|
84 | - array_push($temp,$i); |
|
83 | + if ($success) |
|
84 | + array_push($temp, $i); |
|
85 | 85 | } |
86 | 86 | $this->tags["menu"] = $temp; |
87 | 87 | } |
@@ -12,9 +12,10 @@ discard block |
||
12 | 12 | $pk_menu = $i["pk_menu"]; |
13 | 13 | array_push($temp, array("label" => $i["label"], "link" => $i["link"], "submenu" => [], "relative" => false)); |
14 | 14 | $submenu = $this->queryFetch("SELECT * FROM menu WHERE fk_menu = $pk_menu ORDER BY `order`"); |
15 | - if($submenu) |
|
16 | - foreach ($submenu as $j) |
|
15 | + if($submenu) { |
|
16 | + foreach ($submenu as $j) |
|
17 | 17 | array_push( $temp[count($temp)-1]["submenu"], array("label" => $j["label"], "link" => $j["link"], "submenu" => [], "relative" => false) ); |
18 | + } |
|
18 | 19 | } |
19 | 20 | } |
20 | 21 | $this->tags["menu"] = $temp; |
@@ -28,12 +29,13 @@ discard block |
||
28 | 29 | $relative = $this->parameters["app"]->server["RELATIVE"]; |
29 | 30 | foreach ($this->tags["menu"] as $i) { |
30 | 31 | $prePath = ""; |
31 | - if($i["relative"]) |
|
32 | - $prePath = $relative; |
|
32 | + if($i["relative"]) { |
|
33 | + $prePath = $relative; |
|
34 | + } |
|
33 | 35 | $active = $this->isSubString($actualLink, array_merge(array_column($i["submenu"], 'link'), array($i["link"]))) ? "active" : ""; |
34 | - if( is_array($i["submenu"]) && count($i["submenu"])<1) |
|
35 | - $temp .= "<li class='$active'><a href='$prePath$i[link]'>$i[label]</a></li>"; |
|
36 | - else { |
|
36 | + if( is_array($i["submenu"]) && count($i["submenu"])<1) { |
|
37 | + $temp .= "<li class='$active'><a href='$prePath$i[link]'>$i[label]</a></li>"; |
|
38 | + } else { |
|
37 | 39 | $temp .= "<li class='dropdown $active'>"; |
38 | 40 | $temp .= |
39 | 41 | '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'. |
@@ -43,8 +45,9 @@ discard block |
||
43 | 45 | '<ul class="dropdown-menu">'; |
44 | 46 | foreach ($i["submenu"] as $j) { |
45 | 47 | $prePath = ""; |
46 | - if($j["relative"]) |
|
47 | - $prePath = $relative; |
|
48 | + if($j["relative"]) { |
|
49 | + $prePath = $relative; |
|
50 | + } |
|
48 | 51 | $temp .= "<li><a href='$prePath$j[link]'>$j[label]</a></li>"; |
49 | 52 | } |
50 | 53 | $temp .= "</ul></li>"; |
@@ -54,16 +57,18 @@ discard block |
||
54 | 57 | } |
55 | 58 | protected function isSubString( $_string, $_list) { |
56 | 59 | $success = false; |
57 | - foreach ($_list as $i) |
|
58 | - if(strpos($_string,$i) !== false) |
|
60 | + foreach ($_list as $i) { |
|
61 | + if(strpos($_string,$i) !== false) |
|
59 | 62 | $success = true; |
63 | + } |
|
60 | 64 | return $success; |
61 | 65 | } |
62 | 66 | public function loginWithUser() { |
63 | 67 | $this->init(); |
64 | 68 | $temp = []; |
65 | - if(!isset($_SESSION["username"])) |
|
66 | - $_SESSION["username"] ="guest"; |
|
69 | + if(!isset($_SESSION["username"])) { |
|
70 | + $_SESSION["username"] ="guest"; |
|
71 | + } |
|
67 | 72 | $user = $_SESSION["username"]; |
68 | 73 | $blackList = $this->queryFetch( |
69 | 74 | "SELECT user.*,user_section.* |
@@ -77,11 +82,13 @@ discard block |
||
77 | 82 | foreach ($this->tags["menu"] as $i) { |
78 | 83 | $success = true; |
79 | 84 | $k = $i["label"]; |
80 | - foreach ($blackList as $j) |
|
81 | - if( $j["section"] == $k) |
|
85 | + foreach ($blackList as $j) { |
|
86 | + if( $j["section"] == $k) |
|
82 | 87 | $success = false; |
83 | - if($success) |
|
84 | - array_push($temp,$i); |
|
88 | + } |
|
89 | + if($success) { |
|
90 | + array_push($temp,$i); |
|
91 | + } |
|
85 | 92 | } |
86 | 93 | $this->tags["menu"] = $temp; |
87 | 94 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | function htmlParser( $_str) { |
3 | - return htmlentities($_str, ENT_QUOTES | ENT_IGNORE, "UTF-8"); |
|
3 | + return htmlentities($_str, ENT_QUOTES | ENT_IGNORE, "UTF-8"); |
|
4 | 4 | } |
5 | 5 | ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - function htmlParser( $_str) { |
|
2 | + function htmlParser($_str) { |
|
3 | 3 | return htmlentities($_str, ENT_QUOTES | ENT_IGNORE, "UTF-8"); |
4 | 4 | } |
5 | 5 | ?> |
@@ -1,56 +1,56 @@ |
||
1 | 1 | <?php |
2 | 2 | function getGitLog( $_dir = "./" ) { |
3 | - if(!file_exists($_dir)) |
|
4 | - return []; |
|
5 | - $currentDir = getcwd(); |
|
6 | - chdir($_dir); |
|
7 | - $gitHistory = []; |
|
8 | - $gitLogs = []; |
|
9 | - $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
|
10 | - $rootPath = str_replace('\\', '/', getcwd ()); |
|
11 | - $lastHash = null; |
|
12 | - if( $gitPath != $rootPath ) { |
|
13 | - chdir($currentDir); |
|
14 | - return []; |
|
15 | - } |
|
16 | - exec("git log --decorate=full --tags", $gitLogs); |
|
17 | - foreach ($gitLogs as $line) { |
|
18 | - $line = trim($line); |
|
19 | - if (!empty($line)) { |
|
20 | - if (strpos($line, 'commit') === 0) { |
|
21 | - $hash = explode(' ', $line); |
|
22 | - $hash = trim(end($hash)); |
|
23 | - $gitHistory[$hash] = [ |
|
24 | - 'tag' => '-1.0.0', |
|
25 | - 'author' => '', |
|
26 | - 'date' => '', |
|
27 | - 'message' => '' |
|
28 | - ]; |
|
29 | - $lastHash = $hash; |
|
30 | - if (strpos($line, 'tag') !== false) { |
|
31 | - $tag = explode(':', $line); |
|
32 | - $tag = explode('/', $tag[1]); |
|
33 | - $tag = explode(',', $tag[2]); |
|
34 | - $tag = explode(')', $tag[0]); |
|
35 | - $tag = trim($tag[0]); |
|
36 | - $gitHistory[$lastHash]['tag'] = $tag; |
|
37 | - } |
|
38 | - } |
|
39 | - else if (strpos($line, 'Author') === 0) { |
|
40 | - $author = explode(':', $line); |
|
41 | - $author = trim(end($author)); |
|
42 | - $gitHistory[$lastHash]['author'] = $author; |
|
43 | - } |
|
44 | - else if (strpos($line, 'Date') === 0) { |
|
45 | - $date = explode(':', $line, 2); |
|
46 | - $date = trim(end($date)); |
|
47 | - $gitHistory[$lastHash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
|
48 | - } |
|
49 | - else |
|
50 | - $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
51 | - } |
|
52 | - } |
|
53 | - chdir($currentDir); |
|
54 | - return $gitHistory; |
|
3 | + if(!file_exists($_dir)) |
|
4 | + return []; |
|
5 | + $currentDir = getcwd(); |
|
6 | + chdir($_dir); |
|
7 | + $gitHistory = []; |
|
8 | + $gitLogs = []; |
|
9 | + $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
|
10 | + $rootPath = str_replace('\\', '/', getcwd ()); |
|
11 | + $lastHash = null; |
|
12 | + if( $gitPath != $rootPath ) { |
|
13 | + chdir($currentDir); |
|
14 | + return []; |
|
15 | + } |
|
16 | + exec("git log --decorate=full --tags", $gitLogs); |
|
17 | + foreach ($gitLogs as $line) { |
|
18 | + $line = trim($line); |
|
19 | + if (!empty($line)) { |
|
20 | + if (strpos($line, 'commit') === 0) { |
|
21 | + $hash = explode(' ', $line); |
|
22 | + $hash = trim(end($hash)); |
|
23 | + $gitHistory[$hash] = [ |
|
24 | + 'tag' => '-1.0.0', |
|
25 | + 'author' => '', |
|
26 | + 'date' => '', |
|
27 | + 'message' => '' |
|
28 | + ]; |
|
29 | + $lastHash = $hash; |
|
30 | + if (strpos($line, 'tag') !== false) { |
|
31 | + $tag = explode(':', $line); |
|
32 | + $tag = explode('/', $tag[1]); |
|
33 | + $tag = explode(',', $tag[2]); |
|
34 | + $tag = explode(')', $tag[0]); |
|
35 | + $tag = trim($tag[0]); |
|
36 | + $gitHistory[$lastHash]['tag'] = $tag; |
|
37 | + } |
|
38 | + } |
|
39 | + else if (strpos($line, 'Author') === 0) { |
|
40 | + $author = explode(':', $line); |
|
41 | + $author = trim(end($author)); |
|
42 | + $gitHistory[$lastHash]['author'] = $author; |
|
43 | + } |
|
44 | + else if (strpos($line, 'Date') === 0) { |
|
45 | + $date = explode(':', $line, 2); |
|
46 | + $date = trim(end($date)); |
|
47 | + $gitHistory[$lastHash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
|
48 | + } |
|
49 | + else |
|
50 | + $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
51 | + } |
|
52 | + } |
|
53 | + chdir($currentDir); |
|
54 | + return $gitHistory; |
|
55 | 55 | } |
56 | 56 | ?> |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | - function getGitLog( $_dir = "./" ) { |
|
3 | - if(!file_exists($_dir)) |
|
2 | + function getGitLog($_dir = "./") { |
|
3 | + if (!file_exists($_dir)) |
|
4 | 4 | return []; |
5 | 5 | $currentDir = getcwd(); |
6 | 6 | chdir($_dir); |
7 | 7 | $gitHistory = []; |
8 | 8 | $gitLogs = []; |
9 | 9 | $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
10 | - $rootPath = str_replace('\\', '/', getcwd ()); |
|
10 | + $rootPath = str_replace('\\', '/', getcwd()); |
|
11 | 11 | $lastHash = null; |
12 | - if( $gitPath != $rootPath ) { |
|
12 | + if ($gitPath != $rootPath) { |
|
13 | 13 | chdir($currentDir); |
14 | 14 | return []; |
15 | 15 | } |
@@ -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); |
@@ -15,20 +15,20 @@ discard block |
||
15 | 15 | <div class="row" style="margin-top:20px;"> |
16 | 16 | <div class="col-lg-12"> |
17 | 17 | <?php |
18 | - $nPerCol = 6; |
|
19 | - $max = 12; |
|
20 | - $dim = $max / $nPerCol; |
|
21 | - $cont = 0; |
|
22 | - $percent; |
|
23 | - foreach (getGitLog() as $i) { |
|
24 | - $cont++; |
|
25 | - if($cont % $nPerCol == 1) |
|
26 | - echo '<div class="row">'; |
|
27 | - if(isset($i["tag"])) { |
|
28 | - $percent = explode(".",$i["tag"]); |
|
29 | - $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
|
30 | - } |
|
31 | - ?> |
|
18 | + $nPerCol = 6; |
|
19 | + $max = 12; |
|
20 | + $dim = $max / $nPerCol; |
|
21 | + $cont = 0; |
|
22 | + $percent; |
|
23 | + foreach (getGitLog() as $i) { |
|
24 | + $cont++; |
|
25 | + if($cont % $nPerCol == 1) |
|
26 | + echo '<div class="row">'; |
|
27 | + if(isset($i["tag"])) { |
|
28 | + $percent = explode(".",$i["tag"]); |
|
29 | + $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
|
30 | + } |
|
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> |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | </div> |
45 | 45 | </div> |
46 | 46 | <?php |
47 | - if($cont % $nPerCol == 0) |
|
48 | - echo '</div>'; |
|
49 | - } ?> |
|
47 | + if($cont % $nPerCol == 0) |
|
48 | + echo '</div>'; |
|
49 | + } ?> |
|
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 | </div> |
@@ -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> |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | if(!isset($GLOBALS["JATEPath"])) |
3 | - $GLOBALS["JATEPath"] = []; |
|
3 | + $GLOBALS["JATEPath"] = []; |
|
4 | 4 | $commonLocations = [ |
5 | - "bower_components/JATE/dist/" |
|
6 | - , "vendor/xaberr/jate/dist/" |
|
7 | - , "../../dist/" |
|
8 | - , "../dist/" |
|
9 | - , dirname(__FILE__)."/" |
|
5 | + "bower_components/JATE/dist/" |
|
6 | + , "vendor/xaberr/jate/dist/" |
|
7 | + , "../../dist/" |
|
8 | + , "../dist/" |
|
9 | + , dirname(__FILE__)."/" |
|
10 | 10 | ]; |
11 | 11 | $jSuccess = false; |
12 | 12 | foreach ($commonLocations as $path) |
13 | - if(file_exists("${path}jate/coreEngine.php")) { |
|
14 | - array_push($GLOBALS["JATEPath"], $path); |
|
15 | - require_once("${path}jate/coreEngine.php"); |
|
16 | - $jSuccess = true; |
|
17 | - break; |
|
18 | - } |
|
13 | + if(file_exists("${path}jate/coreEngine.php")) { |
|
14 | + array_push($GLOBALS["JATEPath"], $path); |
|
15 | + require_once("${path}jate/coreEngine.php"); |
|
16 | + $jSuccess = true; |
|
17 | + break; |
|
18 | + } |
|
19 | 19 | if( !$jSuccess ) |
20 | - throw new Exception("JATE can't find coreEngine.php."); |
|
20 | + throw new Exception("JATE can't find coreEngine.php."); |
|
21 | 21 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!isset($GLOBALS["JATEPath"])) |
|
2 | + if (!isset($GLOBALS["JATEPath"])) |
|
3 | 3 | $GLOBALS["JATEPath"] = []; |
4 | 4 | $commonLocations = [ |
5 | 5 | "bower_components/JATE/dist/" |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | ]; |
11 | 11 | $jSuccess = false; |
12 | 12 | foreach ($commonLocations as $path) |
13 | - if(file_exists("${path}jate/coreEngine.php")) { |
|
13 | + if (file_exists("${path}jate/coreEngine.php")) { |
|
14 | 14 | array_push($GLOBALS["JATEPath"], $path); |
15 | 15 | require_once("${path}jate/coreEngine.php"); |
16 | 16 | $jSuccess = true; |
17 | 17 | break; |
18 | 18 | } |
19 | - if( !$jSuccess ) |
|
19 | + if (!$jSuccess) |
|
20 | 20 | throw new Exception("JATE can't find coreEngine.php."); |
21 | 21 | ?> |
@@ -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 | + ?> |