Completed
Push — master ( 5bc057...206923 )
by Federico
03:27
created
dist/jate/modules/JConfig/JConfig.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,45 +6,45 @@
 block discarded – undo
6 6
 		public $pages;
7 7
 		public $server;
8 8
 		public function __construct() {
9
-			$this->connection["enable"]		= false;
10
-			$this->connection["user"]			= "";
9
+			$this->connection["enable"] = false;
10
+			$this->connection["user"] = "";
11 11
 			$this->connection["password"] = "";
12 12
 			$this->connection["database"] = "";
13
-			$this->connection["server"]		= "";
14
-			$this->all		= "";
13
+			$this->connection["server"] = "";
14
+			$this->all = "";
15 15
 			$this->DEBUG	= 0;
16 16
 			$this->pages	= [];
17
-			$this->server	= [];
17
+			$this->server = [];
18 18
 			$this->server["HTTP_HOST"]		= $_SERVER["HTTP_HOST"];
19
-			$this->server["REQUEST_URI"]	= $_SERVER["REQUEST_URI"];
19
+			$this->server["REQUEST_URI"] = $_SERVER["REQUEST_URI"];
20 20
 			$this->server["PHP_SELF"]			= $_SERVER["PHP_SELF"];
21 21
 		}
22
-		public function import( $_path, $_type = "misc" ) {
22
+		public function import($_path, $_type = "misc") {
23 23
 			$data = file_get_contents($_path);
24 24
 			$data = json_decode($data);
25
-			if( $_type == "connection" )
25
+			if ($_type == "connection")
26 26
 				$this->overlayConnection($data);
27 27
 			else
28 28
 				$this->overlayMisc($data);
29 29
 		}
30
-		protected function overlayConnection( $_data ) {
30
+		protected function overlayConnection($_data) {
31 31
 			$this->connection = $this->obj2array($_data);
32 32
 		}
33
-		protected function overlayMisc( $_data ) {
33
+		protected function overlayMisc($_data) {
34 34
 			$this->importObject($_data);
35 35
 		}
36
-		protected function obj2array ( &$_instance ) {
37
-			$clone	= (array) $_instance;
36
+		protected function obj2array(&$_instance) {
37
+			$clone = (array) $_instance;
38 38
 			$return	= [];
39 39
 			$return['___SOURCE_KEYS_'] = $clone;
40
-			while ( list ($key, $value) = each ($clone) ) {
41
-				$temp		= explode ("\0", $key);
42
-				$newkey	= $temp[count($temp)-1];
40
+			while (list ($key, $value) = each($clone)) {
41
+				$temp		= explode("\0", $key);
42
+				$newkey = $temp[count($temp) - 1];
43 43
 				$return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
44 44
 			}
45 45
 			return $return;
46 46
 		}
47
-		protected function importObject( $_object ) {
47
+		protected function importObject($_object) {
48 48
 			foreach (get_object_vars($_object) as $key => $value)
49 49
 				$this->$key = $value;
50 50
 		}
Please login to merge, or discard this patch.
dist/jate/modules/Router/Router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 			parent::__construct();
5 5
 		}
6 6
 		public function getPage() {
7
-			$request	= $this->parameters["app"]->server["REQUEST_URI"];
8
-			$base			= $this->parameters["app"]->server["RELATIVE"];
7
+			$request = $this->parameters["app"]->server["REQUEST_URI"];
8
+			$base = $this->parameters["app"]->server["RELATIVE"];
9 9
 			$url			= str_replace($base, "", $request);
10 10
 			$url			= explode("/", $url);
11 11
 			return $url;
Please login to merge, or discard this patch.
dist/jate/modules/Module/Module.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 		public $parameters;
11 11
 		public function __construct() {
12 12
 			$this->name				= get_class($this);
13
-			$this->modules		= [];
13
+			$this->modules = [];
14 14
 			$this->files			= [];
15
-			$this->required		= [];
15
+			$this->required = [];
16 16
 			$this->data				= [];
17 17
 			$this->tags				= [];
18 18
 			$this->connection	= null;
@@ -22,43 +22,43 @@  discard block
 block discarded – undo
22 22
 		// abstract public function init();
23 23
 		// abstract public function draw();
24 24
 		public function getCss() {
25
-			return $this->getRequire("getCss",".css");
25
+			return $this->getRequire("getCss", ".css");
26 26
 		}
27 27
 		public function getJs() {
28
-			return $this->getRequire("getJs",".js");
28
+			return $this->getRequire("getJs", ".js");
29 29
 		}
30 30
 		public function getJsVariables() {
31 31
 			$temp = [];
32 32
 			foreach ($this->required as $i)
33 33
 				if (is_array($i))
34
-					array_push($temp,$i);
34
+					array_push($temp, $i);
35 35
 			foreach ($this->modules as $i)
36
-				$temp = array_merge( $temp, $i->getJsVariables() );
36
+				$temp = array_merge($temp, $i->getJsVariables());
37 37
 			foreach ($this->files as $i)
38 38
 				if (is_array($i))
39
-					array_push($temp,$i);
39
+					array_push($temp, $i);
40 40
 			return $temp;
41 41
 		}
42
-		public function addModules( $_mods ) {
42
+		public function addModules($_mods) {
43 43
 			foreach ($_mods as $value)
44 44
 				$this->addModule($value);
45 45
 		}
46
-		public function addModule( $_mod ) {
46
+		public function addModule($_mod) {
47 47
 			$this->modules[$_mod->name] = $_mod;
48 48
 			$this->modules[$_mod->name]->parameters = &$this->parameters;
49 49
 		}
50
-		public function addFiles( $_files ) {
50
+		public function addFiles($_files) {
51 51
 			foreach ($_files as $value)
52 52
 				$this->addFile($value);
53 53
 		}
54
-		public function addFile( $_file ) {
54
+		public function addFile($_file) {
55 55
 			array_push($this->files, $_file);
56 56
 		}
57
-		public function addFilesRequired( $_files ) {
57
+		public function addFilesRequired($_files) {
58 58
 			foreach ($_files as $value)
59 59
 				$this->addFileRequired($value);
60 60
 		}
61
-		public function addFileRequired( $_file ) {
61
+		public function addFileRequired($_file) {
62 62
 			array_push($this->required, $_file);
63 63
 		}
64 64
 		protected function addDipendences() {
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 			$this->tags["js"] = $this->getJs();
67 67
 			$this->tags["jsVariables"] = $this->getJsVariables();
68 68
 		}
69
-		protected function getRequire( $_function, $_extenction) {
69
+		protected function getRequire($_function, $_extenction) {
70 70
 			$temp = [];
71 71
 			foreach ($this->required as $i)
72 72
 				if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
73
-					array_push($temp,$i);
73
+					array_push($temp, $i);
74 74
 			foreach ($this->modules as $i)
75
-				$temp = array_merge( $temp, $i->$_function() );
75
+				$temp = array_merge($temp, $i->$_function());
76 76
 			foreach ($this->files as $i)
77 77
 				if (!is_array($i) && strpos($i, $_extenction) !== FALSE)
78
-					array_push($temp,$i);
78
+					array_push($temp, $i);
79 79
 			return $temp;
80 80
 		}
81 81
 	}
Please login to merge, or discard this patch.
dist/jate/modules/WebApp/WebApp.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,48 +7,48 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
dist/jate/modules/Menu/Menu.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
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;
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
 		public function draw() {
24 24
 			$temp = "";
25 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"];
26
+			$uri = $this->parameters["app"]->server["REQUEST_URI"];
27
+			$actualLink = "http://$host$uri";
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
dist/jate/modules/Html/Html.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@
 block discarded – undo
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
 			foreach ($this->tags["css"] as $i)
32 32
 				$tempStr .= "<link rel='stylesheet' href='$i'>";
Please login to merge, or discard this patch.
dist/jate/coreEngine.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Parsedown/Parsedown.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 		public function __construct() {
7 7
 			parent::__construct();
8 8
 		}
9
-		public function drawFile( $_template ) {
9
+		public function drawFile($_template) {
10 10
 			return $this->draw($_template);
11 11
 		}
12
-		public function drawText( $_template ) {
12
+		public function drawText($_template) {
13 13
 			return $this->draw(trim($_template));
14 14
 		}
15
-		public function draw( $_template ) {
15
+		public function draw($_template) {
16 16
 			$Parsedown = new Parsedown\Parsedown();
17 17
 			$page = $Parsedown->text($_template);
18 18
 			return $page;
Please login to merge, or discard this patch.
dist/jate/modules/GUI/GUI.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
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':
Please login to merge, or discard this patch.