Completed
Pull Request — master (#1)
by Jacob
15:50
created
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   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 	public function __construct()
14 14
 	{
15
-        global $config;
15
+		global $config;
16 16
 		$this->headers['From'] = self::$FROM;
17 17
 		$this->headers['Reply-To'] = "Jacob <{$config->admin_email}>";
18 18
 		$this->headers['Bcc'] = "Jacob <{$config->admin_email}>";
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.
controller/waterfalls/DefaultListController.class.inc.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	abstract protected function get_initial_meta();
96 96
 	abstract protected function get_subsequent_meta();
97 97
 
98
-    final protected function set_body_data($page_type = 'normal')
99
-    {
100
-        parent::set_body_data($page_type);
98
+	final protected function set_body_data($page_type = 'normal')
99
+	{
100
+		parent::set_body_data($page_type);
101 101
 		
102 102
 		$this->set_body('view', $this->get_list_view());
103 103
 		$this->set_body('data', $this->get_list_body_data());
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$body_data_array = array();
109 109
 		
110
-        $body_data_array['introduction'] = $this->get_introduction();
110
+		$body_data_array['introduction'] = $this->get_introduction();
111 111
 		$body_data_array['items'] = array_map(array($this, 'format_item'), $this->get_items());
112 112
 		$body_data_array['navigation'] = array(
113 113
 				'description' => $this->get_list_description(),
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  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)
23
+		if (count($items) < 1)
24 24
 			$this->eject();
25 25
 	}
26 26
 
27 27
 	final protected function get_page_number()
28 28
 	{
29 29
 		$page = $this->get_page_number_piece();
30
-		if(isset($page) && is_numeric($page))
30
+		if (isset($page) && is_numeric($page))
31 31
 			return $page;
32 32
 		return 1;
33 33
 	}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 	final private function get_introduction()
43 43
 	{
44
-		if($this->page == 1)
44
+		if ($this->page == 1)
45 45
 			return $this->get_initial_introduction();
46 46
 		
47 47
 		return $this->get_subsequent_introduction();
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	private $items;
54 54
 	protected function get_items()
55 55
 	{
56
-		if(!isset($this->items))
56
+		if (!isset($this->items))
57 57
 		{
58 58
 			$total = $this->get_item_count_per_page();
59 59
 			$offset = ($this->page - 1) * $this->get_item_count_per_page();
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	private $item_count;
69 69
 	final private function get_item_count()
70 70
 	{
71
-		if(!isset($this->item_count))
71
+		if (!isset($this->item_count))
72 72
 			$this->item_count = $this->get_item_count_result();
73 73
 		return $this->item_count;
74 74
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		$this->set_head('next_link', $this->get_list_next_link());
83 83
 		$this->set_head('previous_link', $this->get_list_prev_link());
84 84
 		
85
-		if($this->page == 1)
85
+		if ($this->page == 1)
86 86
 			$meta_array = $this->get_initial_meta();
87 87
 		else
88 88
 			$meta_array = $this->get_subsequent_meta();
@@ -119,16 +119,16 @@  discard block
 block discarded – undo
119 119
 
120 120
 	final private function get_list_prev_link()
121 121
 	{
122
-		if($this->page == 1)
122
+		if ($this->page == 1)
123 123
 			return;
124
-		if($this->page == 2)
124
+		if ($this->page == 2)
125 125
 			return $this->get_list_link_root();
126 126
 		return $this->get_list_link_root() . ($this->page - 1) . '/';
127 127
 	}
128 128
 
129 129
 	final private function get_list_next_link()
130 130
 	{
131
-		if(($this->page * $this->get_item_count_per_page()) >= $this->get_item_count())
131
+		if (($this->page * $this->get_item_count_per_page()) >= $this->get_item_count())
132 132
 			return;
133 133
 		return $this->get_list_link_root() . ($this->page + 1) . '/';
134 134
 	}
@@ -139,27 +139,27 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$link_array = array();
141 141
 		
142
-		if($this->get_item_count_per_page() >= $this->get_item_count())
142
+		if ($this->get_item_count_per_page() >= $this->get_item_count())
143 143
 			return $link_array;
144 144
 		
145 145
 		$link = new stdclass();
146 146
 		$link->anchor = '&laquo; previous';
147
-		if($this->get_list_prev_link() !== null)
147
+		if ($this->get_list_prev_link() !== null)
148 148
 			$link->uri = $this->get_list_prev_link();
149 149
 		else
150 150
 			$link->class = 'inactive';
151 151
 		$link_array[] = $link;
152 152
 		
153
-		for($i = 1; $i <= ceil($this->get_item_count() / $this->get_item_count_per_page()); $i++)
153
+		for ($i = 1; $i <= ceil($this->get_item_count() / $this->get_item_count_per_page()); $i++)
154 154
 		{
155 155
 			$link = new stdclass();
156 156
 			$link->anchor = $i;
157 157
 			
158
-			if($i == $this->page)
158
+			if ($i == $this->page)
159 159
 				$link->class = 'current';
160 160
 			else
161 161
 			{
162
-				if($i == 1)
162
+				if ($i == 1)
163 163
 					$link->uri = $this->get_list_link_root();
164 164
 				else
165 165
 					$link->uri = $this->get_list_link_root() . $i . '/';
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		
171 171
 		$link = new stdclass();
172 172
 		$link->anchor = 'next &raquo;';
173
-		if($this->get_list_next_link() !== null)
173
+		if ($this->get_list_next_link() !== null)
174 174
 			$link->uri = $this->get_list_next_link();
175 175
 		else
176 176
 			$link->class = 'inactive';
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 	final protected function get_image_element($category, $path, $description, $size = 'small')
194 194
 	{
195
-		switch($size)
195
+		switch ($size)
196 196
 		{
197 197
 			case 'medium' :
198 198
 				$height = 375;
Please login to merge, or discard this 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.