@@ -39,10 +39,11 @@ discard block |
||
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 |
||
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 | } |
@@ -36,8 +36,9 @@ |
||
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}"); |
@@ -29,15 +29,19 @@ |
||
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 | { |
@@ -56,14 +56,16 @@ |
||
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'; |
@@ -18,10 +18,11 @@ |
||
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 |
@@ -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 | } |
@@ -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'), |
@@ -28,8 +28,9 @@ |
||
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 | } |
@@ -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; |