@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | { |
68 | 68 | parent::set_head_data(); |
69 | 69 | |
70 | - switch($this->category->display) |
|
70 | + switch ($this->category->display) |
|
71 | 71 | { |
72 | 72 | case 'Hiking' : |
73 | - if($this->page == 1) |
|
73 | + if ($this->page == 1) |
|
74 | 74 | { |
75 | 75 | $this->set_title(self::$TITLE_MAIN_HIKING); |
76 | 76 | $this->set_description(self::$DESCRIPTION_MAIN_HIKING); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->set_keywords(self::$KEYWORD_ARRAY_HIKING); |
84 | 84 | break; |
85 | 85 | case 'Personal' : |
86 | - if($this->page == 1) |
|
86 | + if ($this->page == 1) |
|
87 | 87 | { |
88 | 88 | $this->set_title(self::$TITLE_MAIN_PERSONAL); |
89 | 89 | $this->set_description(self::$DESCRIPTION_MAIN_PERSONAL); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->set_keywords(self::$KEYWORD_ARRAY_PERSONAL); |
97 | 97 | break; |
98 | 98 | case 'Web Development' : |
99 | - if($this->page == 1) |
|
99 | + if ($this->page == 1) |
|
100 | 100 | { |
101 | 101 | $this->set_title(self::$TITLE_MAIN_WEBDEVELOPMENT); |
102 | 102 | $this->set_description(self::$DESCRIPTION_MAIN_WEBDEVELOPMENT); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | protected function get_introduction() |
115 | 115 | { |
116 | - if($this->page == 1) |
|
116 | + if ($this->page == 1) |
|
117 | 117 | { |
118 | 118 | Loader::load('collector', 'blog/IntroductionCollector'); |
119 | 119 | $introduction_result = IntroductionCollector::getRow('category', $this->category->link); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | protected function get_page_number() |
134 | 134 | { |
135 | 135 | $page = URLDecode::getPiece(2); |
136 | - if(isset($page) && is_numeric($page)) |
|
136 | + if (isset($page) && is_numeric($page)) |
|
137 | 137 | return $page; |
138 | 138 | return 1; |
139 | 139 | } |
@@ -153,16 +153,16 @@ discard block |
||
153 | 153 | |
154 | 154 | protected function get_list_next_link() |
155 | 155 | { |
156 | - if($this->page == 1) |
|
156 | + if ($this->page == 1) |
|
157 | 157 | return; |
158 | - if($this->page == 2) |
|
158 | + if ($this->page == 2) |
|
159 | 159 | return Content::instance('URLSafe', "/{$this->category->link}/")->activate(); |
160 | 160 | return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page - 1) . '/')->activate(); |
161 | 161 | } |
162 | 162 | |
163 | 163 | protected function get_list_prev_link() |
164 | 164 | { |
165 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
165 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
166 | 166 | return; |
167 | 167 | return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page + 1) . '/')->activate(); |
168 | 168 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | private $total_post_count; |
171 | 171 | protected function get_total_post_count() |
172 | 172 | { |
173 | - if(!isset($this->total_post_count)) |
|
173 | + if (!isset($this->total_post_count)) |
|
174 | 174 | $this->total_post_count = PostCollector::getPostCountForCategory($this->category->link); |
175 | 175 | return $this->total_post_count; |
176 | 176 | } |
@@ -74,8 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $this->set_title(self::$TITLE_MAIN_HIKING); |
76 | 76 | $this->set_description(self::$DESCRIPTION_MAIN_HIKING); |
77 | - } |
|
78 | - else |
|
77 | + } else |
|
79 | 78 | { |
80 | 79 | $this->set_title(sprintf(self::$TITLE_PAGINATED_HIKING, $this->page, $this->total_pages)); |
81 | 80 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED_HIKING, $this->page, $this->total_pages)); |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | { |
88 | 87 | $this->set_title(self::$TITLE_MAIN_PERSONAL); |
89 | 88 | $this->set_description(self::$DESCRIPTION_MAIN_PERSONAL); |
90 | - } |
|
91 | - else |
|
89 | + } else |
|
92 | 90 | { |
93 | 91 | $this->set_title(sprintf(self::$TITLE_PAGINATED_PERSONAL, $this->page, $this->total_pages)); |
94 | 92 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED_PERSONAL, $this->page, $this->total_pages)); |
@@ -100,8 +98,7 @@ discard block |
||
100 | 98 | { |
101 | 99 | $this->set_title(self::$TITLE_MAIN_WEBDEVELOPMENT); |
102 | 100 | $this->set_description(self::$DESCRIPTION_MAIN_WEBDEVELOPMENT); |
103 | - } |
|
104 | - else |
|
101 | + } else |
|
105 | 102 | { |
106 | 103 | $this->set_title(sprintf(self::$TITLE_PAGINATED_WEBDEVELOPMENT, $this->page, $this->total_pages)); |
107 | 104 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED_WEBDEVELOPMENT, $this->page, $this->total_pages)); |
@@ -133,8 +130,9 @@ discard block |
||
133 | 130 | protected function get_page_number() |
134 | 131 | { |
135 | 132 | $page = URLDecode::getPiece(2); |
136 | - if(isset($page) && is_numeric($page)) |
|
137 | - return $page; |
|
133 | + if(isset($page) && is_numeric($page)) { |
|
134 | + return $page; |
|
135 | + } |
|
138 | 136 | return 1; |
139 | 137 | } |
140 | 138 | |
@@ -153,25 +151,29 @@ discard block |
||
153 | 151 | |
154 | 152 | protected function get_list_next_link() |
155 | 153 | { |
156 | - if($this->page == 1) |
|
157 | - return; |
|
158 | - if($this->page == 2) |
|
159 | - return Content::instance('URLSafe', "/{$this->category->link}/")->activate(); |
|
154 | + if($this->page == 1) { |
|
155 | + return; |
|
156 | + } |
|
157 | + if($this->page == 2) { |
|
158 | + return Content::instance('URLSafe', "/{$this->category->link}/")->activate(); |
|
159 | + } |
|
160 | 160 | return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page - 1) . '/')->activate(); |
161 | 161 | } |
162 | 162 | |
163 | 163 | protected function get_list_prev_link() |
164 | 164 | { |
165 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
166 | - return; |
|
165 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) { |
|
166 | + return; |
|
167 | + } |
|
167 | 168 | return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page + 1) . '/')->activate(); |
168 | 169 | } |
169 | 170 | |
170 | 171 | private $total_post_count; |
171 | 172 | protected function get_total_post_count() |
172 | 173 | { |
173 | - if(!isset($this->total_post_count)) |
|
174 | - $this->total_post_count = PostCollector::getPostCountForCategory($this->category->link); |
|
174 | + if(!isset($this->total_post_count)) { |
|
175 | + $this->total_post_count = PostCollector::getPostCountForCategory($this->category->link); |
|
176 | + } |
|
175 | 177 | return $this->total_post_count; |
176 | 178 | } |
177 | 179 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $tag = str_replace('-', ' ', $tag); |
29 | 29 | |
30 | 30 | $tag_result = TagCollector::getSingleTag($tag); |
31 | - if($tag_result === false) |
|
31 | + if ($tag_result === false) |
|
32 | 32 | $this->eject(); |
33 | 33 | |
34 | 34 | $this->tag = $tag_result; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | parent::set_head_data(); |
42 | 42 | |
43 | - if($this->page == 1) |
|
43 | + if ($this->page == 1) |
|
44 | 44 | { |
45 | 45 | $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag))); |
46 | 46 | $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag))); |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | { |
61 | 61 | $tag = ucwords($this->tag->tag); |
62 | 62 | |
63 | - if($this->page == 1) |
|
63 | + if ($this->page == 1) |
|
64 | 64 | { |
65 | 65 | Loader::load('collector', 'blog/IntroductionCollector'); |
66 | 66 | $introduction_result = IntroductionCollector::getRow('tag', $this->tag->tag); |
67 | 67 | |
68 | - if($introduction_result !== null) |
|
68 | + if ($introduction_result !== null) |
|
69 | 69 | { |
70 | 70 | $introduction = array(); |
71 | 71 | $introduction['title'] = $introduction_result->title; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | protected function get_page_number() |
87 | 87 | { |
88 | 88 | $page = URLDecode::getPiece(3); |
89 | - if(isset($page) && is_numeric($page)) |
|
89 | + if (isset($page) && is_numeric($page)) |
|
90 | 90 | return $page; |
91 | 91 | return 1; |
92 | 92 | } |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | |
107 | 107 | protected function get_list_next_link() |
108 | 108 | { |
109 | - if($this->page == 1) |
|
109 | + if ($this->page == 1) |
|
110 | 110 | return; |
111 | - if($this->page == 2) |
|
111 | + if ($this->page == 2) |
|
112 | 112 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate(); |
113 | 113 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate(); |
114 | 114 | } |
115 | 115 | |
116 | 116 | protected function get_list_prev_link() |
117 | 117 | { |
118 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
118 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
119 | 119 | return; |
120 | 120 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate(); |
121 | 121 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | private $total_post_count; |
124 | 124 | protected function get_total_post_count() |
125 | 125 | { |
126 | - if(!isset($this->total_post_count)) |
|
126 | + if (!isset($this->total_post_count)) |
|
127 | 127 | $this->total_post_count = PostCollector::getPostCountForTag($this->tag->id); |
128 | 128 | return $this->total_post_count; |
129 | 129 | } |
@@ -28,8 +28,9 @@ discard block |
||
28 | 28 | $tag = str_replace('-', ' ', $tag); |
29 | 29 | |
30 | 30 | $tag_result = TagCollector::getSingleTag($tag); |
31 | - if($tag_result === false) |
|
32 | - $this->eject(); |
|
31 | + if($tag_result === false) { |
|
32 | + $this->eject(); |
|
33 | + } |
|
33 | 34 | |
34 | 35 | $this->tag = $tag_result; |
35 | 36 | |
@@ -44,8 +45,7 @@ discard block |
||
44 | 45 | { |
45 | 46 | $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag))); |
46 | 47 | $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag))); |
47 | - } |
|
48 | - else |
|
48 | + } else |
|
49 | 49 | { |
50 | 50 | $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->tag->tag), $this->page, $this->total_pages)); |
51 | 51 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->tag->tag))); |
@@ -86,8 +86,9 @@ discard block |
||
86 | 86 | protected function get_page_number() |
87 | 87 | { |
88 | 88 | $page = URLDecode::getPiece(3); |
89 | - if(isset($page) && is_numeric($page)) |
|
90 | - return $page; |
|
89 | + if(isset($page) && is_numeric($page)) { |
|
90 | + return $page; |
|
91 | + } |
|
91 | 92 | return 1; |
92 | 93 | } |
93 | 94 | |
@@ -106,25 +107,29 @@ discard block |
||
106 | 107 | |
107 | 108 | protected function get_list_next_link() |
108 | 109 | { |
109 | - if($this->page == 1) |
|
110 | - return; |
|
111 | - if($this->page == 2) |
|
112 | - return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate(); |
|
110 | + if($this->page == 1) { |
|
111 | + return; |
|
112 | + } |
|
113 | + if($this->page == 2) { |
|
114 | + return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate(); |
|
115 | + } |
|
113 | 116 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate(); |
114 | 117 | } |
115 | 118 | |
116 | 119 | protected function get_list_prev_link() |
117 | 120 | { |
118 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
119 | - return; |
|
121 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) { |
|
122 | + return; |
|
123 | + } |
|
120 | 124 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate(); |
121 | 125 | } |
122 | 126 | |
123 | 127 | private $total_post_count; |
124 | 128 | protected function get_total_post_count() |
125 | 129 | { |
126 | - if(!isset($this->total_post_count)) |
|
127 | - $this->total_post_count = PostCollector::getPostCountForTag($this->tag->id); |
|
130 | + if(!isset($this->total_post_count)) { |
|
131 | + $this->total_post_count = PostCollector::getPostCountForTag($this->tag->id); |
|
132 | + } |
|
128 | 133 | return $this->total_post_count; |
129 | 134 | } |
130 | 135 |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::set_head_data(); |
34 | 34 | |
35 | - if($this->page == 1) |
|
35 | + if ($this->page == 1) |
|
36 | 36 | $this->set_title(self::$TITLE_MAIN); |
37 | 37 | else |
38 | 38 | $this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages)); |
39 | 39 | |
40 | - if($this->page == 1) |
|
40 | + if ($this->page == 1) |
|
41 | 41 | $this->set_description(self::$DESCRIPTION_MAIN); |
42 | 42 | else |
43 | 43 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages)); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function get_introduction() |
49 | 49 | { |
50 | - if($this->page == 1) |
|
50 | + if ($this->page == 1) |
|
51 | 51 | { |
52 | 52 | Loader::load('collector', 'blog/IntroductionCollector'); |
53 | 53 | $introduction_result = IntroductionCollector::getRow('home'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | protected function get_page_number() |
68 | 68 | { |
69 | 69 | $page = URLDecode::getPiece(1); |
70 | - if(isset($page) && is_numeric($page)) |
|
70 | + if (isset($page) && is_numeric($page)) |
|
71 | 71 | return $page; |
72 | 72 | return 1; |
73 | 73 | } |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | |
88 | 88 | protected function get_list_next_link() |
89 | 89 | { |
90 | - if($this->page == 1) |
|
90 | + if ($this->page == 1) |
|
91 | 91 | return; |
92 | - if($this->page == 2) |
|
92 | + if ($this->page == 2) |
|
93 | 93 | return '/'; |
94 | 94 | return '/' . ($this->page - 1) . '/'; |
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function get_list_prev_link() |
98 | 98 | { |
99 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
99 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
100 | 100 | return; |
101 | 101 | return '/' . ($this->page + 1) . '/'; |
102 | 102 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | private $total_post_count; |
105 | 105 | protected function get_total_post_count() |
106 | 106 | { |
107 | - if(!isset($this->total_post_count)) |
|
107 | + if (!isset($this->total_post_count)) |
|
108 | 108 | $this->total_post_count = PostCollector::getMainPostCount(); |
109 | 109 | return $this->total_post_count; |
110 | 110 | } |
@@ -32,15 +32,17 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::set_head_data(); |
34 | 34 | |
35 | - if($this->page == 1) |
|
36 | - $this->set_title(self::$TITLE_MAIN); |
|
37 | - else |
|
38 | - $this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages)); |
|
35 | + if($this->page == 1) { |
|
36 | + $this->set_title(self::$TITLE_MAIN); |
|
37 | + } else { |
|
38 | + $this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages)); |
|
39 | + } |
|
39 | 40 | |
40 | - if($this->page == 1) |
|
41 | - $this->set_description(self::$DESCRIPTION_MAIN); |
|
42 | - else |
|
43 | - $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages)); |
|
41 | + if($this->page == 1) { |
|
42 | + $this->set_description(self::$DESCRIPTION_MAIN); |
|
43 | + } else { |
|
44 | + $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages)); |
|
45 | + } |
|
44 | 46 | |
45 | 47 | $this->set_keywords(self::$KEYWORD_ARRAY); |
46 | 48 | } |
@@ -67,8 +69,9 @@ discard block |
||
67 | 69 | protected function get_page_number() |
68 | 70 | { |
69 | 71 | $page = URLDecode::getPiece(1); |
70 | - if(isset($page) && is_numeric($page)) |
|
71 | - return $page; |
|
72 | + if(isset($page) && is_numeric($page)) { |
|
73 | + return $page; |
|
74 | + } |
|
72 | 75 | return 1; |
73 | 76 | } |
74 | 77 | |
@@ -87,25 +90,29 @@ discard block |
||
87 | 90 | |
88 | 91 | protected function get_list_next_link() |
89 | 92 | { |
90 | - if($this->page == 1) |
|
91 | - return; |
|
92 | - if($this->page == 2) |
|
93 | - return '/'; |
|
93 | + if($this->page == 1) { |
|
94 | + return; |
|
95 | + } |
|
96 | + if($this->page == 2) { |
|
97 | + return '/'; |
|
98 | + } |
|
94 | 99 | return '/' . ($this->page - 1) . '/'; |
95 | 100 | } |
96 | 101 | |
97 | 102 | protected function get_list_prev_link() |
98 | 103 | { |
99 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
100 | - return; |
|
104 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) { |
|
105 | + return; |
|
106 | + } |
|
101 | 107 | return '/' . ($this->page + 1) . '/'; |
102 | 108 | } |
103 | 109 | |
104 | 110 | private $total_post_count; |
105 | 111 | protected function get_total_post_count() |
106 | 112 | { |
107 | - if(!isset($this->total_post_count)) |
|
108 | - $this->total_post_count = PostCollector::getMainPostCount(); |
|
113 | + if(!isset($this->total_post_count)) { |
|
114 | + $this->total_post_count = PostCollector::getMainPostCount(); |
|
115 | + } |
|
109 | 116 | return $this->total_post_count; |
110 | 117 | } |
111 | 118 |
@@ -56,11 +56,11 @@ |
||
56 | 56 | final private function get_list_posts() |
57 | 57 | { |
58 | 58 | $post_array = array(); |
59 | - foreach($this->get_list_results() as $post) |
|
59 | + foreach ($this->get_list_results() as $post) |
|
60 | 60 | { |
61 | 61 | $post_array[] = $this->format_post($post, true); |
62 | 62 | } |
63 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | + if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
64 | 64 | $this->eject(); |
65 | 65 | return $post_array; |
66 | 66 | } |
@@ -60,8 +60,9 @@ |
||
60 | 60 | { |
61 | 61 | $post_array[] = $this->format_post($post, true); |
62 | 62 | } |
63 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
64 | - $this->eject(); |
|
63 | + if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') { |
|
64 | + $this->eject(); |
|
65 | + } |
|
65 | 66 | return $post_array; |
66 | 67 | } |
67 | 68 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $active_page = $this->get_active_page(); |
42 | 42 | |
43 | 43 | $menu = array(); |
44 | - foreach(self::$MENU as $item) |
|
44 | + foreach (self::$MENU as $item) |
|
45 | 45 | { |
46 | 46 | $menu[] = (object) array( |
47 | 47 | 'name' => $item['name'], |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | { |
57 | 57 | $current_uri = URLDecode::getPiece(1); |
58 | 58 | |
59 | - if(!isset($current_uri)) |
|
59 | + if (!isset($current_uri)) |
|
60 | 60 | return 'About'; |
61 | 61 | |
62 | 62 | $menu = self::$MENU; |
63 | - foreach($menu as $link) |
|
63 | + foreach ($menu as $link) |
|
64 | 64 | { |
65 | - if($link['uri'] == $current_uri) |
|
65 | + if ($link['uri'] == $current_uri) |
|
66 | 66 | return $link['name']; |
67 | 67 | } |
68 | 68 |
@@ -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'; |
@@ -29,17 +29,17 @@ |
||
29 | 29 | |
30 | 30 | private function get_form_results() |
31 | 31 | { |
32 | - if(!Request::hasPost()) |
|
32 | + if (!Request::hasPost()) |
|
33 | 33 | return array(); |
34 | 34 | |
35 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
35 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
36 | 36 | $error_message['name'] = 'Please enter a value for your name.'; |
37 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
37 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
38 | 38 | $error_message['email'] = 'Please enter a valid email address.'; |
39 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
39 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
40 | 40 | $error_message['message'] = 'Please enter a message.'; |
41 | 41 | |
42 | - if(!empty($error_message)) |
|
42 | + if (!empty($error_message)) |
|
43 | 43 | { |
44 | 44 | return array( |
45 | 45 | 'error_message' => $error_message, |
@@ -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 | { |
@@ -12,7 +12,7 @@ |
||
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}>"; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | Loader::load('collector', 'data/ChangelogCollector'); |
30 | 30 | $changelog_result = ChangelogCollector::getLast20Changes(); |
31 | 31 | |
32 | - foreach($changelog_result as $change) |
|
32 | + foreach ($changelog_result as $change) |
|
33 | 33 | { |
34 | 34 | $changelog[] = (object) array( |
35 | 35 | 'date' => (object) array( |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | 'name' => 'Contact', |
40 | 40 | 'link' => Loader::getRootURL() . 'contact/')); |
41 | 41 | |
42 | - if(!URLDecode::getPiece(1)) |
|
42 | + if (!URLDecode::getPiece(1)) |
|
43 | 43 | $active_page = 'About'; |
44 | 44 | else |
45 | 45 | $active_page = ucfirst(URLDecode::getPiece(1)); |
46 | 46 | |
47 | - foreach($menu as $menu_item) |
|
47 | + foreach ($menu as $menu_item) |
|
48 | 48 | { |
49 | 49 | $menu_item = (object) $menu_item; |
50 | 50 | $menu_item->active = ($menu_item->name == $active_page); |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | Loader::load('collector', 'portfolio/PortfolioCollector'); |
60 | 60 | $portfolio_result = PortfolioCollector::getPiecesForCategory($category_id); |
61 | 61 | |
62 | - foreach($portfolio_result as $piece) |
|
62 | + foreach ($portfolio_result as $piece) |
|
63 | 63 | { |
64 | 64 | $piece_obj = new stdclass(); |
65 | 65 | $piece_obj->title = $piece->title; |
66 | - if("{$piece->category}" == 1) |
|
66 | + if ("{$piece->category}" == 1) |
|
67 | 67 | $piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/"; |
68 | 68 | else |
69 | 69 | $piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/"; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $piece_array[] = $piece_obj; |
72 | 72 | } |
73 | 73 | |
74 | - switch($category_id) |
|
74 | + switch ($category_id) |
|
75 | 75 | { |
76 | 76 | case 1 : |
77 | 77 | $title = "Sites I've worked on"; |
@@ -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 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | else |
49 | 49 | { |
50 | - global $config; |
|
50 | + global $config; |
|
51 | 51 | $mail = new Mail(); |
52 | 52 | $mail->setToAddress($config->admin_email, 'Jacob Emerick'); |
53 | 53 | $mail->setSubject('Portfolio Contact'); |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | |
29 | 29 | private function process_form_data() |
30 | 30 | { |
31 | - if(!Request::hasPost()) |
|
31 | + if (!Request::hasPost()) |
|
32 | 32 | return array(); |
33 | 33 | |
34 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
34 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
35 | 35 | $error_message['name'] = 'Please enter a value for your name.'; |
36 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
36 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
37 | 37 | $error_message['email'] = 'Please enter a valid email address.'; |
38 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
38 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
39 | 39 | $error_message['message'] = 'Please enter a message.'; |
40 | 40 | |
41 | - if(!empty($error_message)) |
|
41 | + if (!empty($error_message)) |
|
42 | 42 | { |
43 | 43 | return array( |
44 | 44 | 'error_message' => $error_message, |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $mail->send(); |
59 | 59 | |
60 | 60 | return array( |
61 | - 'success_message' => "Thank you for your message, ".Request::getPost('name')."! I'll get back to you as soon as possible."); |
|
61 | + 'success_message' => "Thank you for your message, " . Request::getPost('name') . "! I'll get back to you as soon as possible."); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 |
@@ -28,24 +28,26 @@ |
||
28 | 28 | |
29 | 29 | private function process_form_data() |
30 | 30 | { |
31 | - if(!Request::hasPost()) |
|
32 | - return array(); |
|
31 | + if(!Request::hasPost()) { |
|
32 | + return array(); |
|
33 | + } |
|
33 | 34 | |
34 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
35 | - $error_message['name'] = 'Please enter a value for your name.'; |
|
36 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
37 | - $error_message['email'] = 'Please enter a valid email address.'; |
|
38 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
39 | - $error_message['message'] = 'Please enter a message.'; |
|
35 | + if(!Validate::checkRequest('post', 'name', 'string')) { |
|
36 | + $error_message['name'] = 'Please enter a value for your name.'; |
|
37 | + } |
|
38 | + if(!Validate::checkRequest('post', 'email', 'string')) { |
|
39 | + $error_message['email'] = 'Please enter a valid email address.'; |
|
40 | + } |
|
41 | + if(!Validate::checkRequest('post', 'message', 'string')) { |
|
42 | + $error_message['message'] = 'Please enter a message.'; |
|
43 | + } |
|
40 | 44 | |
41 | 45 | if(!empty($error_message)) |
42 | 46 | { |
43 | 47 | return array( |
44 | 48 | 'error_message' => $error_message, |
45 | 49 | 'value' => Request::getPost()); |
46 | - } |
|
47 | - |
|
48 | - else |
|
50 | + } else |
|
49 | 51 | { |
50 | 52 | global $config; |
51 | 53 | $mail = new Mail(); |