Code Duplication    Length = 45-45 lines in 2 locations

examples/01essential/pages/Template.php 1 location

@@ 2-46 (lines=45) @@
1
<?php
2
	class Template extends Html {
3
		public function __construct() {
4
			parent::__construct();
5
			$this->tags["brand"]		= "JATE";
6
			$this->tags["brandImg"] = "";
7
			$this->tags["title"]		= "JATE - 01essential";
8
			$this->data["template"] = "guis/tradictional.html";
9
			$this->addFilesRequired([
10
					"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
11
				, "https://code.jquery.com/jquery-1.11.3.min.js"
12
				, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
13
			]);
14
			$this->tags["metaDescription"] = "Beautiful description .";
15
			$this->tags["metaKeywords"] = "JATE,PHP,JS,CSS";
16
			$this->tags["metaAuthor"] = "XaBerr";
17
			$this->makeConnection();
18
			$this->tags["menu"] = $this->makeMenu();
19
		}
20
		public function makeConnection() {
21
			global $jConfig;
22
			$connection = null;
23
			if($jConfig->connection["enable"])
24
				$connection = new Connection(
25
						$jConfig->connection["server"]
26
					, $jConfig->connection["database"]
27
					, $jConfig->connection["user"]
28
					, $jConfig->connection["password"]
29
				);
30
			$this->addConnection("base",$connection);
31
		}
32
		public function makeMenu() {
33
			$temp = "";
34
			jBlock();
35
			?>
36
				<li>
37
					<a href="Home">Home</a>
38
				</li>
39
				<li>
40
					<a href="Page1">Page 1</a>
41
				</li>
42
			<?php
43
			$temp = jBlockEnd();
44
			return $temp;
45
		}
46
	}
47
?>
48

examples/05database/pages/Template.php 1 location

@@ 2-46 (lines=45) @@
1
<?php
2
	class Template extends Html {
3
		public function __construct() {
4
			parent::__construct();
5
			$this->tags["brand"]		= "JATE";
6
			$this->tags["brandImg"] = "";
7
			$this->tags["title"]		= "JATE - 05database";
8
			$this->data["template"] = "guis/tradictional.html";
9
			$this->addFilesRequired([
10
					"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
11
				, "https://code.jquery.com/jquery-1.11.3.min.js"
12
				, "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
13
			]);
14
			$this->tags["metaDescription"] = "Beautiful description .";
15
			$this->tags["metaKeywords"] = "JATE,PHP,JS,CSS";
16
			$this->tags["metaAuthor"] = "XaBerr";
17
			$this->makeConnection();
18
			$this->tags["menu"] = $this->makeMenu();
19
		}
20
		public function makeConnection() {
21
			global $jConfig;
22
			$connection = null;
23
			if($jConfig->connection["enable"])
24
				$connection = new Connection(
25
						$jConfig->connection["server"]
26
					, $jConfig->connection["database"]
27
					, $jConfig->connection["user"]
28
					, $jConfig->connection["password"]
29
				);
30
			$this->addConnection("base",$connection);
31
		}
32
		public function makeMenu() {
33
			$temp = "";
34
			jBlock();
35
			?>
36
				<li>
37
					<a href="Home">Home</a>
38
				</li>
39
				<li>
40
					<a href="Page1">Page 1</a>
41
				</li>
42
			<?php
43
			$temp = jBlockEnd();
44
			return $temp;
45
		}
46
	}
47
?>
48