@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | class Page404 extends Template { |
3 | - public function __construct( $_parameters ) { |
|
4 | - parent::__construct( $_parameters ); |
|
5 | - $this->tags["title"] = "JATE - 404"; |
|
3 | + public function __construct($_parameters) { |
|
4 | + parent::__construct($_parameters); |
|
5 | + $this->tags["title"] = "JATE - 404"; |
|
6 | 6 | $this->tags["content"] = $this->makePage(); |
7 | 7 | } |
8 | 8 | public function makePage() { |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | class Page01 extends Template { |
3 | - public function __construct( $_parameters ) { |
|
4 | - parent::__construct( $_parameters ); |
|
5 | - $this->tags["title"] = "JATE - Page01"; |
|
3 | + public function __construct($_parameters) { |
|
4 | + parent::__construct($_parameters); |
|
5 | + $this->tags["title"] = "JATE - Page01"; |
|
6 | 6 | $this->tags["content"] = $this->makePage(); |
7 | 7 | } |
8 | 8 | public function makePage() { |
@@ -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,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | class Home extends Template { |
3 | - public function __construct( $_parameters ) { |
|
4 | - parent::__construct( $_parameters ); |
|
5 | - $this->tags["title"] = "JATE - Home"; |
|
6 | - $this->tags["content"] = $this->makePage(); |
|
3 | + public function __construct($_parameters) { |
|
4 | + parent::__construct($_parameters); |
|
5 | + $this->tags["title"] = "JATE - Home"; |
|
6 | + $this->tags["content"] = $this->makePage(); |
|
7 | 7 | } |
8 | 8 | public function makePage() { |
9 | 9 | jBlock(); |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | class Items extends Template { |
3 | - public function __construct( $_parameters ) { |
|
4 | - parent::__construct( $_parameters ); |
|
5 | - $this->tags["title"] = "JATE - Items"; |
|
6 | - $this->tags["content"] = $this->makePage(); |
|
3 | + public function __construct($_parameters) { |
|
4 | + parent::__construct($_parameters); |
|
5 | + $this->tags["title"] = "JATE - Items"; |
|
6 | + $this->tags["content"] = $this->makePage(); |
|
7 | 7 | } |
8 | 8 | public function makePage() { |
9 | 9 | jBlock(); |
@@ -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,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class Template extends Html { |
3 | - public function __construct( $_parameters ) { |
|
4 | - parent::__construct( $_parameters ); |
|
3 | + public function __construct($_parameters) { |
|
4 | + parent::__construct($_parameters); |
|
5 | 5 | $this->addModule(new Menu()); |
6 | 6 | $this->makeConnection(); |
7 | 7 | $this->tags["brand"] = "JATE"; |
@@ -13,29 +13,29 @@ discard block |
||
13 | 13 | , "https://code.jquery.com/jquery-1.11.3.min.js" |
14 | 14 | , "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" |
15 | 15 | ]); |
16 | - $this->tags["metaDescription"] = "Beautiful description ."; |
|
17 | - $this->tags["metaKeywords"] = "JATE,PHP,JS,CSS"; |
|
18 | - $this->tags["metaAuthor"] = "XaBerr"; |
|
19 | - $this->tags["menu"] = $this->makeMenu(); |
|
16 | + $this->tags["metaDescription"] = "Beautiful description ."; |
|
17 | + $this->tags["metaKeywords"] = "JATE,PHP,JS,CSS"; |
|
18 | + $this->tags["metaAuthor"] = "XaBerr"; |
|
19 | + $this->tags["menu"] = $this->makeMenu(); |
|
20 | 20 | } |
21 | 21 | public function makeConnection() { |
22 | 22 | $jConfig = $this->parameters["app"]; |
23 | 23 | $connection = null; |
24 | - if( $jConfig != null && $jConfig->connection["enable"]) |
|
24 | + if ($jConfig != null && $jConfig->connection["enable"]) |
|
25 | 25 | $connection = new Connection( |
26 | 26 | $jConfig->connection["server"] |
27 | 27 | , $jConfig->connection["database"] |
28 | 28 | , $jConfig->connection["user"] |
29 | 29 | , $jConfig->connection["password"] |
30 | 30 | ); |
31 | - $this->addConnection("base",$connection); |
|
31 | + $this->addConnection("base", $connection); |
|
32 | 32 | } |
33 | 33 | public function makeMenu() { |
34 | 34 | $this->modules["Menu"]->tags["menu"] = [ |
35 | - ["label"=>"Home", "link"=>"/Home", "submenu"=>[], "relative"=>true] |
|
36 | - , ["label"=>"Items 1", "link"=>"/Items/1", "submenu"=>[], "relative"=>true] |
|
37 | - , ["label"=>"Items 2", "link"=>"/Items/2", "submenu"=>[], "relative"=>true] |
|
38 | - , ["label"=>"Items 3", "link"=>"/Items/3", "submenu"=>[], "relative"=>true] |
|
35 | + ["label"=>"Home", "link"=>"/Home", "submenu"=>[], "relative"=>true] |
|
36 | + , ["label"=>"Items 1", "link"=>"/Items/1", "submenu"=>[], "relative"=>true] |
|
37 | + , ["label"=>"Items 2", "link"=>"/Items/2", "submenu"=>[], "relative"=>true] |
|
38 | + , ["label"=>"Items 3", "link"=>"/Items/3", "submenu"=>[], "relative"=>true] |
|
39 | 39 | ]; |
40 | 40 | $temp = $this->modules["Menu"]->draw(); |
41 | 41 | return $temp; |
@@ -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 = array( |
5 | 5 | "bower_components/JATE/dist/", |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | "../../dist/" |
8 | 8 | ); |
9 | 9 | foreach ($commonLocations as $i) |
10 | - if(file_exists($i."jate/coreEngine.php")) { |
|
10 | + if (file_exists($i."jate/coreEngine.php")) { |
|
11 | 11 | array_push($GLOBALS["JATEPath"], $i); |
12 | 12 | require_once($i."jate/coreEngine.php"); |
13 | 13 | break; |
@@ -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 | } |
@@ -4,15 +4,15 @@ |
||
4 | 4 | |
5 | 5 | //JATE SUFF |
6 | 6 | require_once (end($GLOBALS["JATEPath"])."jate/functions/requirer.php"); |
7 | - requireComponent ("functions/folder.php"); |
|
8 | - requireComponent ("modules/JConfig/JConfig.php"); |
|
9 | - requireComponent ("modules/Module/Module.php"); |
|
10 | - requireComponents ("functions"); |
|
11 | - requireModules ("modules"); |
|
7 | + requireComponent("functions/folder.php"); |
|
8 | + requireComponent("modules/JConfig/JConfig.php"); |
|
9 | + requireComponent("modules/Module/Module.php"); |
|
10 | + requireComponents("functions"); |
|
11 | + requireModules("modules"); |
|
12 | 12 | |
13 | 13 | //USER STUFF |
14 | - requireComponent ("config.php",false); |
|
15 | - requireModules ("modules",false); |
|
16 | - requireComponents ("bundles/models",false); |
|
17 | - requireComponents ("bundles/controllers",false); |
|
14 | + requireComponent("config.php", false); |
|
15 | + requireModules("modules", false); |
|
16 | + requireComponents("bundles/models", false); |
|
17 | + requireComponents("bundles/controllers", false); |
|
18 | 18 | ?> |
@@ -18,8 +18,9 @@ discard block |
||
18 | 18 | if(is_array($_page)) { |
19 | 19 | $path = $_page[0]; |
20 | 20 | $class = $_page[1]; |
21 | - if(isset($_page[2])) |
|
22 | - $param = $_page[2]; |
|
21 | + if(isset($_page[2])) { |
|
22 | + $param = $_page[2]; |
|
23 | + } |
|
23 | 24 | } else { |
24 | 25 | $path = $_page; |
25 | 26 | $class = $_page; |
@@ -27,8 +28,9 @@ discard block |
||
27 | 28 | $this->pages[$path] = [$class,$param]; |
28 | 29 | } |
29 | 30 | public function addPages( $_pages ) { |
30 | - foreach ($_pages as $i) |
|
31 | - $this->addPage($i); |
|
31 | + foreach ($_pages as $i) { |
|
32 | + $this->addPage($i); |
|
33 | + } |
|
32 | 34 | } |
33 | 35 | public function fetchPage( $_stack ) { |
34 | 36 | $parameters = []; |
@@ -42,10 +44,11 @@ discard block |
||
42 | 44 | break; |
43 | 45 | } |
44 | 46 | } |
45 | - if( isset($temp[1]) && is_array($temp[1]) ) |
|
46 | - $temp[1] = array_merge($temp[1], $parameters); |
|
47 | - else |
|
48 | - $temp[1] = $parameters; |
|
47 | + if( isset($temp[1]) && is_array($temp[1]) ) { |
|
48 | + $temp[1] = array_merge($temp[1], $parameters); |
|
49 | + } else { |
|
50 | + $temp[1] = $parameters; |
|
51 | + } |
|
49 | 52 | $this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]); |
50 | 53 | return $this->currentPage; |
51 | 54 | } |
@@ -65,15 +68,18 @@ discard block |
||
65 | 68 | $pathLength = count($_path); |
66 | 69 | if($urlLength == $pathLength) { |
67 | 70 | while($cont < $urlLength) { |
68 | - if( $_path[$cont] == $_url[$cont] ) |
|
69 | - $cont++; |
|
70 | - else if( strpos($_path[$cont], "\$") !== false ) { |
|
71 | + if( $_path[$cont] == $_url[$cont] ) { |
|
72 | + $cont++; |
|
73 | + } else if( strpos($_path[$cont], "\$") !== false ) { |
|
71 | 74 | $variables[str_replace('$', "", $_path[$cont])] = $_url[$cont]; |
72 | 75 | $cont++; |
73 | - } else break; |
|
76 | + } else { |
|
77 | + break; |
|
78 | + } |
|
79 | + } |
|
80 | + if($cont == $urlLength) { |
|
81 | + return $variables; |
|
74 | 82 | } |
75 | - if($cont == $urlLength) |
|
76 | - return $variables; |
|
77 | 83 | } |
78 | 84 | return null; |
79 | 85 | } |
@@ -7,48 +7,48 @@ discard block |
||
7 | 7 | public function __construct() { |
8 | 8 | parent::__construct(); |
9 | 9 | $this->pages = []; |
10 | - $this->defaultPage = ["Page404",[]]; |
|
10 | + $this->defaultPage = ["Page404", []]; |
|
11 | 11 | $this->currentPage = null; |
12 | - $this->jConfig = null; |
|
12 | + $this->jConfig = null; |
|
13 | 13 | } |
14 | - public function addPage( $_page ) { |
|
14 | + public function addPage($_page) { |
|
15 | 15 | $param = []; |
16 | 16 | $path = $_page; |
17 | 17 | $class = $_page; |
18 | - if(is_array($_page)) { |
|
18 | + if (is_array($_page)) { |
|
19 | 19 | $path = $_page[0]; |
20 | 20 | $class = $_page[1]; |
21 | - if(isset($_page[2])) |
|
21 | + if (isset($_page[2])) |
|
22 | 22 | $param = $_page[2]; |
23 | 23 | } |
24 | 24 | $this->pages[$path] = [$class, $param]; |
25 | 25 | } |
26 | - public function addPages( $_pages ) { |
|
26 | + public function addPages($_pages) { |
|
27 | 27 | foreach ($_pages as $i) |
28 | 28 | $this->addPage($i); |
29 | 29 | } |
30 | 30 | public function fetchPage( ) { |
31 | 31 | $router = new Router(); |
32 | - $router->parameters = [ "app" => &$this->jConfig, "page" => null]; |
|
32 | + $router->parameters = ["app" => &$this->jConfig, "page" => null]; |
|
33 | 33 | $stack = $router->getPage(); |
34 | 34 | $parameters = []; |
35 | - $temp = $this->defaultPage; |
|
35 | + $temp = $this->defaultPage; |
|
36 | 36 | foreach ($this->pages as $key => $value) { |
37 | 37 | $variables = $this->pathSeeker(explode("/", $key), $stack); |
38 | - if(is_array($variables)) { |
|
38 | + if (is_array($variables)) { |
|
39 | 39 | $temp = $value; |
40 | 40 | $parameters = $variables; |
41 | 41 | break; |
42 | 42 | } |
43 | 43 | } |
44 | - if( isset($temp[1]) && is_array($temp[1]) ) |
|
44 | + if (isset($temp[1]) && is_array($temp[1])) |
|
45 | 45 | $temp[1] = array_merge($temp[1], $parameters); |
46 | 46 | else |
47 | 47 | $temp[1] = $parameters; |
48 | 48 | $this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]); |
49 | 49 | return $this->currentPage; |
50 | 50 | } |
51 | - public function setDefaultPage( $_page ) { |
|
51 | + public function setDefaultPage($_page) { |
|
52 | 52 | $this->defaultPage = $_page; |
53 | 53 | } |
54 | 54 | public function draw() { |
@@ -57,28 +57,28 @@ discard block |
||
57 | 57 | $gui->init($this->currentPage); |
58 | 58 | $gui->draw($this->currentPage->data["template"]); |
59 | 59 | } |
60 | - public function pathSeeker( $_path, $_url ) { |
|
60 | + public function pathSeeker($_path, $_url) { |
|
61 | 61 | $urlLength = count($_url); |
62 | 62 | $cont = 0; |
63 | 63 | $variables = []; |
64 | 64 | $pathLength = count($_path); |
65 | - if($urlLength == $pathLength) { |
|
66 | - while($cont < $urlLength) { |
|
67 | - if( $_path[$cont] == $_url[$cont] ) |
|
65 | + if ($urlLength == $pathLength) { |
|
66 | + while ($cont < $urlLength) { |
|
67 | + if ($_path[$cont] == $_url[$cont]) |
|
68 | 68 | $cont++; |
69 | - else if( strpos($_path[$cont], "\$") !== false ) { |
|
69 | + else if (strpos($_path[$cont], "\$") !== false) { |
|
70 | 70 | $variables[str_replace('$', "", $_path[$cont])] = $_url[$cont]; |
71 | 71 | $cont++; |
72 | 72 | } else break; |
73 | 73 | } |
74 | - if($cont == $urlLength) |
|
74 | + if ($cont == $urlLength) |
|
75 | 75 | return $variables; |
76 | 76 | } |
77 | 77 | return null; |
78 | 78 | } |
79 | - public function newConfig( $_path = "config/") { |
|
79 | + public function newConfig($_path = "config/") { |
|
80 | 80 | $this->jConfig = new JConfig(); |
81 | - $this->jConfig->import("${_path}connection.json","connection"); |
|
81 | + $this->jConfig->import("${_path}connection.json", "connection"); |
|
82 | 82 | $this->jConfig->import("${_path}misc.json"); |
83 | 83 | $this->jConfig->import("${_path}router.json"); |
84 | 84 | } |