Completed
Pull Request — master (#5)
by Jacob
03:16
created
controller/waterfalls/PeriodListController.class.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 		$alias = URLDecode::getPiece(2);
27 27
 		$this->period = PeriodCollector::getByAlias($alias);
28 28
 		
29
-		if(!$this->period)
29
+		if (!$this->period)
30 30
 			$this->eject();
31 31
 		
32 32
 		parent::__construct();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@
 block discarded – undo
26 26
 		$alias = URLDecode::getPiece(2);
27 27
 		$this->period = PeriodCollector::getByAlias($alias);
28 28
 		
29
-		if(!$this->period)
30
-			$this->eject();
29
+		if(!$this->period) {
30
+					$this->eject();
31
+		}
31 32
 		
32 33
 		parent::__construct();
33 34
 	}
Please login to merge, or discard this patch.
controller/waterfalls/AboutController.class.inc.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,29 +5,29 @@
 block discarded – undo
5 5
 final class AboutController extends DefaultPageController
6 6
 {
7 7
 
8
-    private static $TITLE = 'About the Website | Waterfalls of the Keweenaw';
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.';
10
-    private static $KEYWORD_ARRAY = array(
11
-        'about',
12
-        'waterfalls',
13
-        'birthday trip',
14
-        'Jacob Emerick',
15
-    );
8
+	private static $TITLE = 'About the Website | Waterfalls of the Keweenaw';
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.';
10
+	private static $KEYWORD_ARRAY = array(
11
+		'about',
12
+		'waterfalls',
13
+		'birthday trip',
14
+		'Jacob Emerick',
15
+	);
16 16
 
17
-    protected function set_head_data()
18
-    {
19
-        parent::set_head_data();
17
+	protected function set_head_data()
18
+	{
19
+		parent::set_head_data();
20 20
         
21
-        $this->set_title(self::$TITLE);
22
-        $this->set_description(self::$DESCRIPTION);
23
-        $this->set_keywords(self::$KEYWORD_ARRAY);
24
-    }
21
+		$this->set_title(self::$TITLE);
22
+		$this->set_description(self::$DESCRIPTION);
23
+		$this->set_keywords(self::$KEYWORD_ARRAY);
24
+	}
25 25
 
26
-    protected function set_body_data($page_type = 'normal')
27
-    {
28
-        parent::set_body_data($page_type);
26
+	protected function set_body_data($page_type = 'normal')
27
+	{
28
+		parent::set_body_data($page_type);
29 29
         
30
-        $this->set_body('view', 'About');
31
-    }
30
+		$this->set_body('view', 'About');
31
+	}
32 32
 
33 33
 }
Please login to merge, or discard this patch.
controller/waterfalls/DefaultLogListController.class.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$companion_result = CompanionCollector::getCompanionList();
43 43
 		$companion_list = array();
44 44
 		
45
-		foreach($companion_result as $companion_row)
45
+		foreach ($companion_result as $companion_row)
46 46
 		{
47 47
 			$companion = new stdclass();
48 48
 			$companion->name = $companion_row->name;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$period_result = PeriodCollector::getPeriodList();
56 56
 		$period_list = array();
57 57
 		
58
-		foreach($period_result as $period_row)
58
+		foreach ($period_result as $period_row)
59 59
 		{
60 60
 			$period = new stdclass();
61 61
 			$period->name = $period_row->name;
Please login to merge, or discard this patch.
controller/waterfalls/SearchListController.class.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	protected function get_page_number()
28 28
 	{
29 29
 		$page = URLDecode::getPiece(2);
30
-		if(isset($page) && is_numeric($page))
30
+		if (isset($page) && is_numeric($page))
31 31
 			return $page;
32 32
 		return 1;
33 33
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
 	protected function get_page_number()
28 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
 
Please login to merge, or discard this patch.
controller/waterfalls/HomeController.class.inc.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,84 +1,84 @@
 block discarded – undo
1 1
 <?
2 2
 
3 3
 Loader::load('collector', array(
4
-    'comment/CommentCollector',
5
-    'image/PhotoCollector',
6
-    'waterfall/LogCollector',
4
+	'comment/CommentCollector',
5
+	'image/PhotoCollector',
6
+	'waterfall/LogCollector',
7 7
 ));
8 8
 Loader::load('controller', 'waterfalls/DefaultPageController');
9 9
 
10 10
 final class HomeController extends DefaultPageController
11 11
 {
12 12
 
13
-    private static $TITLE = 'Waterfalls of the Keweenaw | Stories and Tips from Jacob Emerick';
14
-    private static $DESCRIPTION = 'Stories, maps, and details about many of the waterfalls in the Upper Peninsula of Michigan, compiled by Jacob Emerick.';
15
-    private static $KEYWORD_ARRAY = array(
16
-        'waterfalls',
17
-        'keweenaw',
18
-        'upper peninsula',
19
-        'jacob emerick',
20
-    );
13
+	private static $TITLE = 'Waterfalls of the Keweenaw | Stories and Tips from Jacob Emerick';
14
+	private static $DESCRIPTION = 'Stories, maps, and details about many of the waterfalls in the Upper Peninsula of Michigan, compiled by Jacob Emerick.';
15
+	private static $KEYWORD_ARRAY = array(
16
+		'waterfalls',
17
+		'keweenaw',
18
+		'upper peninsula',
19
+		'jacob emerick',
20
+	);
21 21
 
22
-    private static $BANNER_IMAGE = 2661;
22
+	private static $BANNER_IMAGE = 2661;
23 23
 
24
-    protected function set_head_data()
25
-    {
26
-        parent::set_head_data();
24
+	protected function set_head_data()
25
+	{
26
+		parent::set_head_data();
27 27
         
28
-        $this->set_title(self::$TITLE);
29
-        $this->set_description(self::$DESCRIPTION);
30
-        $this->set_keywords(self::$KEYWORD_ARRAY);
31
-    }
28
+		$this->set_title(self::$TITLE);
29
+		$this->set_description(self::$DESCRIPTION);
30
+		$this->set_keywords(self::$KEYWORD_ARRAY);
31
+	}
32 32
 
33
-    protected function set_body_data($page_type = 'wide')
34
-    {
35
-        parent::set_body_data($page_type);
33
+	protected function set_body_data($page_type = 'wide')
34
+	{
35
+		parent::set_body_data($page_type);
36 36
         
37
-        $photo = PhotoCollector::getRow(self::$BANNER_IMAGE);
38
-        $photo_obj = (object) array(
39
-            'file'         => "/photo/{$photo->category}/{$photo->name}-size-full.jpg",
40
-            'description'  => $photo->description,
41
-        );
42
-        $this->set_body('photo', $photo_obj);
37
+		$photo = PhotoCollector::getRow(self::$BANNER_IMAGE);
38
+		$photo_obj = (object) array(
39
+			'file'         => "/photo/{$photo->category}/{$photo->name}-size-full.jpg",
40
+			'description'  => $photo->description,
41
+		);
42
+		$this->set_body('photo', $photo_obj);
43 43
         
44
-        $recent_log_container;
45
-        $recent_logs = LogCollector::getRecentList(4);
46
-        foreach ($recent_logs as $log) {
47
-            $recent_log_container[] = (object) array(
48
-                'photo'  => (object) array(
49
-                    'file'         => "/photo/{$log->photo_category}/{$log->photo}-size-thumb.jpg",
50
-                    'description'  => $log->photo_description,
51
-                ),
52
-                'title'  => $log->title,
53
-                'link'   => "/journal/{$log->alias}/",
54
-                'date'   => date('F j, Y', strtotime($log->publish_date)),
55
-            );
56
-        }
57
-        $this->set_body('logs', $recent_log_container);
44
+		$recent_log_container;
45
+		$recent_logs = LogCollector::getRecentList(4);
46
+		foreach ($recent_logs as $log) {
47
+			$recent_log_container[] = (object) array(
48
+				'photo'  => (object) array(
49
+					'file'         => "/photo/{$log->photo_category}/{$log->photo}-size-thumb.jpg",
50
+					'description'  => $log->photo_description,
51
+				),
52
+				'title'  => $log->title,
53
+				'link'   => "/journal/{$log->alias}/",
54
+				'date'   => date('F j, Y', strtotime($log->publish_date)),
55
+			);
56
+		}
57
+		$this->set_body('logs', $recent_log_container);
58 58
         
59
-        $recent_comments = CommentCollector::getRecentWaterfallComments();
59
+		$recent_comments = CommentCollector::getRecentWaterfallComments();
60 60
         
61
-        $recent_comment_container = array();
62
-        foreach($recent_comments as $comment) {
63
-            $body = $comment->body;
64
-            $body = strip_tags($body);
61
+		$recent_comment_container = array();
62
+		foreach($recent_comments as $comment) {
63
+			$body = $comment->body;
64
+			$body = strip_tags($body);
65 65
             
66
-            $comment_obj = new stdclass();
67
-            $comment_obj->description = Content::instance('SmartTrim', $body)->activate(50);
68
-            $comment_obj->commenter = $comment->name;
69
-            if (!empty($comment->log_path)) {
70
-                $comment_obj->link = Loader::getRootURL() . "{$comment->log_path}/#comment-{$comment->id}";
71
-                $comment_obj->location = $comment->log_title;
72
-            } else {
73
-                $comment_obj->link = Loader::getRootURL() . "{$comment->waterfall_path}/#comment-{$comment->id}";
74
-                $comment_obj->location = $comment->waterfall_title;
75
-            }
66
+			$comment_obj = new stdclass();
67
+			$comment_obj->description = Content::instance('SmartTrim', $body)->activate(50);
68
+			$comment_obj->commenter = $comment->name;
69
+			if (!empty($comment->log_path)) {
70
+				$comment_obj->link = Loader::getRootURL() . "{$comment->log_path}/#comment-{$comment->id}";
71
+				$comment_obj->location = $comment->log_title;
72
+			} else {
73
+				$comment_obj->link = Loader::getRootURL() . "{$comment->waterfall_path}/#comment-{$comment->id}";
74
+				$comment_obj->location = $comment->waterfall_title;
75
+			}
76 76
             
77
-            $recent_comment_container[] = $comment_obj;
78
-        }
79
-        $this->set_body('comments', $recent_comment_container);
77
+			$recent_comment_container[] = $comment_obj;
78
+		}
79
+		$this->set_body('comments', $recent_comment_container);
80 80
         
81
-        $this->set_body('view', 'Home');
82
-    }
81
+		$this->set_body('view', 'Home');
82
+	}
83 83
 
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $recent_comments = CommentCollector::getRecentWaterfallComments();
60 60
         
61 61
         $recent_comment_container = array();
62
-        foreach($recent_comments as $comment) {
62
+        foreach ($recent_comments as $comment) {
63 63
             $body = $comment->body;
64 64
             $body = strip_tags($body);
65 65
             
Please login to merge, or discard this patch.
controller/waterfalls/DefaultWaterfallListController.class.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		$county_result = CountyCollector::getCountyList();
42 42
 		$county_list = array();
43 43
 		
44
-		foreach($county_result as $county_row)
44
+		foreach ($county_result as $county_row)
45 45
 		{
46 46
 			$county = new stdclass();
47 47
 			$county->name = $county_row->name;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$watercourse_result = WatercourseCollector::getWatercourseList();
55 55
 		$watercourse_list = array();
56 56
 		
57
-		foreach($watercourse_result as $watercourse_row)
57
+		foreach ($watercourse_result as $watercourse_row)
58 58
 		{
59 59
 			$watercourse = new stdclass();
60 60
 			$watercourse->name = $watercourse_row->name;
Please login to merge, or discard this patch.
controller/waterfalls/ContactController.class.inc.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
 
34 34
 	private function process_form()
35 35
 	{
36
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
36
+		if (!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
37 37
 			return (object) array('display' => 'normal');
38 38
 		
39 39
 		Loader::load('utility', 'Validate');
40 40
 		$error_result = array();
41
-		if(!Validate::checkRequest('post', 'name', 'string'))
41
+		if (!Validate::checkRequest('post', 'name', 'string'))
42 42
 			$error_result['name'] = 'please enter your name';
43
-		if(!Validate::checkRequest('post', 'email', 'string'))
43
+		if (!Validate::checkRequest('post', 'email', 'string'))
44 44
 			$error_result['email'] = 'please enter a valid email';
45
-		if(!Validate::checkRequest('post', 'message', 'string'))
45
+		if (!Validate::checkRequest('post', 'message', 'string'))
46 46
 			$error_result['message'] = 'please write a message';
47 47
 		
48 48
 		$values = (object) array(
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			'email' => Request::getPost('email'),
51 51
 			'message' => Request::getPost('message'));
52 52
 		
53
-		if(count($error_result) > 0)
53
+		if (count($error_result) > 0)
54 54
 		{
55 55
 			return (object) array(
56 56
 				'display' => 'error',
Please login to merge, or discard this 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.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,16 +58,16 @@
 block discarded – undo
58 58
 				'values' => $values);
59 59
 		}
60 60
 
61
-    global $container;
62
-    $sent = $container['mail']
63
-      ->addTo($container['config']->admin_email)
64
-      ->setSubject('Waterfall Site Contact')
65
-      ->setPlainMessage(
66
-        "Name: {$values->name}\n" .
67
-        "Email: {$values->email}\n" .
68
-        "Message: {$values->message}"
69
-      )
70
-      ->send();
61
+	global $container;
62
+	$sent = $container['mail']
63
+	  ->addTo($container['config']->admin_email)
64
+	  ->setSubject('Waterfall Site Contact')
65
+	  ->setPlainMessage(
66
+		"Name: {$values->name}\n" .
67
+		"Email: {$values->email}\n" .
68
+		"Message: {$values->message}"
69
+	  )
70
+	  ->send();
71 71
 
72 72
 		return (object) array('display' => 'success');
73 73
 	}
Please login to merge, or discard this patch.
controller/waterfalls/LogTagListController.class.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 		$alias = URLDecode::getPiece(3);
28 28
 		$this->tag = LogTagCollector::getTag($alias);
29 29
 		
30
-		if(!$this->tag)
30
+		if (!$this->tag)
31 31
 			$this->eject();
32 32
 		
33 33
 		parent::__construct();
Please login to merge, or discard this 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(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
 	}
Please login to merge, or discard this patch.
controller/waterfalls/WatercourseListController.class.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 		$path = URLDecode::getPiece(1);
30 30
 		$this->watercourse = WatercourseCollector::getByAlias($path);
31 31
 		
32
-		if(!$this->watercourse)
32
+		if (!$this->watercourse)
33 33
 			$this->eject();
34 34
 	
35 35
 		parent::__construct();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@
 block discarded – undo
29 29
 		$path = URLDecode::getPiece(1);
30 30
 		$this->watercourse = WatercourseCollector::getByAlias($path);
31 31
 		
32
-		if(!$this->watercourse)
33
-			$this->eject();
32
+		if(!$this->watercourse) {
33
+					$this->eject();
34
+		}
34 35
 	
35 36
 		parent::__construct();
36 37
 	}
Please login to merge, or discard this patch.