Completed
Push — master ( d9eba8...4988a4 )
by Jacob
03:52
created
controller/waterfalls/HomeController.class.inc.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 ));
8 8
 Loader::load('controller', 'waterfalls/DefaultPageController');
9 9
 
10
-final class HomeController extends DefaultPageController
11
-{
10
+final class HomeController extends DefaultPageController
11
+{
12 12
 
13 13
     private static $TITLE = 'Waterfalls of the Keweenaw | Stories and Tips from Jacob Emerick';
14 14
     private static $DESCRIPTION = 'Stories, maps, and details about many of the waterfalls in the Upper Peninsula of Michigan, compiled by Jacob Emerick.';
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
     private static $BANNER_IMAGE = 2661;
23 23
 
24
-    protected function set_head_data()
25
-    {
24
+    protected function set_head_data()
25
+    {
26 26
         parent::set_head_data();
27 27
         
28 28
         $this->set_title(self::$TITLE);
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         $this->set_keywords(self::$KEYWORD_ARRAY);
31 31
     }
32 32
 
33
-    protected function set_body_data($page_type = 'wide')
34
-    {
33
+    protected function set_body_data($page_type = 'wide')
34
+    {
35 35
         parent::set_body_data($page_type);
36 36
         
37 37
         $photo = PhotoCollector::getRow(self::$BANNER_IMAGE);
Please login to merge, or discard this patch.
controller/waterfalls/CompanionListController.class.inc.php 1 patch
Braces   +27 added lines, -26 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 Loader::load('collector', 'waterfall/CompanionCollector');
4 4
 Loader::load('controller', 'waterfalls/DefaultLogListController');
5 5
 
6
-final class CompanionListController extends DefaultLogListController
7
-{
6
+final class CompanionListController extends DefaultLogListController
7
+{
8 8
 
9 9
 	private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d';
10 10
 	private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan';
@@ -22,19 +22,20 @@  discard block
 block discarded – undo
22 22
 
23 23
 	private $companion;
24 24
 
25
-	public function __construct()
26
-	{
25
+	public function __construct()
26
+	{
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
 	}
35 36
 
36
-	protected function get_initial_meta()
37
-	{
37
+	protected function get_initial_meta()
38
+	{
38 39
 		$meta_array = array();
39 40
 		
40 41
 		$meta_array['title'] = "Hiking Stories with {$this->companion->name} | " . self::$WEBSITE_TITLE;
@@ -44,8 +45,8 @@  discard block
 block discarded – undo
44 45
 		return $meta_array;
45 46
 	}
46 47
 
47
-	protected function get_subsequent_meta()
48
-	{
48
+	protected function get_subsequent_meta()
49
+	{
49 50
 		$meta_array = array();
50 51
 		
51 52
 		$meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count);
@@ -55,15 +56,15 @@  discard block
 block discarded – undo
55 56
 		return $meta_array;
56 57
 	}
57 58
 
58
-	private function get_keyword_array()
59
-	{
59
+	private function get_keyword_array()
60
+	{
60 61
 		$keyword_array = self::$KEYWORD_ARRAY;
61 62
 		array_unshift($keyword_array, strtolower($this->companion->name));
62 63
 		return $keyword_array;
63 64
 	}
64 65
 
65
-	protected function get_initial_introduction()
66
-	{
66
+	protected function get_initial_introduction()
67
+	{
67 68
 		$introduction = array();
68 69
 		
69 70
 		$introduction['title'] = $this->companion->title;
@@ -73,34 +74,34 @@  discard block
 block discarded – undo
73 74
 		return $introduction;
74 75
 	}
75 76
 
76
-	protected function get_subsequent_introduction()
77
-	{
77
+	protected function get_subsequent_introduction()
78
+	{
78 79
 		return array(
79 80
 			'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->companion->name));
80 81
 	}
81 82
 
82
-	protected function get_page_number_piece()
83
-	{
83
+	protected function get_page_number_piece()
84
+	{
84 85
 		return URLDecode::getPiece(3);
85 86
 	}
86 87
 
87
-	protected function get_item_result($total, $offset)
88
-	{
88
+	protected function get_item_result($total, $offset)
89
+	{
89 90
 		return CompanionCollector::getLogListForCompanion($this->companion->id, $total, $offset);
90 91
 	}
91 92
 
92
-	protected function get_item_count_result()
93
-	{
93
+	protected function get_item_count_result()
94
+	{
94 95
 		return CompanionCollector::getLogCountForCompanion($this->companion->id);
95 96
 	}
96 97
 
97
-	protected function get_list_description_pattern()
98
-	{
98
+	protected function get_list_description_pattern()
99
+	{
99 100
 		return str_replace('%COMPANION%', $this->companion->name, self::$NAVIGATION_DESCRIPTION);
100 101
 	}
101 102
 
102
-	protected function get_list_link_root()
103
-	{
103
+	protected function get_list_link_root()
104
+	{
104 105
 		return sprintf(self::$LINK_ROOT, $this->companion->alias);
105 106
 	}
106 107
 
Please login to merge, or discard this patch.
controller/waterfalls/SearchListController.class.inc.php 1 patch
Braces   +23 added lines, -22 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('controller', 'waterfalls/DefaultListController');
4 4
 
5
-final class SearchListController extends DefaultListController
6
-{
5
+final class SearchListController extends DefaultListController
6
+{
7 7
 
8 8
 	private static $TITLE = 'Search Listing';
9 9
 	private static $DESCRIPTION = '';
10 10
 
11 11
 	private static $KEYWORD_ARRAY = array();
12 12
 
13
-	protected function set_head_data()
14
-	{
13
+	protected function set_head_data()
14
+	{
15 15
 		parent::set_head_data();
16 16
 		
17 17
 		$this->set_title(self::$TITLE);
@@ -19,47 +19,48 @@  discard block
 block discarded – undo
19 19
 		$this->set_keywords(self::$KEYWORD_ARRAY);
20 20
 	}
21 21
 
22
-	protected function get_introduction()
23
-	{
22
+	protected function get_introduction()
23
+	{
24 24
 		return;
25 25
 	}
26 26
 
27
-	protected function get_page_number()
28
-	{
27
+	protected function get_page_number()
28
+	{
29 29
 		$page = URLDecode::getPiece(2);
30
-		if(isset($page) && is_numeric($page))
31
-			return $page;
30
+		if(isset($page) && is_numeric($page)) {
31
+					return $page;
32
+		}
32 33
 		return 1;
33 34
 	}
34 35
 
35
-	protected function get_items()
36
-	{
36
+	protected function get_items()
37
+	{
37 38
 		return array();
38 39
 	}
39 40
 
40
-	protected function get_list_description()
41
-	{
41
+	protected function get_list_description()
42
+	{
42 43
 		return 'yay cloud';
43 44
 	}
44 45
 
45
-	protected function get_list_next_link()
46
-	{
46
+	protected function get_list_next_link()
47
+	{
47 48
 		return '/';
48 49
 	}
49 50
 
50
-	protected function get_list_prev_link()
51
-	{
51
+	protected function get_list_prev_link()
52
+	{
52 53
 		return '/';
53 54
 	}
54 55
 
55 56
 	private $total_post_count;
56
-	protected function get_item_count()
57
-	{
57
+	protected function get_item_count()
58
+	{
58 59
 		return 20;
59 60
 	}
60 61
 
61
-	protected function get_item_count_per_page()
62
-	{
62
+	protected function get_item_count_per_page()
63
+	{
63 64
 		return 20;
64 65
 	}
65 66
 
Please login to merge, or discard this patch.
controller/waterfalls/LogTagListController.class.inc.php 1 patch
Braces   +27 added lines, -26 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 Loader::load('collector', 'waterfall/LogTagCollector');
4 4
 Loader::load('controller', 'waterfalls/DefaultLogListController');
5 5
 
6
-final class LogTagListController extends DefaultLogListController
7
-{
6
+final class LogTagListController extends DefaultLogListController
7
+{
8 8
 
9 9
 	private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d';
10 10
 	private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan';
@@ -22,19 +22,20 @@  discard block
 block discarded – undo
22 22
 
23 23
 	private $tag;
24 24
 
25
-	public function __construct()
26
-	{
25
+	public function __construct()
26
+	{
27 27
 		$alias = URLDecode::getPiece(3);
28 28
 		$this->tag = LogTagCollector::getTag($alias);
29 29
 		
30
-		if(!$this->tag)
31
-			$this->eject();
30
+		if(!$this->tag) {
31
+					$this->eject();
32
+		}
32 33
 		
33 34
 		parent::__construct();
34 35
 	}
35 36
 
36
-	protected function get_initial_meta()
37
-	{
37
+	protected function get_initial_meta()
38
+	{
38 39
 		$meta_array = array();
39 40
 		
40 41
 		$meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE;
@@ -44,8 +45,8 @@  discard block
 block discarded – undo
44 45
 		return $meta_array;
45 46
 	}
46 47
 
47
-	protected function get_subsequent_meta()
48
-	{
48
+	protected function get_subsequent_meta()
49
+	{
49 50
 		$meta_array = array();
50 51
 		
51 52
 		$meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count);
@@ -55,46 +56,46 @@  discard block
 block discarded – undo
55 56
 		return $meta_array;
56 57
 	}
57 58
 
58
-	private function get_keyword_array()
59
-	{
59
+	private function get_keyword_array()
60
+	{
60 61
 		$keyword_array = self::$KEYWORD_ARRAY;
61 62
 		array_unshift($keyword_array, strtolower($this->tag->name));
62 63
 		return $keyword_array;
63 64
 	}
64 65
 
65
-	protected function get_initial_introduction()
66
-	{
66
+	protected function get_initial_introduction()
67
+	{
67 68
 		return array(
68 69
 			'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name));
69 70
 	}
70 71
 
71
-	protected function get_subsequent_introduction()
72
-	{
72
+	protected function get_subsequent_introduction()
73
+	{
73 74
 		return $this->get_initial_introduction();
74 75
 	}
75 76
 
76
-	protected function get_page_number_piece()
77
-	{
77
+	protected function get_page_number_piece()
78
+	{
78 79
 		return URLDecode::getPiece(3);
79 80
 	}
80 81
 
81
-	protected function get_item_result($total, $offset)
82
-	{
82
+	protected function get_item_result($total, $offset)
83
+	{
83 84
 		return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset);
84 85
 	}
85 86
 
86
-	protected function get_item_count_result()
87
-	{
87
+	protected function get_item_count_result()
88
+	{
88 89
 		return LogTagCollector::getLogCountForTag($this->tag->id);
89 90
 	}
90 91
 
91
-	protected function get_list_description_pattern()
92
-	{
92
+	protected function get_list_description_pattern()
93
+	{
93 94
 		return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION);
94 95
 	}
95 96
 
96
-	protected function get_list_link_root()
97
-	{
97
+	protected function get_list_link_root()
98
+	{
98 99
 		return sprintf(self::$LINK_ROOT, $this->tag->alias);
99 100
 	}
100 101
 
Please login to merge, or discard this patch.
controller/waterfalls/DefaultListController.class.inc.php 1 patch
Braces   +75 added lines, -63 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('controller', 'waterfalls/DefaultPageController');
4 4
 
5
-abstract class DefaultListController extends DefaultPageController
6
-{
5
+abstract class DefaultListController extends DefaultPageController
6
+{
7 7
 
8 8
 	private static $IMAGE_ELEMENT_PATTERN = '<img src="/photo/%s/%s-size-%s.jpg" alt="%s" height="%s" width="%s" />';
9 9
 
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 	protected $page_count;
12 12
 	protected $offset;
13 13
 
14
-	public function __construct()
15
-	{
14
+	public function __construct()
15
+	{
16 16
 		parent::__construct();
17 17
 		
18 18
 		$this->page = $this->get_page_number();
@@ -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
-	final protected function get_page_number()
28
-	{
28
+	final protected function get_page_number()
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
 
@@ -39,10 +41,11 @@  discard block
 block discarded – undo
39 41
 	abstract protected function get_sidebar();
40 42
 	abstract protected function get_list_view();
41 43
 
42
-	final private function get_introduction()
43
-	{
44
-		if($this->page == 1)
45
-			return $this->get_initial_introduction();
44
+	final private function get_introduction()
45
+	{
46
+		if($this->page == 1) {
47
+					return $this->get_initial_introduction();
48
+		}
46 49
 		
47 50
 		return $this->get_subsequent_introduction();
48 51
 	}
@@ -51,8 +54,8 @@  discard block
 block discarded – undo
51 54
 	abstract protected function get_subsequent_introduction();
52 55
 
53 56
 	private $items;
54
-	protected function get_items()
55
-	{
57
+	protected function get_items()
58
+	{
56 59
 		if(!isset($this->items))
57 60
 		{
58 61
 			$total = $this->get_item_count_per_page();
@@ -66,26 +69,28 @@  discard block
 block discarded – undo
66 69
 	abstract protected function get_item_result($total, $offset);
67 70
 
68 71
 	private $item_count;
69
-	final private function get_item_count()
70
-	{
71
-		if(!isset($this->item_count))
72
-			$this->item_count = $this->get_item_count_result();
72
+	final private function get_item_count()
73
+	{
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
 
76 80
 	abstract protected function get_item_count_result();
77 81
 
78
-	final protected function set_head_data()
79
-	{
82
+	final protected function set_head_data()
83
+	{
80 84
 		parent::set_head_data();
81 85
 		
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']);
@@ -95,16 +100,16 @@  discard block
 block discarded – undo
95 100
 	abstract protected function get_initial_meta();
96 101
 	abstract protected function get_subsequent_meta();
97 102
 
98
-    final protected function set_body_data($page_type = 'normal')
99
-    {
103
+    final protected function set_body_data($page_type = 'normal')
104
+    {
100 105
         parent::set_body_data($page_type);
101 106
 		
102 107
 		$this->set_body('view', $this->get_list_view());
103 108
 		$this->set_body('data', $this->get_list_body_data());
104 109
 	}
105 110
 
106
-	final private function get_list_body_data()
107
-	{
111
+	final private function get_list_body_data()
112
+	{
108 113
 		$body_data_array = array();
109 114
 		
110 115
         $body_data_array['introduction'] = $this->get_introduction();
@@ -117,37 +122,42 @@  discard block
 block discarded – undo
117 122
 		return $body_data_array;
118 123
 	}
119 124
 
120
-	final private function get_list_prev_link()
121
-	{
122
-		if($this->page == 1)
123
-			return;
124
-		if($this->page == 2)
125
-			return $this->get_list_link_root();
125
+	final private function get_list_prev_link()
126
+	{
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
-	final private function get_list_next_link()
130
-	{
131
-		if(($this->page * $this->get_item_count_per_page()) >= $this->get_item_count())
132
-			return;
136
+	final private function get_list_next_link()
137
+	{
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
 
136 144
 	abstract protected function get_list_link_root();
137 145
 
138
-	final private function get_list_link_array()
139
-	{
146
+	final private function get_list_link_array()
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,17 +181,18 @@  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;
180 192
 	}
181 193
 
182
-	final private function get_list_description()
183
-	{
194
+	final private function get_list_description()
195
+	{
184 196
 		$start = ($this->page - 1) * $this->get_item_count_per_page() + 1;
185 197
 		$end = min($this->page * $this->get_item_count_per_page(), $this->get_item_count());
186 198
 		$total = $this->get_item_count();
@@ -190,8 +202,8 @@  discard block
 block discarded – undo
190 202
 
191 203
 	abstract protected function get_list_description_pattern();
192 204
 
193
-	final protected function get_image_element($category, $path, $description, $size = 'small')
194
-	{
205
+	final protected function get_image_element($category, $path, $description, $size = 'small')
206
+	{
195 207
 		switch($size)
196 208
 		{
197 209
 			case 'medium' :
Please login to merge, or discard this patch.
controller/waterfalls/ContactController.class.inc.php 1 patch
Braces   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('controller', 'waterfalls/DefaultPageController');
4 4
 
5
-final class ContactController extends DefaultPageController
6
-{
5
+final class ContactController extends DefaultPageController
6
+{
7 7
 
8 8
 	private static $TITLE = 'Contact Jacob Emerick | Waterfalls of the Keweenaw';
9 9
 	private static $DESCRIPTION = 'Contact page to reach Jacob Emerick by email or social networks';
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 		'waterfalls',
15 15
 		'Jacob Emerick');
16 16
 
17
-	protected function set_head_data()
18
-	{
17
+	protected function set_head_data()
18
+	{
19 19
 		$this->set_title(self::$TITLE);
20 20
 		$this->set_description(self::$DESCRIPTION);
21 21
 		$this->set_keywords(self::$KEYWORD_ARRAY);
@@ -23,27 +23,31 @@  discard block
 block discarded – undo
23 23
 		parent::set_head_data();
24 24
 	}
25 25
 
26
-	protected function set_body_data()
27
-	{
26
+	protected function set_body_data()
27
+	{
28 28
 		$this->set_body('form_container', $this->process_form());
29 29
 		$this->set_body('view', 'Contact');
30 30
 		
31 31
 		parent::set_body_data();
32 32
 	}
33 33
 
34
-	private function process_form()
35
-	{
36
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
37
-			return (object) array('display' => 'normal');
34
+	private function process_form()
35
+	{
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/MapController.class.inc.php 1 patch
Braces   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 Loader::load('controller', 'waterfalls/DefaultPageController');
4 4
 Loader::load('collector', 'waterfall/WaterfallCollector');
5 5
 
6
-final class MapController extends DefaultPageController
7
-{
6
+final class MapController extends DefaultPageController
7
+{
8 8
 
9 9
     private static $TITLE = 'Map of Upper Peninsula Waterfalls';
10 10
     private static $DESCRIPTION = '';
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
         'Upper Tahquamenon Falls',
18 18
     );
19 19
 
20
-    public function __construct()
21
-    {
20
+    public function __construct()
21
+    {
22 22
         parent::__construct();
23 23
 
24 24
         $this->add_js('https://maps.googleapis.com/maps/api/js?sensor=false');
25 25
         $this->add_waterfall_js();
26 26
     }
27 27
 
28
-    protected function set_head_data()
29
-    {
28
+    protected function set_head_data()
29
+    {
30 30
         parent::set_head_data();
31 31
         
32 32
         $this->set_title(self::$TITLE . ' | ' . self::$WEBSITE_TITLE);
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
         $this->set_keywords(self::$KEYWORD_ARRAY);
35 35
     }
36 36
 
37
-    protected function set_body_data($page_type = 'wide')
38
-    {
37
+    protected function set_body_data($page_type = 'wide')
38
+    {
39 39
         parent::set_body_data($page_type);
40 40
         
41 41
         $this->set_head('full_page_map', true);
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
         $this->set_body('view', 'Map');
44 44
     }
45 45
 
46
-    private function fetch_waterfall_list()
47
-    {
46
+    private function fetch_waterfall_list()
47
+    {
48 48
         $list = WaterfallCollector::getMapList();
49 49
         array_walk($list, array($this, 'parse_waterfall'));
50 50
         return $list;
51 51
     }
52 52
 
53
-    private function parse_waterfall(&$waterfall)
54
-    {
53
+    private function parse_waterfall(&$waterfall)
54
+    {
55 55
         $waterfall = (object) array(
56 56
             'name'  => $waterfall->name,
57 57
             'latitude' => $waterfall->latitude,
Please login to merge, or discard this patch.
controller/waterfalls/CountyListController.class.inc.php 1 patch
Braces   +29 added lines, -28 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 Loader::load('collector', 'waterfall/CountyCollector');
4 4
 Loader::load('controller', 'waterfalls/DefaultWaterfallListController');
5 5
 
6
-final class CountyListController extends DefaultWaterfallListController
7
-{
6
+final class CountyListController extends DefaultWaterfallListController
7
+{
8 8
 
9 9
 	private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d';
10 10
 	private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.';
@@ -23,19 +23,20 @@  discard block
 block discarded – undo
23 23
 
24 24
 	private $county;
25 25
 
26
-	public function __construct()
27
-	{
26
+	public function __construct()
27
+	{
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
 	}
36 37
 
37
-	protected function get_initial_meta()
38
-	{
38
+	protected function get_initial_meta()
39
+	{
39 40
 		$meta_array = array();
40 41
 		
41 42
 		$meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE;
@@ -45,8 +46,8 @@  discard block
 block discarded – undo
45 46
 		return $meta_array;
46 47
 	}
47 48
 
48
-	protected function get_subsequent_meta()
49
-	{
49
+	protected function get_subsequent_meta()
50
+	{
50 51
 		$meta_array = array();
51 52
 		
52 53
 		$meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count);
@@ -56,15 +57,15 @@  discard block
 block discarded – undo
56 57
 		return $meta_array;
57 58
 	}
58 59
 
59
-	private function get_keyword_array()
60
-	{
60
+	private function get_keyword_array()
61
+	{
61 62
 		$keyword_array = self::$KEYWORD_ARRAY;
62 63
 		array_unshift($keyword_array, strtolower($this->county->name));
63 64
 		return $keyword_array;
64 65
 	}
65 66
 
66
-	protected function get_initial_introduction()
67
-	{
67
+	protected function get_initial_introduction()
68
+	{
68 69
 		$introduction = array();
69 70
 		
70 71
 		$introduction['title'] = $this->county->title;
@@ -74,39 +75,39 @@  discard block
 block discarded – undo
74 75
 		return $introduction;
75 76
 	}
76 77
 
77
-	protected function get_subsequent_introduction()
78
-	{
78
+	protected function get_subsequent_introduction()
79
+	{
79 80
 		return array(
80 81
 			'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name));
81 82
 	}
82 83
 
83
-	protected function get_item_count_per_page()
84
-	{
84
+	protected function get_item_count_per_page()
85
+	{
85 86
 		return self::$ITEM_COUNT_PER_PAGE;
86 87
 	}
87 88
 
88
-	protected function get_page_number_piece()
89
-	{
89
+	protected function get_page_number_piece()
90
+	{
90 91
 		return URLDecode::getPiece(2);
91 92
 	}
92 93
 
93
-	protected function get_item_result($total, $offset)
94
-	{
94
+	protected function get_item_result($total, $offset)
95
+	{
95 96
 		return CountyCollector::getLogListForCounty($this->county->id, $total, $offset);
96 97
 	}
97 98
 
98
-	protected function get_item_count_result()
99
-	{
99
+	protected function get_item_count_result()
100
+	{
100 101
 		return CountyCollector::getLogCountForCounty($this->county->id);
101 102
 	}
102 103
 
103
-	protected function get_list_description_pattern()
104
-	{
104
+	protected function get_list_description_pattern()
105
+	{
105 106
 		return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION);
106 107
 	}
107 108
 
108
-	protected function get_list_link_root()
109
-	{
109
+	protected function get_list_link_root()
110
+	{
110 111
 		return sprintf(self::$LINK_ROOT, $this->county->alias);
111 112
 	}
112 113
 
Please login to merge, or discard this patch.
controller/waterfalls/AboutController.class.inc.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 Loader::load('controller', 'waterfalls/DefaultPageController');
4 4
 
5
-final class AboutController extends DefaultPageController
6
-{
5
+final class AboutController extends DefaultPageController
6
+{
7 7
 
8 8
     private static $TITLE = 'About the Website | Waterfalls of the Keweenaw';
9 9
     private static $DESCRIPTION = 'A little bit about the website, the area, and the reason why someone would hunt down a hundred and fifty waterfalls in the Upper Peninsula.';
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
         'Jacob Emerick',
15 15
     );
16 16
 
17
-    protected function set_head_data()
18
-    {
17
+    protected function set_head_data()
18
+    {
19 19
         parent::set_head_data();
20 20
         
21 21
         $this->set_title(self::$TITLE);
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
         $this->set_keywords(self::$KEYWORD_ARRAY);
24 24
     }
25 25
 
26
-    protected function set_body_data($page_type = 'normal')
27
-    {
26
+    protected function set_body_data($page_type = 'normal')
27
+    {
28 28
         parent::set_body_data($page_type);
29 29
         
30 30
         $this->set_body('view', 'About');
Please login to merge, or discard this patch.