Completed
Branch master (de1ee7)
by Jacob
05:01
created
controller/portfolio/DefaultPageController.class.inc.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,10 +39,11 @@  discard block
 block discarded – undo
39 39
 				'name' => 'Contact',
40 40
 				'link' => Loader::getRootURL() . 'contact/'));
41 41
 		
42
-		if(!URLDecode::getPiece(1))
43
-			$active_page = 'About';
44
-		else
45
-			$active_page = ucfirst(URLDecode::getPiece(1));
42
+		if(!URLDecode::getPiece(1)) {
43
+					$active_page = 'About';
44
+		} else {
45
+					$active_page = ucfirst(URLDecode::getPiece(1));
46
+		}
46 47
 		
47 48
 		foreach($menu as $menu_item)
48 49
 		{
@@ -63,10 +64,11 @@  discard block
 block discarded – undo
63 64
 		{
64 65
 			$piece_obj = new stdclass();
65 66
 			$piece_obj->title = $piece->title;
66
-			if("{$piece->category}" == 1)
67
-				$piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
68
-			else
69
-				$piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
67
+			if("{$piece->category}" == 1) {
68
+							$piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
69
+			} else {
70
+							$piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
71
+			}
70 72
 			$piece_obj->image = "/{$piece->image}";
71 73
 			$piece_array[] = $piece_obj;
72 74
 		}
Please login to merge, or discard this patch.
controller/portfolio/PieceController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@
 block discarded – undo
36 36
 		Loader::load('collector', 'portfolio/PortfolioCollector');
37 37
 		$portfolio_result = PortfolioCollector::getPieceByURI($this->title_url);
38 38
 		
39
-		if($portfolio_result === null)
40
-			$this->eject();
39
+		if($portfolio_result === null) {
40
+					$this->eject();
41
+		}
41 42
 		
42 43
 		$portfolio_image_result = PortfolioCollector::getImagesForPiece($portfolio_result->id, 2);
43 44
 		$image = new ImageOld("portfolio/{$portfolio_image_result[0]->name}");
Please login to merge, or discard this patch.
controller/site/ContactController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,15 +29,19 @@
 block discarded – undo
29 29
 
30 30
 	private function get_form_results()
31 31
 	{
32
-		if(!Request::hasPost())
33
-			return array();
32
+		if(!Request::hasPost()) {
33
+					return array();
34
+		}
34 35
 		
35
-		if(!Validate::checkRequest('post', 'name', 'string'))
36
-			$error_message['name'] = 'Please enter a value for your name.';
37
-		if(!Validate::checkRequest('post', 'email', 'string'))
38
-			$error_message['email'] = 'Please enter a valid email address.';
39
-		if(!Validate::checkRequest('post', 'message', 'string'))
40
-			$error_message['message'] = 'Please enter a message.';
36
+		if(!Validate::checkRequest('post', 'name', 'string')) {
37
+					$error_message['name'] = 'Please enter a value for your name.';
38
+		}
39
+		if(!Validate::checkRequest('post', 'email', 'string')) {
40
+					$error_message['email'] = 'Please enter a valid email address.';
41
+		}
42
+		if(!Validate::checkRequest('post', 'message', 'string')) {
43
+					$error_message['message'] = 'Please enter a message.';
44
+		}
41 45
 		
42 46
 		if(!empty($error_message))
43 47
 		{
Please login to merge, or discard this patch.
controller/site/DefaultPageController.class.inc.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,14 +56,16 @@
 block discarded – undo
56 56
 	{
57 57
 		$current_uri = URLDecode::getPiece(1);
58 58
 		
59
-		if(!isset($current_uri))
60
-			return 'About';
59
+		if(!isset($current_uri)) {
60
+					return 'About';
61
+		}
61 62
 		
62 63
 		$menu = self::$MENU;
63 64
 		foreach($menu as $link)
64 65
 		{
65
-			if($link['uri'] == $current_uri)
66
-				return $link['name'];
66
+			if($link['uri'] == $current_uri) {
67
+							return $link['name'];
68
+			}
67 69
 		}
68 70
 		
69 71
 		return 'About';
Please login to merge, or discard this patch.
controller/sitemap/PortfolioSitemapController.class.inc.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,10 +18,11 @@
 block discarded – undo
18 18
 		
19 19
 		foreach($pieces as $piece)
20 20
 		{
21
-			if($piece->category == 1)
22
-				$this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
23
-			else
24
-				$this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
21
+			if($piece->category == 1) {
22
+							$this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
23
+			} else {
24
+							$this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
25
+			}
25 26
 		}
26 27
 	}
27 28
 
Please login to merge, or discard this patch.
controller/waterfalls/CompanionListController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
 		$alias = URLDecode::getPiece(2);
28 28
 		$this->companion = CompanionCollector::getByAlias($alias);
29 29
 		
30
-		if(!$this->companion)
31
-			$this->eject();
30
+		if(!$this->companion) {
31
+					$this->eject();
32
+		}
32 33
 		
33 34
 		parent::__construct();
34 35
 	}
Please login to merge, or discard this patch.
controller/waterfalls/ContactController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,17 +33,21 @@
 block discarded – undo
33 33
 
34 34
 	private function process_form()
35 35
 	{
36
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
37
-			return (object) array('display' => 'normal');
36
+		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') {
37
+					return (object) array('display' => 'normal');
38
+		}
38 39
 		
39 40
 		Loader::load('utility', 'Validate');
40 41
 		$error_result = array();
41
-		if(!Validate::checkRequest('post', 'name', 'string'))
42
-			$error_result['name'] = 'please enter your name';
43
-		if(!Validate::checkRequest('post', 'email', 'string'))
44
-			$error_result['email'] = 'please enter a valid email';
45
-		if(!Validate::checkRequest('post', 'message', 'string'))
46
-			$error_result['message'] = 'please write a message';
42
+		if(!Validate::checkRequest('post', 'name', 'string')) {
43
+					$error_result['name'] = 'please enter your name';
44
+		}
45
+		if(!Validate::checkRequest('post', 'email', 'string')) {
46
+					$error_result['email'] = 'please enter a valid email';
47
+		}
48
+		if(!Validate::checkRequest('post', 'message', 'string')) {
49
+					$error_result['message'] = 'please write a message';
50
+		}
47 51
 		
48 52
 		$values = (object) array(
49 53
 			'name' => Request::getPost('name'),
Please login to merge, or discard this patch.
controller/waterfalls/CountyListController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@
 block discarded – undo
28 28
 		$path = URLDecode::getPiece(1);
29 29
 		$this->county = CountyCollector::getByAlias($path);
30 30
 		
31
-		if(!$this->county)
32
-			$this->eject();
31
+		if(!$this->county) {
32
+					$this->eject();
33
+		}
33 34
 		
34 35
 		parent::__construct();
35 36
 	}
Please login to merge, or discard this patch.
controller/waterfalls/DefaultListController.class.inc.php 1 patch
Braces   +47 added lines, -35 removed lines patch added patch discarded remove patch
@@ -20,15 +20,17 @@  discard block
 block discarded – undo
20 20
 		$this->offset = ($this->page - 1) * $this->get_item_count_per_page();
21 21
 		
22 22
 		$items = $this->get_items();
23
-		if(count($items) < 1)
24
-			$this->eject();
23
+		if(count($items) < 1) {
24
+					$this->eject();
25
+		}
25 26
 	}
26 27
 
27 28
 	final protected function get_page_number()
28 29
 	{
29 30
 		$page = $this->get_page_number_piece();
30
-		if(isset($page) && is_numeric($page))
31
-			return $page;
31
+		if(isset($page) && is_numeric($page)) {
32
+					return $page;
33
+		}
32 34
 		return 1;
33 35
 	}
34 36
 
@@ -41,8 +43,9 @@  discard block
 block discarded – undo
41 43
 
42 44
 	final private function get_introduction()
43 45
 	{
44
-		if($this->page == 1)
45
-			return $this->get_initial_introduction();
46
+		if($this->page == 1) {
47
+					return $this->get_initial_introduction();
48
+		}
46 49
 		
47 50
 		return $this->get_subsequent_introduction();
48 51
 	}
@@ -68,8 +71,9 @@  discard block
 block discarded – undo
68 71
 	private $item_count;
69 72
 	final private function get_item_count()
70 73
 	{
71
-		if(!isset($this->item_count))
72
-			$this->item_count = $this->get_item_count_result();
74
+		if(!isset($this->item_count)) {
75
+					$this->item_count = $this->get_item_count_result();
76
+		}
73 77
 		return $this->item_count;
74 78
 	}
75 79
 
@@ -82,10 +86,11 @@  discard block
 block discarded – undo
82 86
 		$this->set_head('next_link', $this->get_list_next_link());
83 87
 		$this->set_head('previous_link', $this->get_list_prev_link());
84 88
 		
85
-		if($this->page == 1)
86
-			$meta_array = $this->get_initial_meta();
87
-		else
88
-			$meta_array = $this->get_subsequent_meta();
89
+		if($this->page == 1) {
90
+					$meta_array = $this->get_initial_meta();
91
+		} else {
92
+					$meta_array = $this->get_subsequent_meta();
93
+		}
89 94
 		
90 95
 		$this->set_title($meta_array['title']);
91 96
 		$this->set_description($meta_array['description']);
@@ -119,17 +124,20 @@  discard block
 block discarded – undo
119 124
 
120 125
 	final private function get_list_prev_link()
121 126
 	{
122
-		if($this->page == 1)
123
-			return;
124
-		if($this->page == 2)
125
-			return $this->get_list_link_root();
127
+		if($this->page == 1) {
128
+					return;
129
+		}
130
+		if($this->page == 2) {
131
+					return $this->get_list_link_root();
132
+		}
126 133
 		return $this->get_list_link_root() . ($this->page - 1) . '/';
127 134
 	}
128 135
 
129 136
 	final private function get_list_next_link()
130 137
 	{
131
-		if(($this->page * $this->get_item_count_per_page()) >= $this->get_item_count())
132
-			return;
138
+		if(($this->page * $this->get_item_count_per_page()) >= $this->get_item_count()) {
139
+					return;
140
+		}
133 141
 		return $this->get_list_link_root() . ($this->page + 1) . '/';
134 142
 	}
135 143
 
@@ -139,15 +147,17 @@  discard block
 block discarded – undo
139 147
 	{
140 148
 		$link_array = array();
141 149
 		
142
-		if($this->get_item_count_per_page() >= $this->get_item_count())
143
-			return $link_array;
150
+		if($this->get_item_count_per_page() >= $this->get_item_count()) {
151
+					return $link_array;
152
+		}
144 153
 		
145 154
 		$link = new stdclass();
146 155
 		$link->anchor = '&laquo; previous';
147
-		if($this->get_list_prev_link() !== null)
148
-			$link->uri = $this->get_list_prev_link();
149
-		else
150
-			$link->class = 'inactive';
156
+		if($this->get_list_prev_link() !== null) {
157
+					$link->uri = $this->get_list_prev_link();
158
+		} else {
159
+					$link->class = 'inactive';
160
+		}
151 161
 		$link_array[] = $link;
152 162
 		
153 163
 		for($i = 1; $i <= ceil($this->get_item_count() / $this->get_item_count_per_page()); $i++)
@@ -155,14 +165,15 @@  discard block
 block discarded – undo
155 165
 			$link = new stdclass();
156 166
 			$link->anchor = $i;
157 167
 			
158
-			if($i == $this->page)
159
-				$link->class = 'current';
160
-			else
168
+			if($i == $this->page) {
169
+							$link->class = 'current';
170
+			} else
161 171
 			{
162
-				if($i == 1)
163
-					$link->uri = $this->get_list_link_root();
164
-				else
165
-					$link->uri = $this->get_list_link_root() . $i . '/';
172
+				if($i == 1) {
173
+									$link->uri = $this->get_list_link_root();
174
+				} else {
175
+									$link->uri = $this->get_list_link_root() . $i . '/';
176
+				}
166 177
 			}
167 178
 			
168 179
 			$link_array[] = $link;
@@ -170,10 +181,11 @@  discard block
 block discarded – undo
170 181
 		
171 182
 		$link = new stdclass();
172 183
 		$link->anchor = 'next &raquo;';
173
-		if($this->get_list_next_link() !== null)
174
-			$link->uri = $this->get_list_next_link();
175
-		else
176
-			$link->class = 'inactive';
184
+		if($this->get_list_next_link() !== null) {
185
+					$link->uri = $this->get_list_next_link();
186
+		} else {
187
+					$link->class = 'inactive';
188
+		}
177 189
 		$link_array[] = $link;
178 190
 		
179 191
 		return $link_array;
Please login to merge, or discard this patch.