@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | $log_path = URLDecode::getPiece(2); |
26 | 26 | |
27 | 27 | $this->log = LogCollector::getByAlias($log_path); |
28 | - if(!$this->log) |
|
29 | - $this->eject(); |
|
28 | + if(!$this->log) { |
|
29 | + $this->eject(); |
|
30 | + } |
|
30 | 31 | |
31 | 32 | $this->parent_navigation_item = 'journal'; |
32 | 33 | |
@@ -182,8 +183,9 @@ discard block |
||
182 | 183 | { |
183 | 184 | $album = array(); |
184 | 185 | |
185 | - if($this->log->album == 0) |
|
186 | - return $album; |
|
186 | + if($this->log->album == 0) { |
|
187 | + return $album; |
|
188 | + } |
|
187 | 189 | |
188 | 190 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->log->album); |
189 | 191 | foreach($photo_list as $photo) |
@@ -192,10 +194,11 @@ discard block |
||
192 | 194 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
193 | 195 | $photo_array['description'] = $photo->description; |
194 | 196 | |
195 | - if($photo->height < $photo->width) |
|
196 | - list($height, $width) = array(75, 100); |
|
197 | - else |
|
198 | - list($height, $width) = array(100, 75); |
|
197 | + if($photo->height < $photo->width) { |
|
198 | + list($height, $width) = array(75, 100); |
|
199 | + } else { |
|
200 | + list($height, $width) = array(100, 75); |
|
201 | + } |
|
199 | 202 | |
200 | 203 | if ($photo->description == '') { |
201 | 204 | Debugger::logMessage("No description for {$photo->category}/{$photo->name}"); |
@@ -26,8 +26,9 @@ |
||
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 | } |
@@ -27,8 +27,9 @@ |
||
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 |
@@ -33,17 +33,21 @@ |
||
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'), |
@@ -27,8 +27,9 @@ |
||
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 | } |
@@ -29,8 +29,9 @@ |
||
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 | } |
@@ -20,15 +20,17 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 = '« 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 |
||
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 |
||
170 | 181 | |
171 | 182 | $link = new stdclass(); |
172 | 183 | $link->anchor = 'next »'; |
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; |
@@ -27,8 +27,9 @@ |
||
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 | } |
@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | final protected function setLink($url = null) |
27 | 27 | { |
28 | - if(!isset($url)) |
|
29 | - $url = URLDecode::getBase(); |
|
28 | + if(!isset($url)) { |
|
29 | + $url = URLDecode::getBase(); |
|
30 | + } |
|
30 | 31 | $this->xml->channel->addChild('link', $url); |
31 | 32 | } |
32 | 33 | |
@@ -50,8 +51,9 @@ discard block |
||
50 | 51 | |
51 | 52 | final protected function setCopyright($copyright = null) |
52 | 53 | { |
53 | - if(!isset($copyright)) |
|
54 | - $copyright = 'Copyright ' . date('Y') . ' Jacob Emerick'; |
|
54 | + if(!isset($copyright)) { |
|
55 | + $copyright = 'Copyright ' . date('Y') . ' Jacob Emerick'; |
|
56 | + } |
|
55 | 57 | $this->xml->channel->addChild('copyright', $copyright); |
56 | 58 | } |
57 | 59 | |
@@ -66,8 +68,9 @@ discard block |
||
66 | 68 | |
67 | 69 | final protected function setPubDate($date = null) |
68 | 70 | { |
69 | - if(!isset($date)) |
|
70 | - $date = date('r'); |
|
71 | + if(!isset($date)) { |
|
72 | + $date = date('r'); |
|
73 | + } |
|
71 | 74 | $this->xml->channel->addChild('pubDate', $date); |
72 | 75 | } |
73 | 76 |