@@ -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) { |
@@ -36,10 +36,12 @@ |
||
| 36 | 36 | function arrayDump( $_array, $_name = "Array", $_tab = " " ) { |
| 37 | 37 | $position = preg_replace('/ /', '', $_tab, 1); |
| 38 | 38 | echo "$position<span style=\"color:rgb(230,0,0)\">$_name:</span><br>"; |
| 39 | - foreach ($_array as $k => $i) |
|
| 40 | - if(is_array($i)) |
|
| 39 | + foreach ($_array as $k => $i) { |
|
| 40 | + if(is_array($i)) |
|
| 41 | 41 | arrayDump( $i, $k, " $_tab" ); |
| 42 | - else |
|
| 43 | - echo "$_tab<b>$k:</b> $i<br>"; |
|
| 42 | + } |
|
| 43 | + else { |
|
| 44 | + echo "$_tab<b>$k:</b> $i<br>"; |
|
| 45 | + } |
|
| 44 | 46 | } |
| 45 | 47 | ?> |
@@ -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)) { |
@@ -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 | ?> |
@@ -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); |
@@ -12,9 +12,10 @@ |
||
| 12 | 12 | echo minifyOutput($render); |
| 13 | 13 | } |
| 14 | 14 | protected function overlayTag( $_page ) { |
| 15 | - foreach($this->tags as $key => $value) |
|
| 16 | - if(!is_array($value)) |
|
| 15 | + foreach($this->tags as $key => $value) { |
|
| 16 | + if(!is_array($value)) |
|
| 17 | 17 | $_page = str_replace("<_${key}_>", "$value", $_page); |
| 18 | + } |
|
| 18 | 19 | return $_page; |
| 19 | 20 | } |
| 20 | 21 | } |
@@ -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) |
@@ -23,33 +23,39 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | public function getJsVariables() { |
| 25 | 25 | $temp = []; |
| 26 | - foreach ($this->required as $i) |
|
| 27 | - if (is_array($i)) |
|
| 26 | + foreach ($this->required as $i) { |
|
| 27 | + if (is_array($i)) |
|
| 28 | 28 | array_push($temp,$i); |
| 29 | - foreach ($this->modules as $i) |
|
| 30 | - $temp = array_merge( $temp, $i->getJsVariables() ); |
|
| 31 | - foreach ($this->files as $i) |
|
| 32 | - if (is_array($i)) |
|
| 29 | + } |
|
| 30 | + foreach ($this->modules as $i) { |
|
| 31 | + $temp = array_merge( $temp, $i->getJsVariables() ); |
|
| 32 | + } |
|
| 33 | + foreach ($this->files as $i) { |
|
| 34 | + if (is_array($i)) |
|
| 33 | 35 | array_push($temp,$i); |
| 36 | + } |
|
| 34 | 37 | return $temp; |
| 35 | 38 | } |
| 36 | 39 | public function addModules( $_mods ) { |
| 37 | - foreach ($_mods as $value) |
|
| 38 | - $this->addModule($value); |
|
| 40 | + foreach ($_mods as $value) { |
|
| 41 | + $this->addModule($value); |
|
| 42 | + } |
|
| 39 | 43 | } |
| 40 | 44 | public function addModule( $_mod ) { |
| 41 | 45 | $this->modules[$_mod->name] = $_mod; |
| 42 | 46 | } |
| 43 | 47 | public function addFiles( $_files ) { |
| 44 | - foreach ($_files as $value) |
|
| 45 | - $this->addFile($value); |
|
| 48 | + foreach ($_files as $value) { |
|
| 49 | + $this->addFile($value); |
|
| 50 | + } |
|
| 46 | 51 | } |
| 47 | 52 | public function addFile( $_file ) { |
| 48 | 53 | array_push($this->files, $_file); |
| 49 | 54 | } |
| 50 | 55 | public function addFilesRequired( $_files ) { |
| 51 | - foreach ($_files as $value) |
|
| 52 | - $this->addFileRequired($value); |
|
| 56 | + foreach ($_files as $value) { |
|
| 57 | + $this->addFileRequired($value); |
|
| 58 | + } |
|
| 53 | 59 | } |
| 54 | 60 | public function addFileRequired( $_file ) { |
| 55 | 61 | array_push($this->required, $_file); |
@@ -61,14 +67,17 @@ discard block |
||
| 61 | 67 | } |
| 62 | 68 | protected function getRequire( $_function, $_extenction) { |
| 63 | 69 | $temp = []; |
| 64 | - foreach ($this->required as $i) |
|
| 65 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
| 70 | + foreach ($this->required as $i) { |
|
| 71 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
| 66 | 72 | array_push($temp,$i); |
| 67 | - foreach ($this->modules as $i) |
|
| 68 | - $temp = array_merge( $temp, $i->$_function() ); |
|
| 69 | - foreach ($this->files as $i) |
|
| 70 | - if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
| 73 | + } |
|
| 74 | + foreach ($this->modules as $i) { |
|
| 75 | + $temp = array_merge( $temp, $i->$_function() ); |
|
| 76 | + } |
|
| 77 | + foreach ($this->files as $i) { |
|
| 78 | + if (!is_array($i) && strpos($i, $_extenction) !== FALSE) |
|
| 71 | 79 | array_push($temp,$i); |
| 80 | + } |
|
| 72 | 81 | return $temp; |
| 73 | 82 | } |
| 74 | 83 | } |
@@ -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 | } |
@@ -15,8 +15,9 @@ |
||
| 15 | 15 | function minify_output($_buffer) { |
| 16 | 16 | $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
| 17 | 17 | $replace = array ( '>', '<', '\\1' ); |
| 18 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
| 19 | - $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
| 18 | + if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) { |
|
| 19 | + $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
| 20 | + } |
|
| 20 | 21 | return utf8_encode($_buffer); |
| 21 | 22 | } |
| 22 | 23 | ?> |
@@ -7,8 +7,9 @@ |
||
| 7 | 7 | parent::__construct(); |
| 8 | 8 | $args = func_get_args(); |
| 9 | 9 | $count = func_num_args(); |
| 10 | - if (method_exists($this,$func='__construct'.$count)) |
|
| 11 | - call_user_func_array(array($this,$func),$args); |
|
| 10 | + if (method_exists($this,$func='__construct'.$count)) { |
|
| 11 | + call_user_func_array(array($this,$func),$args); |
|
| 12 | + } |
|
| 12 | 13 | } |
| 13 | 14 | public function __construct0() { |
| 14 | 15 | $this->connection = null; |
@@ -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,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 | } |