@@ -1,32 +1,32 @@ |
||
| 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"] = ""; |
| 8 | 8 | $this->tags["brandImg"] = ""; |
| 9 | 9 | $this->tags["menu"] = ""; |
| 10 | 10 | $this->tags["title"] = ""; |
| 11 | - $this->tags["subtitle"] = ""; |
|
| 11 | + $this->tags["subtitle"] = ""; |
|
| 12 | 12 | $this->tags["content"] = ""; |
| 13 | - $this->tags["outContent"] = ""; |
|
| 13 | + $this->tags["outContent"] = ""; |
|
| 14 | 14 | $this->tags["footer"] = ""; |
| 15 | 15 | $this->tags["pagePath"] = []; |
| 16 | - $this->tags["css"] = []; |
|
| 17 | - $this->tags["js"] = []; |
|
| 16 | + $this->tags["css"] = []; |
|
| 17 | + $this->tags["js"] = []; |
|
| 18 | 18 | $this->tags["jsVariables"] = []; |
| 19 | - $this->tags["metaDescription"] = []; |
|
| 20 | - $this->tags["metaKeywords"] = []; |
|
| 19 | + $this->tags["metaDescription"] = []; |
|
| 20 | + $this->tags["metaKeywords"] = []; |
|
| 21 | 21 | $this->tags["metaAuthor"] = []; |
| 22 | - $this->parameters = $_parameters; |
|
| 23 | - $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
| 22 | + $this->parameters = $_parameters; |
|
| 23 | + $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
| 24 | 24 | } |
| 25 | 25 | public function uniforma() { |
| 26 | 26 | $this->addDipendences(); |
| 27 | 27 | $this->tags["css"] = array_unique($this->tags["css"]); |
| 28 | 28 | $this->tags["js"] = array_unique($this->tags["js"]); |
| 29 | - $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
| 29 | + $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
| 30 | 30 | $tempStr = ""; |
| 31 | 31 | $timeParameter = "?t=".time(); |
| 32 | 32 | $time = ($this->parameters["app"]->cache->css == true) ? "" : $timeParameter; |
@@ -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,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 | + ?> |
|
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | - declare( strict_types = 1 ); |
|
| 2 | + declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | use PHPUnit\Framework\TestCase; |
| 5 | 5 | |