@@ -4,14 +4,14 @@ |
||
| 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 | - requireComponents ("functions"); |
|
| 10 | - requireModules ("modules"); |
|
| 7 | + requireComponent("functions/folder.php"); |
|
| 8 | + requireComponent("modules/JConfig/JConfig.php"); |
|
| 9 | + requireComponents("functions"); |
|
| 10 | + requireModules("modules"); |
|
| 11 | 11 | |
| 12 | 12 | //USER STUFF |
| 13 | - requireComponent ("config.php",false); |
|
| 14 | - requireModules ("modules",false); |
|
| 15 | - requireComponents ("bundles/models",false); |
|
| 16 | - requireComponents ("bundles/controllers",false); |
|
| 13 | + requireComponent("config.php", false); |
|
| 14 | + requireModules("modules", false); |
|
| 15 | + requireComponents("bundles/models", false); |
|
| 16 | + requireComponents("bundles/controllers", false); |
|
| 17 | 17 | ?> |
@@ -16,6 +16,9 @@ |
||
| 16 | 16 | return jBlockFileMan($_path, $extension, $_parameters); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string $_type |
|
| 21 | + */ |
|
| 19 | 22 | function jBlockFileMan( $_path, $_type, $_parameters = [] ) { |
| 20 | 23 | $temp = file_get_contents($_path); |
| 21 | 24 | return jBlockParsing($_type, $temp, $_parameters); |
@@ -5,28 +5,28 @@ discard block |
||
| 5 | 5 | return ob_start(); |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - function jBlockClose( $_type = "html", $_parameters = [] ) { |
|
| 8 | + function jBlockClose($_type = "html", $_parameters = []) { |
|
| 9 | 9 | return jBlockEnd($_type, $_parameters); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | - function jBlockFile( $_path, $_parameters = [] ) { |
|
| 12 | + function jBlockFile($_path, $_parameters = []) { |
|
| 13 | 13 | $extension = explode(".", $_path); |
| 14 | - $extension = $extension[count($extension)-1]; |
|
| 14 | + $extension = $extension[count($extension) - 1]; |
|
| 15 | 15 | $extension = strtolower($extension); |
| 16 | 16 | return jBlockFileMan($_path, $extension, $_parameters); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - function jBlockFileMan( $_path, $_type, $_parameters = [] ) { |
|
| 19 | + function jBlockFileMan($_path, $_type, $_parameters = []) { |
|
| 20 | 20 | $temp = file_get_contents($_path); |
| 21 | 21 | return jBlockParsing($_type, $temp, $_parameters); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - function jBlockEnd( $_type = "html", $_parameters = [] ) { |
|
| 24 | + function jBlockEnd($_type = "html", $_parameters = []) { |
|
| 25 | 25 | $text = ob_get_clean(); |
| 26 | 26 | return jBlockParsing($_type, $text, $_parameters); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) { |
|
| 29 | + function jBlockParsing($_type = "html", $_string = "", $_parameters = []) { |
|
| 30 | 30 | switch ($_type) { |
| 31 | 31 | case "pug": |
| 32 | 32 | case "jade": |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | function minifyOutput($_buffer) { |
| 52 | - $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
|
| 53 | - $replace = array ( '>', '<', '\\1' ); |
|
| 54 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
| 52 | + $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'); |
|
| 53 | + $replace = array('>', '<', '\\1'); |
|
| 54 | + if (preg_match("/\<html/i", $_buffer) == 1 && preg_match("/\<\/html\>/i", $_buffer) == 1) |
|
| 55 | 55 | $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
| 56 | 56 | return utf8_encode($_buffer); |
| 57 | 57 | } |
@@ -51,8 +51,9 @@ |
||
| 51 | 51 | function minifyOutput($_buffer) { |
| 52 | 52 | $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
| 53 | 53 | $replace = array ( '>', '<', '\\1' ); |
| 54 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
| 55 | - $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
| 54 | + if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) { |
|
| 55 | + $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
| 56 | + } |
|
| 56 | 57 | return utf8_encode($_buffer); |
| 57 | 58 | } |
| 58 | 59 | ?> |
@@ -8,6 +8,10 @@ |
||
| 8 | 8 | public function drawFile( $_file, $_parameters = [] ) { |
| 9 | 9 | return $this->draw($_file, $_parameters); |
| 10 | 10 | } |
| 11 | + |
|
| 12 | + /** |
|
| 13 | + * @param string $_text |
|
| 14 | + */ |
|
| 11 | 15 | public function drawText( $_text, $_parameters = [] ) { |
| 12 | 16 | return $this->draw(trim($_text), $_parameters); |
| 13 | 17 | } |
@@ -5,13 +5,13 @@ |
||
| 5 | 5 | public function __construct() { |
| 6 | 6 | parent::__construct(); |
| 7 | 7 | } |
| 8 | - public function drawFile( $_file, $_parameters = [] ) { |
|
| 8 | + public function drawFile($_file, $_parameters = []) { |
|
| 9 | 9 | return $this->draw($_file, $_parameters); |
| 10 | 10 | } |
| 11 | - public function drawText( $_text, $_parameters = [] ) { |
|
| 11 | + public function drawText($_text, $_parameters = []) { |
|
| 12 | 12 | return $this->draw(trim($_text), $_parameters); |
| 13 | 13 | } |
| 14 | - public function draw( $_text, $_parameters = [] ) { |
|
| 14 | + public function draw($_text, $_parameters = []) { |
|
| 15 | 15 | $pug = new Pug\Pug(); |
| 16 | 16 | $page = $pug->render($_text, $_parameters); |
| 17 | 17 | return $page; |
@@ -14,6 +14,10 @@ |
||
| 14 | 14 | $page = $template->render($_parameters); |
| 15 | 15 | return $page; |
| 16 | 16 | } |
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * @param string $_text |
|
| 20 | + */ |
|
| 17 | 21 | public function drawText( $_text, $_parameters = [] ) { |
| 18 | 22 | $loader = new Twig_Loader_Array([ |
| 19 | 23 | 'index' => $_text |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | public function __construct() { |
| 6 | 6 | parent::__construct(); |
| 7 | 7 | } |
| 8 | - public function drawFile( $_file, $_parameters = [] ) { |
|
| 9 | - $loader = new Twig_Loader_Filesystem('bundles/views'); |
|
| 10 | - $twig = new Twig_Environment( $loader, [ |
|
| 8 | + public function drawFile($_file, $_parameters = []) { |
|
| 9 | + $loader = new Twig_Loader_Filesystem('bundles/views'); |
|
| 10 | + $twig = new Twig_Environment($loader, [ |
|
| 11 | 11 | 'cache' => 'bundles/views', |
| 12 | 12 | ]); |
| 13 | 13 | $template = $twig->loadTemplate($_text); |
| 14 | 14 | $page = $template->render($_parameters); |
| 15 | 15 | return $page; |
| 16 | 16 | } |
| 17 | - public function drawText( $_text, $_parameters = [] ) { |
|
| 17 | + public function drawText($_text, $_parameters = []) { |
|
| 18 | 18 | $loader = new Twig_Loader_Array([ |
| 19 | 19 | 'index' => $_text |
| 20 | 20 | ]); |
@@ -6,24 +6,24 @@ |
||
| 6 | 6 | public function __construct() { |
| 7 | 7 | parent::__construct(); |
| 8 | 8 | } |
| 9 | - public function init( $_page ) { |
|
| 9 | + public function init($_page) { |
|
| 10 | 10 | $this->tags = $_page->tags; |
| 11 | 11 | } |
| 12 | - public function draw( $_template ) { |
|
| 12 | + public function draw($_template) { |
|
| 13 | 13 | $page = ""; |
| 14 | - $extension = explode(".",$_template); |
|
| 15 | - $extension = $extension[count($extension)-1]; |
|
| 14 | + $extension = explode(".", $_template); |
|
| 15 | + $extension = $extension[count($extension) - 1]; |
|
| 16 | 16 | $page = $this->parsingFile($_template, $extension); |
| 17 | 17 | $render = $this->overlayTag($page); |
| 18 | 18 | echo minifyOutput($render); |
| 19 | 19 | } |
| 20 | - protected function overlayTag( $_page ) { |
|
| 21 | - foreach($this->tags as $key => $value) |
|
| 22 | - if(!is_array($value)) |
|
| 20 | + protected function overlayTag($_page) { |
|
| 21 | + foreach ($this->tags as $key => $value) |
|
| 22 | + if (!is_array($value)) |
|
| 23 | 23 | $_page = str_replace("<_${key}_>", "$value", $_page); |
| 24 | 24 | return $_page; |
| 25 | 25 | } |
| 26 | - protected function parsingFile( $_file, $_type = "html" ) { |
|
| 26 | + protected function parsingFile($_file, $_type = "html") { |
|
| 27 | 27 | switch ($_type) { |
| 28 | 28 | case 'pug': |
| 29 | 29 | case 'jade': |
@@ -18,9 +18,10 @@ |
||
| 18 | 18 | echo minifyOutput($render); |
| 19 | 19 | } |
| 20 | 20 | protected function overlayTag( $_page ) { |
| 21 | - foreach($this->tags as $key => $value) |
|
| 22 | - if(!is_array($value)) |
|
| 21 | + foreach($this->tags as $key => $value) { |
|
| 22 | + if(!is_array($value)) |
|
| 23 | 23 | $_page = str_replace("<_${key}_>", "$value", $_page); |
| 24 | + } |
|
| 24 | 25 | return $_page; |
| 25 | 26 | } |
| 26 | 27 | protected function parsingFile( $_file, $_type = "html" ) { |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | jRequire("../Module/Module.php"); |
| 3 | 3 | class Statistic extends Module { |
| 4 | - public function __construct( $_webApp ) { |
|
| 4 | + public function __construct($_webApp) { |
|
| 5 | 5 | parent::__construct(); |
| 6 | 6 | $pages = []; |
| 7 | 7 | $stats = []; |
| 8 | 8 | $pages = $_webApp->pages; |
| 9 | - foreach ( $pages as $k => $v ) { |
|
| 9 | + foreach ($pages as $k => $v) { |
|
| 10 | 10 | $temp = new $v[0]($v[1]); |
| 11 | 11 | $temp->addDipendences(); |
| 12 | 12 | $stats[$k] = []; |
| 13 | 13 | $stats[$k]["page"] = $v[0]; |
| 14 | 14 | $stats[$k]["css"] = $temp->data["css"]; |
| 15 | - $stats[$k]["js"] = $temp->data["js"]; |
|
| 15 | + $stats[$k]["js"] = $temp->data["js"]; |
|
| 16 | 16 | } |
| 17 | 17 | $this->data = $stats; |
| 18 | 18 | } |
@@ -8,49 +8,49 @@ discard block |
||
| 8 | 8 | public function __construct() { |
| 9 | 9 | parent::__construct(); |
| 10 | 10 | $this->pages = []; |
| 11 | - $this->defaultPage = ["Page404",[]]; |
|
| 11 | + $this->defaultPage = ["Page404", []]; |
|
| 12 | 12 | $this->currentPage = null; |
| 13 | - $this->jConfig = null; |
|
| 13 | + $this->jConfig = null; |
|
| 14 | 14 | } |
| 15 | - public function addPage( $_page ) { |
|
| 15 | + public function addPage($_page) { |
|
| 16 | 16 | $param = []; |
| 17 | 17 | $path = $_page; |
| 18 | 18 | $class = $_page; |
| 19 | - if(is_array($_page)) { |
|
| 19 | + if (is_array($_page)) { |
|
| 20 | 20 | $path = $_page[0]; |
| 21 | 21 | $class = $_page[1]; |
| 22 | - if(isset($_page[2])) |
|
| 22 | + if (isset($_page[2])) |
|
| 23 | 23 | $param = $_page[2]; |
| 24 | 24 | } |
| 25 | 25 | $this->pages[$path] = [$class, $param]; |
| 26 | 26 | return $this->pages[$path]; |
| 27 | 27 | } |
| 28 | - public function addPages( $_pages ) { |
|
| 28 | + public function addPages($_pages) { |
|
| 29 | 29 | foreach ($_pages as $i) |
| 30 | 30 | $this->addPage($i); |
| 31 | 31 | } |
| 32 | 32 | public function fetchPage( ) { |
| 33 | 33 | $router = new Router(); |
| 34 | - $router->parameters = [ "app" => &$this->jConfig, "page" => null]; |
|
| 34 | + $router->parameters = ["app" => &$this->jConfig, "page" => null]; |
|
| 35 | 35 | $stack = $router->getPage(); |
| 36 | 36 | $parameters = []; |
| 37 | - $temp = $this->defaultPage; |
|
| 37 | + $temp = $this->defaultPage; |
|
| 38 | 38 | foreach ($this->pages as $key => $value) { |
| 39 | 39 | $variables = $this->pathSeeker(explode("/", $key), $stack); |
| 40 | - if(is_array($variables)) { |
|
| 40 | + if (is_array($variables)) { |
|
| 41 | 41 | $temp = $value; |
| 42 | 42 | $parameters = $variables; |
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - if( isset($temp[1]) && is_array($temp[1]) ) |
|
| 46 | + if (isset($temp[1]) && is_array($temp[1])) |
|
| 47 | 47 | $temp[1] = array_merge($temp[1], $parameters); |
| 48 | 48 | else |
| 49 | 49 | $temp[1] = $parameters; |
| 50 | 50 | $this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]); |
| 51 | 51 | return $this->currentPage; |
| 52 | 52 | } |
| 53 | - public function setDefaultPage( $_page ) { |
|
| 53 | + public function setDefaultPage($_page) { |
|
| 54 | 54 | $this->defaultPage = $this->addPage($_page); |
| 55 | 55 | } |
| 56 | 56 | public function draw() { |
@@ -59,28 +59,28 @@ discard block |
||
| 59 | 59 | $gui->init($this->currentPage); |
| 60 | 60 | $gui->draw($this->currentPage->data["template"]); |
| 61 | 61 | } |
| 62 | - public function pathSeeker( $_path, $_url ) { |
|
| 62 | + public function pathSeeker($_path, $_url) { |
|
| 63 | 63 | $urlLength = count($_url); |
| 64 | 64 | $cont = 0; |
| 65 | 65 | $variables = []; |
| 66 | 66 | $pathLength = count($_path); |
| 67 | - if($urlLength == $pathLength) { |
|
| 68 | - while($cont < $urlLength) { |
|
| 69 | - if( $_path[$cont] == $_url[$cont] ) |
|
| 67 | + if ($urlLength == $pathLength) { |
|
| 68 | + while ($cont < $urlLength) { |
|
| 69 | + if ($_path[$cont] == $_url[$cont]) |
|
| 70 | 70 | $cont++; |
| 71 | - else if( strpos($_path[$cont], "\$") !== false ) { |
|
| 71 | + else if (strpos($_path[$cont], "\$") !== false) { |
|
| 72 | 72 | $variables[str_replace('$', "", $_path[$cont])] = $_url[$cont]; |
| 73 | 73 | $cont++; |
| 74 | 74 | } else break; |
| 75 | 75 | } |
| 76 | - if($cont == $urlLength) |
|
| 76 | + if ($cont == $urlLength) |
|
| 77 | 77 | return $variables; |
| 78 | 78 | } |
| 79 | 79 | return null; |
| 80 | 80 | } |
| 81 | - public function newConfig( $_path = "config/") { |
|
| 81 | + public function newConfig($_path = "config/") { |
|
| 82 | 82 | $this->jConfig = new JConfig(); |
| 83 | - $this->jConfig->import("${_path}connection.json","connection"); |
|
| 83 | + $this->jConfig->import("${_path}connection.json", "connection"); |
|
| 84 | 84 | $this->jConfig->import("${_path}misc.json"); |
| 85 | 85 | $this->jConfig->import("${_path}router.json"); |
| 86 | 86 | } |
@@ -19,15 +19,17 @@ discard block |
||
| 19 | 19 | if(is_array($_page)) { |
| 20 | 20 | $path = $_page[0]; |
| 21 | 21 | $class = $_page[1]; |
| 22 | - if(isset($_page[2])) |
|
| 23 | - $param = $_page[2]; |
|
| 22 | + if(isset($_page[2])) { |
|
| 23 | + $param = $_page[2]; |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | $this->pages[$path] = [$class, $param]; |
| 26 | 27 | return $this->pages[$path]; |
| 27 | 28 | } |
| 28 | 29 | public function addPages( $_pages ) { |
| 29 | - foreach ($_pages as $i) |
|
| 30 | - $this->addPage($i); |
|
| 30 | + foreach ($_pages as $i) { |
|
| 31 | + $this->addPage($i); |
|
| 32 | + } |
|
| 31 | 33 | } |
| 32 | 34 | public function fetchPage( ) { |
| 33 | 35 | $router = new Router(); |
@@ -43,10 +45,11 @@ discard block |
||
| 43 | 45 | break; |
| 44 | 46 | } |
| 45 | 47 | } |
| 46 | - if( isset($temp[1]) && is_array($temp[1]) ) |
|
| 47 | - $temp[1] = array_merge($temp[1], $parameters); |
|
| 48 | - else |
|
| 49 | - $temp[1] = $parameters; |
|
| 48 | + if( isset($temp[1]) && is_array($temp[1]) ) { |
|
| 49 | + $temp[1] = array_merge($temp[1], $parameters); |
|
| 50 | + } else { |
|
| 51 | + $temp[1] = $parameters; |
|
| 52 | + } |
|
| 50 | 53 | $this->currentPage = new $temp[0](["app" => $this->jConfig, "page" => $temp[1]]); |
| 51 | 54 | return $this->currentPage; |
| 52 | 55 | } |
@@ -66,15 +69,18 @@ discard block |
||
| 66 | 69 | $pathLength = count($_path); |
| 67 | 70 | if($urlLength == $pathLength) { |
| 68 | 71 | while($cont < $urlLength) { |
| 69 | - if( $_path[$cont] == $_url[$cont] ) |
|
| 70 | - $cont++; |
|
| 71 | - else if( strpos($_path[$cont], "\$") !== false ) { |
|
| 72 | + if( $_path[$cont] == $_url[$cont] ) { |
|
| 73 | + $cont++; |
|
| 74 | + } else if( strpos($_path[$cont], "\$") !== false ) { |
|
| 72 | 75 | $variables[str_replace('$', "", $_path[$cont])] = $_url[$cont]; |
| 73 | 76 | $cont++; |
| 74 | - } else break; |
|
| 77 | + } else { |
|
| 78 | + break; |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + if($cont == $urlLength) { |
|
| 82 | + return $variables; |
|
| 75 | 83 | } |
| 76 | - if($cont == $urlLength) |
|
| 77 | - return $variables; |
|
| 78 | 84 | } |
| 79 | 85 | return null; |
| 80 | 86 | } |
@@ -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,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 | } |