@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | 'waterfall/LogCollector')); |
8 | 8 | Loader::load('controller', 'waterfalls/DefaultPageController'); |
9 | 9 | |
10 | -final class WaterfallController extends DefaultPageController |
|
11 | -{ |
|
10 | +final class WaterfallController extends DefaultPageController |
|
11 | +{ |
|
12 | 12 | |
13 | 13 | private static $STANDARD_IMAGE_NODE = '<img src="/photo/%s/%s-size-standard.jpg" alt="%s" height="600" width="800" />'; |
14 | 14 | |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | private $waterfall; |
20 | 20 | |
21 | - public function __construct() |
|
22 | - { |
|
21 | + public function __construct() { |
|
23 | 22 | parent::__construct(); |
24 | 23 | |
25 | 24 | $path_watercourse = URLDecode::getPiece(1); |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | $this->add_waterfall_js(); |
40 | 39 | } |
41 | 40 | |
42 | - protected function set_head_data() |
|
43 | - { |
|
41 | + protected function set_head_data() { |
|
44 | 42 | parent::set_head_data(); |
45 | 43 | |
46 | 44 | $this->set_title("{$this->waterfall->name} on {$this->waterfall->watercourse} | " . self::$WEBSITE_TITLE); |
@@ -48,8 +46,7 @@ discard block |
||
48 | 46 | $this->set_keywords((array) $this->waterfall->name); |
49 | 47 | } |
50 | 48 | |
51 | - protected function set_body_data($page_type = 'normal') |
|
52 | - { |
|
49 | + protected function set_body_data($page_type = 'normal') { |
|
53 | 50 | parent::set_body_data($page_type); |
54 | 51 | |
55 | 52 | $body_data = $this->format_waterfall_data($this->waterfall); |
@@ -60,8 +57,7 @@ discard block |
||
60 | 57 | $this->set_body('view', 'Fall'); |
61 | 58 | } |
62 | 59 | |
63 | - private function format_waterfall_data($waterfall) |
|
64 | - { |
|
60 | + private function format_waterfall_data($waterfall) { |
|
65 | 61 | $waterfall_data = array(); |
66 | 62 | $waterfall_data['introduction'] = $this->get_waterfall_introduction($waterfall); |
67 | 63 | $waterfall_data['name'] = $waterfall->name; |
@@ -77,8 +73,7 @@ discard block |
||
77 | 73 | return $waterfall_data; |
78 | 74 | } |
79 | 75 | |
80 | - private function get_waterfall_introduction($waterfall) |
|
81 | - { |
|
76 | + private function get_waterfall_introduction($waterfall) { |
|
82 | 77 | return array( |
83 | 78 | 'path' => "/{$waterfall->watercourse_alias}/{$waterfall->alias}/", |
84 | 79 | 'name' => $waterfall->name, |
@@ -87,8 +82,7 @@ discard block |
||
87 | 82 | ); |
88 | 83 | } |
89 | 84 | |
90 | - private function get_main_watercourse($alias) |
|
91 | - { |
|
85 | + private function get_main_watercourse($alias) { |
|
92 | 86 | $watercourse = WatercourseCollector::getByAlias($alias); |
93 | 87 | if ($watercourse->parent != 0) { |
94 | 88 | $watercourse = WatercourseCollector::getById($watercourse->parent); |
@@ -101,19 +95,18 @@ discard block |
||
101 | 95 | ); |
102 | 96 | } |
103 | 97 | |
104 | - private function format_waterfall_content($content) |
|
105 | - { |
|
98 | + private function format_waterfall_content($content) { |
|
106 | 99 | $content = Content::instance('FixInternalLink', $content)->activate(); |
107 | 100 | |
108 | 101 | return $content; |
109 | 102 | } |
110 | 103 | |
111 | - private function get_album() |
|
112 | - { |
|
104 | + private function get_album() { |
|
113 | 105 | $album = array(); |
114 | 106 | |
115 | - if($this->waterfall->album == 0) |
|
116 | - return $album; |
|
107 | + if($this->waterfall->album == 0) { |
|
108 | + return $album; |
|
109 | + } |
|
117 | 110 | |
118 | 111 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
119 | 112 | foreach($photo_list as $photo) |
@@ -122,10 +115,11 @@ discard block |
||
122 | 115 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
123 | 116 | $photo_array['description'] = $photo->description; |
124 | 117 | |
125 | - if($photo->height < $photo->width) |
|
126 | - list($height, $width) = array(75, 100); |
|
127 | - else |
|
128 | - list($height, $width) = array(100, 75); |
|
118 | + if($photo->height < $photo->width) { |
|
119 | + list($height, $width) = array(75, 100); |
|
120 | + } else { |
|
121 | + list($height, $width) = array(100, 75); |
|
122 | + } |
|
129 | 123 | |
130 | 124 | $photo_array['image_node'] = sprintf( |
131 | 125 | self::$THUMB_IMAGE_NODE, |
@@ -141,8 +135,7 @@ discard block |
||
141 | 135 | return $album; |
142 | 136 | } |
143 | 137 | |
144 | - private function get_sidebar($waterfall) |
|
145 | - { |
|
138 | + private function get_sidebar($waterfall) { |
|
146 | 139 | $sidebar_data = array(); |
147 | 140 | $sidebar_data['name'] = $waterfall->name; |
148 | 141 | $sidebar_data['watercourse'] = $waterfall->watercourse; |
@@ -174,8 +167,7 @@ discard block |
||
174 | 167 | return $sidebar_data; |
175 | 168 | } |
176 | 169 | |
177 | - private function get_journal_list($waterfall) |
|
178 | - { |
|
170 | + private function get_journal_list($waterfall) { |
|
179 | 171 | $list = array(); |
180 | 172 | $log_result = LogCollector::getLogListForWaterfall($waterfall); |
181 | 173 | foreach ($log_result as $log_row) { |
@@ -189,8 +181,7 @@ discard block |
||
189 | 181 | return $list; |
190 | 182 | } |
191 | 183 | |
192 | - private function get_map_piece($waterfall) |
|
193 | - { |
|
184 | + private function get_map_piece($waterfall) { |
|
194 | 185 | $map_holder = array(); |
195 | 186 | |
196 | 187 | $url = 'https://maps.googleapis.com/maps/api/staticmap'; |
@@ -211,8 +202,7 @@ discard block |
||
211 | 202 | return (object) $map_holder; |
212 | 203 | } |
213 | 204 | |
214 | - private function get_nearby_list($waterfall) |
|
215 | - { |
|
205 | + private function get_nearby_list($waterfall) { |
|
216 | 206 | $nearby_list = array(); |
217 | 207 | |
218 | 208 | $result = WaterfallCollector::getNearbyList($waterfall); |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', '/PageController'); |
4 | 4 | |
5 | -abstract class DefaultPageController extends PageController |
|
6 | -{ |
|
5 | +abstract class DefaultPageController extends PageController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | protected static $WEBSITE_TITLE = 'Waterfalls of the Keweenaw'; |
9 | 9 | protected static $PAGE_DESCRIPTION_LIMIT = 250; |
@@ -12,22 +12,19 @@ discard block |
||
12 | 12 | |
13 | 13 | protected $parent_navigation_item = ''; |
14 | 14 | |
15 | - protected function set_head_data() |
|
16 | - { |
|
15 | + protected function set_head_data() { |
|
17 | 16 | $this->set_head('google_verification', 'm9ua4n8lp4FUYYa2UOh51UyZYfdivl-kRTtXKwaH0-s'); |
18 | 17 | $this->add_css('normalize'); |
19 | 18 | $this->add_css('waterfalls'); |
20 | 19 | } |
21 | 20 | |
22 | - protected function add_waterfall_js() |
|
23 | - { |
|
21 | + protected function add_waterfall_js() { |
|
24 | 22 | $this->add_js('jquery'); |
25 | 23 | $this->add_js('imagelightbox'); |
26 | 24 | $this->add_js('waterfalls'); |
27 | 25 | } |
28 | 26 | |
29 | - protected function set_body_data($page_type = 'normal') |
|
30 | - { |
|
27 | + protected function set_body_data($page_type = 'normal') { |
|
31 | 28 | $this->set_body('activity_array', $this->get_recent_activity()); |
32 | 29 | |
33 | 30 | $this->set_body('main_navigation', array( |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | Loader::load('collector', 'waterfall/WaterfallCollector'); |
4 | 4 | Loader::load('controller', 'waterfalls/DefaultWaterfallListController'); |
5 | 5 | |
6 | -final class WatercourseListController extends DefaultWaterfallListController |
|
7 | -{ |
|
6 | +final class WatercourseListController extends DefaultWaterfallListController |
|
7 | +{ |
|
8 | 8 | |
9 | 9 | private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
10 | 10 | private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
@@ -24,19 +24,18 @@ discard block |
||
24 | 24 | |
25 | 25 | private $watercourse; |
26 | 26 | |
27 | - public function __construct() |
|
28 | - { |
|
27 | + public function __construct() { |
|
29 | 28 | $path = URLDecode::getPiece(1); |
30 | 29 | $this->watercourse = WatercourseCollector::getByAlias($path); |
31 | 30 | |
32 | - if(!$this->watercourse) |
|
33 | - $this->eject(); |
|
31 | + if(!$this->watercourse) { |
|
32 | + $this->eject(); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | parent::__construct(); |
36 | 36 | } |
37 | 37 | |
38 | - protected function get_initial_meta() |
|
39 | - { |
|
38 | + protected function get_initial_meta() { |
|
40 | 39 | $meta_array = array(); |
41 | 40 | |
42 | 41 | $meta_array['title'] = "{$this->watercourse->name} | " . self::$WEBSITE_TITLE; |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | return $meta_array; |
47 | 46 | } |
48 | 47 | |
49 | - protected function get_subsequent_meta() |
|
50 | - { |
|
48 | + protected function get_subsequent_meta() { |
|
51 | 49 | $meta_array = array(); |
52 | 50 | |
53 | 51 | $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->watercourse->name, $this->page, $this->page_count); |
@@ -57,15 +55,13 @@ discard block |
||
57 | 55 | return $meta_array; |
58 | 56 | } |
59 | 57 | |
60 | - private function get_keyword_array() |
|
61 | - { |
|
58 | + private function get_keyword_array() { |
|
62 | 59 | $keyword_array = self::$KEYWORD_ARRAY; |
63 | 60 | array_unshift($keyword_array, strtolower($this->watercourse->name)); |
64 | 61 | return $keyword_array; |
65 | 62 | } |
66 | 63 | |
67 | - protected function get_initial_introduction() |
|
68 | - { |
|
64 | + protected function get_initial_introduction() { |
|
69 | 65 | $introduction = array(); |
70 | 66 | |
71 | 67 | $introduction['title'] = $this->watercourse->header; |
@@ -75,39 +71,32 @@ discard block |
||
75 | 71 | return $introduction; |
76 | 72 | } |
77 | 73 | |
78 | - protected function get_subsequent_introduction() |
|
79 | - { |
|
74 | + protected function get_subsequent_introduction() { |
|
80 | 75 | return array( |
81 | 76 | 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->watercourse->name)); |
82 | 77 | } |
83 | 78 | |
84 | - protected function get_item_count_per_page() |
|
85 | - { |
|
79 | + protected function get_item_count_per_page() { |
|
86 | 80 | return self::$ITEM_COUNT_PER_PAGE; |
87 | 81 | } |
88 | 82 | |
89 | - protected function get_page_number_piece() |
|
90 | - { |
|
83 | + protected function get_page_number_piece() { |
|
91 | 84 | return URLDecode::getPiece(2); |
92 | 85 | } |
93 | 86 | |
94 | - protected function get_item_result($total, $offset) |
|
95 | - { |
|
87 | + protected function get_item_result($total, $offset) { |
|
96 | 88 | return WatercourseCollector::getLogListForWatercourse($this->watercourse->id, $total, $offset); |
97 | 89 | } |
98 | 90 | |
99 | - protected function get_item_count_result() |
|
100 | - { |
|
91 | + protected function get_item_count_result() { |
|
101 | 92 | return WatercourseCollector::getLogCountForWatercourse($this->watercourse->id); |
102 | 93 | } |
103 | 94 | |
104 | - protected function get_list_description_pattern() |
|
105 | - { |
|
95 | + protected function get_list_description_pattern() { |
|
106 | 96 | return str_replace('%COUNTY%', $this->watercourse->name, self::$NAVIGATION_DESCRIPTION); |
107 | 97 | } |
108 | 98 | |
109 | - protected function get_list_link_root() |
|
110 | - { |
|
99 | + protected function get_list_link_root() { |
|
111 | 100 | return sprintf(self::$LINK_ROOT, $this->watercourse->alias); |
112 | 101 | } |
113 | 102 |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', 'waterfalls/DefaultPageController'); |
4 | 4 | |
5 | -final class AboutController extends DefaultPageController |
|
6 | -{ |
|
5 | +final class AboutController extends DefaultPageController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | private static $TITLE = 'About the Website | Waterfalls of the Keweenaw'; |
9 | 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.'; |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | 'Jacob Emerick', |
15 | 15 | ); |
16 | 16 | |
17 | - protected function set_head_data() |
|
18 | - { |
|
17 | + protected function set_head_data() { |
|
19 | 18 | parent::set_head_data(); |
20 | 19 | |
21 | 20 | $this->set_title(self::$TITLE); |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | $this->set_keywords(self::$KEYWORD_ARRAY); |
24 | 23 | } |
25 | 24 | |
26 | - protected function set_body_data($page_type = 'normal') |
|
27 | - { |
|
25 | + protected function set_body_data($page_type = 'normal') { |
|
28 | 26 | parent::set_body_data($page_type); |
29 | 27 | |
30 | 28 | $this->set_body('view', 'About'); |
@@ -2,16 +2,15 @@ discard block |
||
2 | 2 | |
3 | 3 | Loader::load('controller', 'waterfalls/DefaultListController'); |
4 | 4 | |
5 | -final class SearchListController extends DefaultListController |
|
6 | -{ |
|
5 | +final class SearchListController extends DefaultListController |
|
6 | +{ |
|
7 | 7 | |
8 | 8 | private static $TITLE = 'Search Listing'; |
9 | 9 | private static $DESCRIPTION = ''; |
10 | 10 | |
11 | 11 | private static $KEYWORD_ARRAY = array(); |
12 | 12 | |
13 | - protected function set_head_data() |
|
14 | - { |
|
13 | + protected function set_head_data() { |
|
15 | 14 | parent::set_head_data(); |
16 | 15 | |
17 | 16 | $this->set_title(self::$TITLE); |
@@ -19,47 +18,40 @@ discard block |
||
19 | 18 | $this->set_keywords(self::$KEYWORD_ARRAY); |
20 | 19 | } |
21 | 20 | |
22 | - protected function get_introduction() |
|
23 | - { |
|
21 | + protected function get_introduction() { |
|
24 | 22 | return; |
25 | 23 | } |
26 | 24 | |
27 | - protected function get_page_number() |
|
28 | - { |
|
25 | + protected function get_page_number() { |
|
29 | 26 | $page = URLDecode::getPiece(2); |
30 | - if(isset($page) && is_numeric($page)) |
|
31 | - return $page; |
|
27 | + if(isset($page) && is_numeric($page)) { |
|
28 | + return $page; |
|
29 | + } |
|
32 | 30 | return 1; |
33 | 31 | } |
34 | 32 | |
35 | - protected function get_items() |
|
36 | - { |
|
33 | + protected function get_items() { |
|
37 | 34 | return array(); |
38 | 35 | } |
39 | 36 | |
40 | - protected function get_list_description() |
|
41 | - { |
|
37 | + protected function get_list_description() { |
|
42 | 38 | return 'yay cloud'; |
43 | 39 | } |
44 | 40 | |
45 | - protected function get_list_next_link() |
|
46 | - { |
|
41 | + protected function get_list_next_link() { |
|
47 | 42 | return '/'; |
48 | 43 | } |
49 | 44 | |
50 | - protected function get_list_prev_link() |
|
51 | - { |
|
45 | + protected function get_list_prev_link() { |
|
52 | 46 | return '/'; |
53 | 47 | } |
54 | 48 | |
55 | 49 | private $total_post_count; |
56 | - protected function get_item_count() |
|
57 | - { |
|
50 | + protected function get_item_count() { |
|
58 | 51 | return 20; |
59 | 52 | } |
60 | 53 | |
61 | - protected function get_item_count_per_page() |
|
62 | - { |
|
54 | + protected function get_item_count_per_page() { |
|
63 | 55 | return 20; |
64 | 56 | } |
65 | 57 |
@@ -7,23 +7,20 @@ discard block |
||
7 | 7 | 'waterfall/WaterfallCollector')); |
8 | 8 | Loader::load('controller', 'waterfalls/DefaultListController'); |
9 | 9 | |
10 | -abstract class DefaultWaterfallListController extends DefaultListController |
|
11 | -{ |
|
10 | +abstract class DefaultWaterfallListController extends DefaultListController |
|
11 | +{ |
|
12 | 12 | |
13 | 13 | protected static $ITEM_COUNT_PER_PAGE = 24; |
14 | 14 | |
15 | - final protected function get_list_view() |
|
16 | - { |
|
15 | + final protected function get_list_view() { |
|
17 | 16 | return 'FallListing'; |
18 | 17 | } |
19 | 18 | |
20 | - protected function get_item_count_per_page() |
|
21 | - { |
|
19 | + protected function get_item_count_per_page() { |
|
22 | 20 | return self::$ITEM_COUNT_PER_PAGE; |
23 | 21 | } |
24 | 22 | |
25 | - final protected function format_item($item) |
|
26 | - { |
|
23 | + final protected function format_item($item) { |
|
27 | 24 | $item_array = array(); |
28 | 25 | |
29 | 26 | $item_array['name'] = $item->name; |
@@ -36,8 +33,7 @@ discard block |
||
36 | 33 | return $item_array; |
37 | 34 | } |
38 | 35 | |
39 | - final protected function get_sidebar() |
|
40 | - { |
|
36 | + final protected function get_sidebar() { |
|
41 | 37 | $county_result = CountyCollector::getCountyList(); |
42 | 38 | $county_list = array(); |
43 | 39 |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | )); |
8 | 8 | Loader::load('controller', 'waterfalls/DefaultPageController'); |
9 | 9 | |
10 | -final class HomeController extends DefaultPageController |
|
11 | -{ |
|
10 | +final class HomeController extends DefaultPageController |
|
11 | +{ |
|
12 | 12 | |
13 | 13 | private static $TITLE = 'Waterfalls of the Keweenaw | Stories and Tips from Jacob Emerick'; |
14 | 14 | private static $DESCRIPTION = 'Stories, maps, and details about many of the waterfalls in the Upper Peninsula of Michigan, compiled by Jacob Emerick.'; |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | private static $BANNER_IMAGE = 2661; |
23 | 23 | |
24 | - protected function set_head_data() |
|
25 | - { |
|
24 | + protected function set_head_data() { |
|
26 | 25 | parent::set_head_data(); |
27 | 26 | |
28 | 27 | $this->set_title(self::$TITLE); |
@@ -30,8 +29,7 @@ discard block |
||
30 | 29 | $this->set_keywords(self::$KEYWORD_ARRAY); |
31 | 30 | } |
32 | 31 | |
33 | - protected function set_body_data($page_type = 'wide') |
|
34 | - { |
|
32 | + protected function set_body_data($page_type = 'wide') { |
|
35 | 33 | parent::set_body_data($page_type); |
36 | 34 | |
37 | 35 | $photo = PhotoCollector::getRow(self::$BANNER_IMAGE); |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | Loader::load('collector', 'waterfall/CountyCollector'); |
4 | 4 | Loader::load('controller', 'waterfalls/DefaultWaterfallListController'); |
5 | 5 | |
6 | -final class CountyListController extends DefaultWaterfallListController |
|
7 | -{ |
|
6 | +final class CountyListController extends DefaultWaterfallListController |
|
7 | +{ |
|
8 | 8 | |
9 | 9 | private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d'; |
10 | 10 | private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.'; |
@@ -23,19 +23,18 @@ discard block |
||
23 | 23 | |
24 | 24 | private $county; |
25 | 25 | |
26 | - public function __construct() |
|
27 | - { |
|
26 | + public function __construct() { |
|
28 | 27 | $path = URLDecode::getPiece(1); |
29 | 28 | $this->county = CountyCollector::getByAlias($path); |
30 | 29 | |
31 | - if(!$this->county) |
|
32 | - $this->eject(); |
|
30 | + if(!$this->county) { |
|
31 | + $this->eject(); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | parent::__construct(); |
35 | 35 | } |
36 | 36 | |
37 | - protected function get_initial_meta() |
|
38 | - { |
|
37 | + protected function get_initial_meta() { |
|
39 | 38 | $meta_array = array(); |
40 | 39 | |
41 | 40 | $meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE; |
@@ -45,8 +44,7 @@ discard block |
||
45 | 44 | return $meta_array; |
46 | 45 | } |
47 | 46 | |
48 | - protected function get_subsequent_meta() |
|
49 | - { |
|
47 | + protected function get_subsequent_meta() { |
|
50 | 48 | $meta_array = array(); |
51 | 49 | |
52 | 50 | $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count); |
@@ -56,15 +54,13 @@ discard block |
||
56 | 54 | return $meta_array; |
57 | 55 | } |
58 | 56 | |
59 | - private function get_keyword_array() |
|
60 | - { |
|
57 | + private function get_keyword_array() { |
|
61 | 58 | $keyword_array = self::$KEYWORD_ARRAY; |
62 | 59 | array_unshift($keyword_array, strtolower($this->county->name)); |
63 | 60 | return $keyword_array; |
64 | 61 | } |
65 | 62 | |
66 | - protected function get_initial_introduction() |
|
67 | - { |
|
63 | + protected function get_initial_introduction() { |
|
68 | 64 | $introduction = array(); |
69 | 65 | |
70 | 66 | $introduction['title'] = $this->county->title; |
@@ -74,39 +70,32 @@ discard block |
||
74 | 70 | return $introduction; |
75 | 71 | } |
76 | 72 | |
77 | - protected function get_subsequent_introduction() |
|
78 | - { |
|
73 | + protected function get_subsequent_introduction() { |
|
79 | 74 | return array( |
80 | 75 | 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name)); |
81 | 76 | } |
82 | 77 | |
83 | - protected function get_item_count_per_page() |
|
84 | - { |
|
78 | + protected function get_item_count_per_page() { |
|
85 | 79 | return self::$ITEM_COUNT_PER_PAGE; |
86 | 80 | } |
87 | 81 | |
88 | - protected function get_page_number_piece() |
|
89 | - { |
|
82 | + protected function get_page_number_piece() { |
|
90 | 83 | return URLDecode::getPiece(2); |
91 | 84 | } |
92 | 85 | |
93 | - protected function get_item_result($total, $offset) |
|
94 | - { |
|
86 | + protected function get_item_result($total, $offset) { |
|
95 | 87 | return CountyCollector::getLogListForCounty($this->county->id, $total, $offset); |
96 | 88 | } |
97 | 89 | |
98 | - protected function get_item_count_result() |
|
99 | - { |
|
90 | + protected function get_item_count_result() { |
|
100 | 91 | return CountyCollector::getLogCountForCounty($this->county->id); |
101 | 92 | } |
102 | 93 | |
103 | - protected function get_list_description_pattern() |
|
104 | - { |
|
94 | + protected function get_list_description_pattern() { |
|
105 | 95 | return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION); |
106 | 96 | } |
107 | 97 | |
108 | - protected function get_list_link_root() |
|
109 | - { |
|
98 | + protected function get_list_link_root() { |
|
110 | 99 | return sprintf(self::$LINK_ROOT, $this->county->alias); |
111 | 100 | } |
112 | 101 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | Loader::load('collector', 'waterfall/LogTagCollector'); |
4 | 4 | Loader::load('controller', 'waterfalls/DefaultLogListController'); |
5 | 5 | |
6 | -final class LogTagListController extends DefaultLogListController |
|
7 | -{ |
|
6 | +final class LogTagListController extends DefaultLogListController |
|
7 | +{ |
|
8 | 8 | |
9 | 9 | private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
10 | 10 | private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
@@ -22,19 +22,18 @@ discard block |
||
22 | 22 | |
23 | 23 | private $tag; |
24 | 24 | |
25 | - public function __construct() |
|
26 | - { |
|
25 | + public function __construct() { |
|
27 | 26 | $alias = URLDecode::getPiece(3); |
28 | 27 | $this->tag = LogTagCollector::getTag($alias); |
29 | 28 | |
30 | - if(!$this->tag) |
|
31 | - $this->eject(); |
|
29 | + if(!$this->tag) { |
|
30 | + $this->eject(); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | parent::__construct(); |
34 | 34 | } |
35 | 35 | |
36 | - protected function get_initial_meta() |
|
37 | - { |
|
36 | + protected function get_initial_meta() { |
|
38 | 37 | $meta_array = array(); |
39 | 38 | |
40 | 39 | $meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE; |
@@ -44,8 +43,7 @@ discard block |
||
44 | 43 | return $meta_array; |
45 | 44 | } |
46 | 45 | |
47 | - protected function get_subsequent_meta() |
|
48 | - { |
|
46 | + protected function get_subsequent_meta() { |
|
49 | 47 | $meta_array = array(); |
50 | 48 | |
51 | 49 | $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count); |
@@ -55,46 +53,38 @@ discard block |
||
55 | 53 | return $meta_array; |
56 | 54 | } |
57 | 55 | |
58 | - private function get_keyword_array() |
|
59 | - { |
|
56 | + private function get_keyword_array() { |
|
60 | 57 | $keyword_array = self::$KEYWORD_ARRAY; |
61 | 58 | array_unshift($keyword_array, strtolower($this->tag->name)); |
62 | 59 | return $keyword_array; |
63 | 60 | } |
64 | 61 | |
65 | - protected function get_initial_introduction() |
|
66 | - { |
|
62 | + protected function get_initial_introduction() { |
|
67 | 63 | return array( |
68 | 64 | 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name)); |
69 | 65 | } |
70 | 66 | |
71 | - protected function get_subsequent_introduction() |
|
72 | - { |
|
67 | + protected function get_subsequent_introduction() { |
|
73 | 68 | return $this->get_initial_introduction(); |
74 | 69 | } |
75 | 70 | |
76 | - protected function get_page_number_piece() |
|
77 | - { |
|
71 | + protected function get_page_number_piece() { |
|
78 | 72 | return URLDecode::getPiece(3); |
79 | 73 | } |
80 | 74 | |
81 | - protected function get_item_result($total, $offset) |
|
82 | - { |
|
75 | + protected function get_item_result($total, $offset) { |
|
83 | 76 | return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset); |
84 | 77 | } |
85 | 78 | |
86 | - protected function get_item_count_result() |
|
87 | - { |
|
79 | + protected function get_item_count_result() { |
|
88 | 80 | return LogTagCollector::getLogCountForTag($this->tag->id); |
89 | 81 | } |
90 | 82 | |
91 | - protected function get_list_description_pattern() |
|
92 | - { |
|
83 | + protected function get_list_description_pattern() { |
|
93 | 84 | return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION); |
94 | 85 | } |
95 | 86 | |
96 | - protected function get_list_link_root() |
|
97 | - { |
|
87 | + protected function get_list_link_root() { |
|
98 | 88 | return sprintf(self::$LINK_ROOT, $this->tag->alias); |
99 | 89 | } |
100 | 90 |