@@ -6,108 +6,108 @@ |
||
6 | 6 | final class CountyListController extends DefaultWaterfallListController |
7 | 7 | { |
8 | 8 | |
9 | - private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d'; |
|
10 | - private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.'; |
|
11 | - private static $DEFAULT_HEADER = 'Page %d of Awesome %s Waterfalls'; |
|
9 | + private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d'; |
|
10 | + private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.'; |
|
11 | + private static $DEFAULT_HEADER = 'Page %d of Awesome %s Waterfalls'; |
|
12 | 12 | |
13 | - private static $KEYWORD_ARRAY = array( |
|
14 | - 'upper peninsula', |
|
15 | - 'michigan', |
|
16 | - 'keweenaw', |
|
17 | - 'waterfalls'); |
|
13 | + private static $KEYWORD_ARRAY = array( |
|
14 | + 'upper peninsula', |
|
15 | + 'michigan', |
|
16 | + 'keweenaw', |
|
17 | + 'waterfalls'); |
|
18 | 18 | |
19 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
20 | - private static $LINK_ROOT = '/%s/'; |
|
19 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
20 | + private static $LINK_ROOT = '/%s/'; |
|
21 | 21 | |
22 | - protected static $ITEM_COUNT_PER_PAGE = 12; |
|
22 | + protected static $ITEM_COUNT_PER_PAGE = 12; |
|
23 | 23 | |
24 | - private $county; |
|
24 | + private $county; |
|
25 | 25 | |
26 | - public function __construct() |
|
27 | - { |
|
28 | - $path = URLDecode::getPiece(1); |
|
29 | - $this->county = CountyCollector::getByAlias($path); |
|
26 | + public function __construct() |
|
27 | + { |
|
28 | + $path = URLDecode::getPiece(1); |
|
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 | - parent::__construct(); |
|
35 | - } |
|
34 | + parent::__construct(); |
|
35 | + } |
|
36 | 36 | |
37 | - protected function get_initial_meta() |
|
38 | - { |
|
39 | - $meta_array = array(); |
|
37 | + protected function get_initial_meta() |
|
38 | + { |
|
39 | + $meta_array = array(); |
|
40 | 40 | |
41 | - $meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE; |
|
42 | - $meta_array['description'] = $this->county->description; |
|
43 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
41 | + $meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE; |
|
42 | + $meta_array['description'] = $this->county->description; |
|
43 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
44 | 44 | |
45 | - return $meta_array; |
|
46 | - } |
|
45 | + return $meta_array; |
|
46 | + } |
|
47 | 47 | |
48 | - protected function get_subsequent_meta() |
|
49 | - { |
|
50 | - $meta_array = array(); |
|
48 | + protected function get_subsequent_meta() |
|
49 | + { |
|
50 | + $meta_array = array(); |
|
51 | 51 | |
52 | - $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count); |
|
53 | - $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->county->name); |
|
54 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
52 | + $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count); |
|
53 | + $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->county->name); |
|
54 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
55 | 55 | |
56 | - return $meta_array; |
|
57 | - } |
|
58 | - |
|
59 | - private function get_keyword_array() |
|
60 | - { |
|
61 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
62 | - array_unshift($keyword_array, strtolower($this->county->name)); |
|
63 | - return $keyword_array; |
|
64 | - } |
|
65 | - |
|
66 | - protected function get_initial_introduction() |
|
67 | - { |
|
68 | - $introduction = array(); |
|
56 | + return $meta_array; |
|
57 | + } |
|
58 | + |
|
59 | + private function get_keyword_array() |
|
60 | + { |
|
61 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
62 | + array_unshift($keyword_array, strtolower($this->county->name)); |
|
63 | + return $keyword_array; |
|
64 | + } |
|
65 | + |
|
66 | + protected function get_initial_introduction() |
|
67 | + { |
|
68 | + $introduction = array(); |
|
69 | 69 | |
70 | - $introduction['title'] = $this->county->title; |
|
71 | - $introduction['description'] = Content::instance('FixInternalLink', $this->county->introduction)->activate(); |
|
72 | - $introduction['image'] = $this->get_image_element($this->county->photo_category, $this->county->photo, $this->county->photo_description, 'medium'); |
|
70 | + $introduction['title'] = $this->county->title; |
|
71 | + $introduction['description'] = Content::instance('FixInternalLink', $this->county->introduction)->activate(); |
|
72 | + $introduction['image'] = $this->get_image_element($this->county->photo_category, $this->county->photo, $this->county->photo_description, 'medium'); |
|
73 | 73 | |
74 | - return $introduction; |
|
75 | - } |
|
76 | - |
|
77 | - protected function get_subsequent_introduction() |
|
78 | - { |
|
79 | - return array( |
|
80 | - 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name)); |
|
81 | - } |
|
82 | - |
|
83 | - protected function get_item_count_per_page() |
|
84 | - { |
|
85 | - return self::$ITEM_COUNT_PER_PAGE; |
|
86 | - } |
|
87 | - |
|
88 | - protected function get_page_number_piece() |
|
89 | - { |
|
90 | - return URLDecode::getPiece(2); |
|
91 | - } |
|
92 | - |
|
93 | - protected function get_item_result($total, $offset) |
|
94 | - { |
|
95 | - return CountyCollector::getLogListForCounty($this->county->id, $total, $offset); |
|
96 | - } |
|
97 | - |
|
98 | - protected function get_item_count_result() |
|
99 | - { |
|
100 | - return CountyCollector::getLogCountForCounty($this->county->id); |
|
101 | - } |
|
102 | - |
|
103 | - protected function get_list_description_pattern() |
|
104 | - { |
|
105 | - return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION); |
|
106 | - } |
|
107 | - |
|
108 | - protected function get_list_link_root() |
|
109 | - { |
|
110 | - return sprintf(self::$LINK_ROOT, $this->county->alias); |
|
111 | - } |
|
74 | + return $introduction; |
|
75 | + } |
|
76 | + |
|
77 | + protected function get_subsequent_introduction() |
|
78 | + { |
|
79 | + return array( |
|
80 | + 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name)); |
|
81 | + } |
|
82 | + |
|
83 | + protected function get_item_count_per_page() |
|
84 | + { |
|
85 | + return self::$ITEM_COUNT_PER_PAGE; |
|
86 | + } |
|
87 | + |
|
88 | + protected function get_page_number_piece() |
|
89 | + { |
|
90 | + return URLDecode::getPiece(2); |
|
91 | + } |
|
92 | + |
|
93 | + protected function get_item_result($total, $offset) |
|
94 | + { |
|
95 | + return CountyCollector::getLogListForCounty($this->county->id, $total, $offset); |
|
96 | + } |
|
97 | + |
|
98 | + protected function get_item_count_result() |
|
99 | + { |
|
100 | + return CountyCollector::getLogCountForCounty($this->county->id); |
|
101 | + } |
|
102 | + |
|
103 | + protected function get_list_description_pattern() |
|
104 | + { |
|
105 | + return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION); |
|
106 | + } |
|
107 | + |
|
108 | + protected function get_list_link_root() |
|
109 | + { |
|
110 | + return sprintf(self::$LINK_ROOT, $this->county->alias); |
|
111 | + } |
|
112 | 112 | |
113 | 113 | } |
114 | 114 | \ No newline at end of file |
@@ -6,96 +6,96 @@ |
||
6 | 6 | final class LogTagListController extends DefaultLogListController |
7 | 7 | { |
8 | 8 | |
9 | - private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
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'; |
|
11 | - private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
12 | - |
|
13 | - private static $KEYWORD_ARRAY = array( |
|
14 | - 'hiking companions', |
|
15 | - 'journal', |
|
16 | - 'stories', |
|
17 | - 'blog', |
|
18 | - 'waterfalls'); |
|
19 | - |
|
20 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of journal entries with %TAG%'; |
|
21 | - private static $LINK_ROOT = '/journal/tag/%s/'; |
|
22 | - |
|
23 | - private $tag; |
|
24 | - |
|
25 | - public function __construct() |
|
26 | - { |
|
27 | - $alias = URLDecode::getPiece(3); |
|
28 | - $this->tag = LogTagCollector::getTag($alias); |
|
9 | + private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
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'; |
|
11 | + private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
12 | + |
|
13 | + private static $KEYWORD_ARRAY = array( |
|
14 | + 'hiking companions', |
|
15 | + 'journal', |
|
16 | + 'stories', |
|
17 | + 'blog', |
|
18 | + 'waterfalls'); |
|
19 | + |
|
20 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of journal entries with %TAG%'; |
|
21 | + private static $LINK_ROOT = '/journal/tag/%s/'; |
|
22 | + |
|
23 | + private $tag; |
|
24 | + |
|
25 | + public function __construct() |
|
26 | + { |
|
27 | + $alias = URLDecode::getPiece(3); |
|
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 | - parent::__construct(); |
|
34 | - } |
|
33 | + parent::__construct(); |
|
34 | + } |
|
35 | 35 | |
36 | - protected function get_initial_meta() |
|
37 | - { |
|
38 | - $meta_array = array(); |
|
36 | + protected function get_initial_meta() |
|
37 | + { |
|
38 | + $meta_array = array(); |
|
39 | 39 | |
40 | - $meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE; |
|
41 | - $meta_array['description'] = $this->tag->name; |
|
42 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
40 | + $meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE; |
|
41 | + $meta_array['description'] = $this->tag->name; |
|
42 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
43 | 43 | |
44 | - return $meta_array; |
|
45 | - } |
|
44 | + return $meta_array; |
|
45 | + } |
|
46 | 46 | |
47 | - protected function get_subsequent_meta() |
|
48 | - { |
|
49 | - $meta_array = array(); |
|
47 | + protected function get_subsequent_meta() |
|
48 | + { |
|
49 | + $meta_array = array(); |
|
50 | 50 | |
51 | - $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count); |
|
52 | - $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->tag->name); |
|
53 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
51 | + $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count); |
|
52 | + $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->tag->name); |
|
53 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
54 | 54 | |
55 | - return $meta_array; |
|
56 | - } |
|
57 | - |
|
58 | - private function get_keyword_array() |
|
59 | - { |
|
60 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
61 | - array_unshift($keyword_array, strtolower($this->tag->name)); |
|
62 | - return $keyword_array; |
|
63 | - } |
|
64 | - |
|
65 | - protected function get_initial_introduction() |
|
66 | - { |
|
67 | - return array( |
|
68 | - 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name)); |
|
69 | - } |
|
70 | - |
|
71 | - protected function get_subsequent_introduction() |
|
72 | - { |
|
73 | - return $this->get_initial_introduction(); |
|
74 | - } |
|
75 | - |
|
76 | - protected function get_page_number_piece() |
|
77 | - { |
|
78 | - return URLDecode::getPiece(3); |
|
79 | - } |
|
80 | - |
|
81 | - protected function get_item_result($total, $offset) |
|
82 | - { |
|
83 | - return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset); |
|
84 | - } |
|
85 | - |
|
86 | - protected function get_item_count_result() |
|
87 | - { |
|
88 | - return LogTagCollector::getLogCountForTag($this->tag->id); |
|
89 | - } |
|
90 | - |
|
91 | - protected function get_list_description_pattern() |
|
92 | - { |
|
93 | - return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION); |
|
94 | - } |
|
95 | - |
|
96 | - protected function get_list_link_root() |
|
97 | - { |
|
98 | - return sprintf(self::$LINK_ROOT, $this->tag->alias); |
|
99 | - } |
|
55 | + return $meta_array; |
|
56 | + } |
|
57 | + |
|
58 | + private function get_keyword_array() |
|
59 | + { |
|
60 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
61 | + array_unshift($keyword_array, strtolower($this->tag->name)); |
|
62 | + return $keyword_array; |
|
63 | + } |
|
64 | + |
|
65 | + protected function get_initial_introduction() |
|
66 | + { |
|
67 | + return array( |
|
68 | + 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name)); |
|
69 | + } |
|
70 | + |
|
71 | + protected function get_subsequent_introduction() |
|
72 | + { |
|
73 | + return $this->get_initial_introduction(); |
|
74 | + } |
|
75 | + |
|
76 | + protected function get_page_number_piece() |
|
77 | + { |
|
78 | + return URLDecode::getPiece(3); |
|
79 | + } |
|
80 | + |
|
81 | + protected function get_item_result($total, $offset) |
|
82 | + { |
|
83 | + return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset); |
|
84 | + } |
|
85 | + |
|
86 | + protected function get_item_count_result() |
|
87 | + { |
|
88 | + return LogTagCollector::getLogCountForTag($this->tag->id); |
|
89 | + } |
|
90 | + |
|
91 | + protected function get_list_description_pattern() |
|
92 | + { |
|
93 | + return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION); |
|
94 | + } |
|
95 | + |
|
96 | + protected function get_list_link_root() |
|
97 | + { |
|
98 | + return sprintf(self::$LINK_ROOT, $this->tag->alias); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | } |
102 | 102 | \ No newline at end of file |
@@ -1,73 +1,73 @@ |
||
1 | 1 | <? |
2 | 2 | |
3 | 3 | Loader::load('collector', array( |
4 | - 'comment/CommentCollector', |
|
5 | - 'waterfall/CompanionCollector', |
|
6 | - 'waterfall/LogCollector', |
|
7 | - 'waterfall/PeriodCollector')); |
|
4 | + 'comment/CommentCollector', |
|
5 | + 'waterfall/CompanionCollector', |
|
6 | + 'waterfall/LogCollector', |
|
7 | + 'waterfall/PeriodCollector')); |
|
8 | 8 | Loader::load('controller', 'waterfalls/DefaultListController'); |
9 | 9 | |
10 | 10 | abstract class DefaultLogListController extends DefaultListController |
11 | 11 | { |
12 | 12 | |
13 | - private static $ITEM_COUNT_PER_PAGE = 10; |
|
13 | + private static $ITEM_COUNT_PER_PAGE = 10; |
|
14 | 14 | |
15 | - final protected function get_list_view() |
|
16 | - { |
|
17 | - return 'LogListing'; |
|
18 | - } |
|
15 | + final protected function get_list_view() |
|
16 | + { |
|
17 | + return 'LogListing'; |
|
18 | + } |
|
19 | 19 | |
20 | - final protected function get_item_count_per_page() |
|
21 | - { |
|
22 | - return self::$ITEM_COUNT_PER_PAGE; |
|
23 | - } |
|
20 | + final protected function get_item_count_per_page() |
|
21 | + { |
|
22 | + return self::$ITEM_COUNT_PER_PAGE; |
|
23 | + } |
|
24 | 24 | |
25 | - final protected function format_item($item) |
|
26 | - { |
|
27 | - $item_array = array(); |
|
25 | + final protected function format_item($item) |
|
26 | + { |
|
27 | + $item_array = array(); |
|
28 | 28 | |
29 | - $item_array['title'] = $item->title; |
|
30 | - $item_array['image'] = $this->get_image_element($item->photo_category, $item->photo, $item->photo_description); |
|
31 | - $item_array['waterfall_list'] = LogCollector::getWaterfallListForLog($item->id); |
|
32 | - $item_array['introduction'] = $item->introduction; |
|
33 | - $item_array['path'] = "/journal/{$item->alias}/"; |
|
34 | - $item_array['comment_count'] = CommentCollector::getCommentCountForURL(self::$WATERFALL_SITE_ID, $item->alias); |
|
35 | - $item_array['date'] = $this->get_parsed_date($item->date); |
|
29 | + $item_array['title'] = $item->title; |
|
30 | + $item_array['image'] = $this->get_image_element($item->photo_category, $item->photo, $item->photo_description); |
|
31 | + $item_array['waterfall_list'] = LogCollector::getWaterfallListForLog($item->id); |
|
32 | + $item_array['introduction'] = $item->introduction; |
|
33 | + $item_array['path'] = "/journal/{$item->alias}/"; |
|
34 | + $item_array['comment_count'] = CommentCollector::getCommentCountForURL(self::$WATERFALL_SITE_ID, $item->alias); |
|
35 | + $item_array['date'] = $this->get_parsed_date($item->date); |
|
36 | 36 | |
37 | - return $item_array; |
|
38 | - } |
|
37 | + return $item_array; |
|
38 | + } |
|
39 | 39 | |
40 | - final protected function get_sidebar() |
|
41 | - { |
|
42 | - $companion_result = CompanionCollector::getCompanionList(); |
|
43 | - $companion_list = array(); |
|
40 | + final protected function get_sidebar() |
|
41 | + { |
|
42 | + $companion_result = CompanionCollector::getCompanionList(); |
|
43 | + $companion_list = array(); |
|
44 | 44 | |
45 | - foreach($companion_result as $companion_row) |
|
46 | - { |
|
47 | - $companion = new stdclass(); |
|
48 | - $companion->name = $companion_row->name; |
|
49 | - $companion->uri = "/companion/{$companion_row->alias}/"; |
|
50 | - $companion->count = $companion_row->count; |
|
45 | + foreach($companion_result as $companion_row) |
|
46 | + { |
|
47 | + $companion = new stdclass(); |
|
48 | + $companion->name = $companion_row->name; |
|
49 | + $companion->uri = "/companion/{$companion_row->alias}/"; |
|
50 | + $companion->count = $companion_row->count; |
|
51 | 51 | |
52 | - $companion_list[] = $companion; |
|
53 | - } |
|
52 | + $companion_list[] = $companion; |
|
53 | + } |
|
54 | 54 | |
55 | - $period_result = PeriodCollector::getPeriodList(); |
|
56 | - $period_list = array(); |
|
55 | + $period_result = PeriodCollector::getPeriodList(); |
|
56 | + $period_list = array(); |
|
57 | 57 | |
58 | - foreach($period_result as $period_row) |
|
59 | - { |
|
60 | - $period = new stdclass(); |
|
61 | - $period->name = $period_row->name; |
|
62 | - $period->uri = "/period/{$period_row->alias}/"; |
|
63 | - $period->count = $period_row->count; |
|
58 | + foreach($period_result as $period_row) |
|
59 | + { |
|
60 | + $period = new stdclass(); |
|
61 | + $period->name = $period_row->name; |
|
62 | + $period->uri = "/period/{$period_row->alias}/"; |
|
63 | + $period->count = $period_row->count; |
|
64 | 64 | |
65 | - $period_list[] = $period; |
|
66 | - } |
|
65 | + $period_list[] = $period; |
|
66 | + } |
|
67 | 67 | |
68 | - return array( |
|
69 | - 'companion_list' => $companion_list, |
|
70 | - 'period_list' => $period_list); |
|
71 | - } |
|
68 | + return array( |
|
69 | + 'companion_list' => $companion_list, |
|
70 | + 'period_list' => $period_list); |
|
71 | + } |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | \ No newline at end of file |
@@ -1,97 +1,97 @@ |
||
1 | 1 | <? |
2 | 2 | |
3 | 3 | Loader::load('collector', array( |
4 | - 'image/PhotoCollector', |
|
5 | - 'waterfall/WaterfallCollector')); |
|
4 | + 'image/PhotoCollector', |
|
5 | + 'waterfall/WaterfallCollector')); |
|
6 | 6 | Loader::load('controller', 'waterfalls/DefaultWaterfallListController'); |
7 | 7 | |
8 | 8 | final class WaterfallListController extends DefaultWaterfallListController |
9 | 9 | { |
10 | 10 | |
11 | - private static $PRIMARY_TITLE = 'Full Listing of Falls'; |
|
12 | - private static $PRIMARY_DESCRIPTION = 'List of waterfalls found in the general Keweenaw Area, complete with photos, descriptions, directions, and maps.'; |
|
13 | - private static $PRIMARY_INTRODUCTION_HEADER = 'A Giant List of Waterfalls'; |
|
14 | - private static $PRIMARY_INTRODUCTION_IMAGE = 2212; |
|
15 | - private static $PRIMARY_INTRODUCTION_DESCRIPTION = "Jacob has been to a lot of waterfalls. From the sandstone drops of Ontonagon to the volcanic plunges of the Huron Mountains to Keweenaw Ridge's craggy slides, he's gotten around. Some of the falls end up being surprising finds, numerous drops that are not documented anywhere else, while others end up being huge disappointments that barely warrant the long searches and planning stages."; |
|
16 | - |
|
17 | - private static $SECONDARY_TITLE = 'Falls Listing, Page %d of %d'; |
|
18 | - private static $SECONDARY_DESCRIPTION = 'Page %d of %d of waterfalls found in the general Keweenaw area.'; |
|
19 | - private static $SECONDARY_INTRODUCTION_HEADER = 'Page %d of %d of the full waterfall listing'; |
|
20 | - |
|
21 | - private static $KEYWORD_ARRAY = array( |
|
22 | - 'journal', |
|
23 | - 'stories', |
|
24 | - 'blog', |
|
25 | - 'waterfalls', |
|
26 | - 'hiking companions'); |
|
27 | - |
|
28 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d total waterfalls'; |
|
29 | - private static $LINK_ROOT = '/falls/'; |
|
30 | - |
|
31 | - protected function get_initial_meta() |
|
32 | - { |
|
33 | - $meta_array = array(); |
|
11 | + private static $PRIMARY_TITLE = 'Full Listing of Falls'; |
|
12 | + private static $PRIMARY_DESCRIPTION = 'List of waterfalls found in the general Keweenaw Area, complete with photos, descriptions, directions, and maps.'; |
|
13 | + private static $PRIMARY_INTRODUCTION_HEADER = 'A Giant List of Waterfalls'; |
|
14 | + private static $PRIMARY_INTRODUCTION_IMAGE = 2212; |
|
15 | + private static $PRIMARY_INTRODUCTION_DESCRIPTION = "Jacob has been to a lot of waterfalls. From the sandstone drops of Ontonagon to the volcanic plunges of the Huron Mountains to Keweenaw Ridge's craggy slides, he's gotten around. Some of the falls end up being surprising finds, numerous drops that are not documented anywhere else, while others end up being huge disappointments that barely warrant the long searches and planning stages."; |
|
16 | + |
|
17 | + private static $SECONDARY_TITLE = 'Falls Listing, Page %d of %d'; |
|
18 | + private static $SECONDARY_DESCRIPTION = 'Page %d of %d of waterfalls found in the general Keweenaw area.'; |
|
19 | + private static $SECONDARY_INTRODUCTION_HEADER = 'Page %d of %d of the full waterfall listing'; |
|
20 | + |
|
21 | + private static $KEYWORD_ARRAY = array( |
|
22 | + 'journal', |
|
23 | + 'stories', |
|
24 | + 'blog', |
|
25 | + 'waterfalls', |
|
26 | + 'hiking companions'); |
|
27 | + |
|
28 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d total waterfalls'; |
|
29 | + private static $LINK_ROOT = '/falls/'; |
|
30 | + |
|
31 | + protected function get_initial_meta() |
|
32 | + { |
|
33 | + $meta_array = array(); |
|
34 | 34 | |
35 | - $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
36 | - $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
|
37 | - $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
35 | + $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
36 | + $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
|
37 | + $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
38 | 38 | |
39 | - return $meta_array; |
|
40 | - } |
|
39 | + return $meta_array; |
|
40 | + } |
|
41 | 41 | |
42 | - protected function get_subsequent_meta() |
|
43 | - { |
|
44 | - $meta_array = array(); |
|
42 | + protected function get_subsequent_meta() |
|
43 | + { |
|
44 | + $meta_array = array(); |
|
45 | 45 | |
46 | - $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
47 | - $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
|
48 | - $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
46 | + $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
47 | + $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
|
48 | + $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
49 | 49 | |
50 | - return $meta_array; |
|
51 | - } |
|
50 | + return $meta_array; |
|
51 | + } |
|
52 | 52 | |
53 | - protected function get_initial_introduction() |
|
54 | - { |
|
55 | - $introduction = array(); |
|
53 | + protected function get_initial_introduction() |
|
54 | + { |
|
55 | + $introduction = array(); |
|
56 | 56 | |
57 | - $introduction['title'] = self::$PRIMARY_INTRODUCTION_HEADER; |
|
58 | - $introduction['description'] = self::$PRIMARY_INTRODUCTION_DESCRIPTION; |
|
57 | + $introduction['title'] = self::$PRIMARY_INTRODUCTION_HEADER; |
|
58 | + $introduction['description'] = self::$PRIMARY_INTRODUCTION_DESCRIPTION; |
|
59 | 59 | |
60 | - $image = PhotoCollector::getRow(self::$PRIMARY_INTRODUCTION_IMAGE); |
|
61 | - $introduction['image'] = $this->get_image_element($image->category, $image->name, $image->description, 'medium'); |
|
60 | + $image = PhotoCollector::getRow(self::$PRIMARY_INTRODUCTION_IMAGE); |
|
61 | + $introduction['image'] = $this->get_image_element($image->category, $image->name, $image->description, 'medium'); |
|
62 | 62 | |
63 | - return $introduction; |
|
64 | - } |
|
65 | - |
|
66 | - protected function get_subsequent_introduction() |
|
67 | - { |
|
68 | - return array( |
|
69 | - 'title' => sprintf(self::$SECONDARY_INTRODUCTION_HEADER, $this->page, $this->page_count)); |
|
70 | - } |
|
71 | - |
|
72 | - protected function get_page_number_piece() |
|
73 | - { |
|
74 | - return URLDecode::getPiece(2); |
|
75 | - } |
|
76 | - |
|
77 | - protected function get_item_result($total, $offset) |
|
78 | - { |
|
79 | - return WaterfallCollector::getList($total, $offset); |
|
80 | - } |
|
81 | - |
|
82 | - protected function get_item_count_result() |
|
83 | - { |
|
84 | - return WaterfallCollector::getListCount(); |
|
85 | - } |
|
86 | - |
|
87 | - protected function get_list_description_pattern() |
|
88 | - { |
|
89 | - return self::$NAVIGATION_DESCRIPTION; |
|
90 | - } |
|
91 | - |
|
92 | - protected function get_list_link_root() |
|
93 | - { |
|
94 | - return self::$LINK_ROOT; |
|
95 | - } |
|
63 | + return $introduction; |
|
64 | + } |
|
65 | + |
|
66 | + protected function get_subsequent_introduction() |
|
67 | + { |
|
68 | + return array( |
|
69 | + 'title' => sprintf(self::$SECONDARY_INTRODUCTION_HEADER, $this->page, $this->page_count)); |
|
70 | + } |
|
71 | + |
|
72 | + protected function get_page_number_piece() |
|
73 | + { |
|
74 | + return URLDecode::getPiece(2); |
|
75 | + } |
|
76 | + |
|
77 | + protected function get_item_result($total, $offset) |
|
78 | + { |
|
79 | + return WaterfallCollector::getList($total, $offset); |
|
80 | + } |
|
81 | + |
|
82 | + protected function get_item_count_result() |
|
83 | + { |
|
84 | + return WaterfallCollector::getListCount(); |
|
85 | + } |
|
86 | + |
|
87 | + protected function get_list_description_pattern() |
|
88 | + { |
|
89 | + return self::$NAVIGATION_DESCRIPTION; |
|
90 | + } |
|
91 | + |
|
92 | + protected function get_list_link_root() |
|
93 | + { |
|
94 | + return self::$LINK_ROOT; |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |
@@ -5,52 +5,52 @@ discard block |
||
5 | 5 | abstract class PageController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TRACKING_CODE = 'UA-11745070-1'; |
|
8 | + private static $TRACKING_CODE = 'UA-11745070-1'; |
|
9 | 9 | |
10 | - protected static $DEPRECATED_BLOGS = array( |
|
11 | - 10 => 63, |
|
12 | - 55 => 67, |
|
13 | - ); |
|
14 | - |
|
15 | - private $headers; |
|
16 | - private $css_array = array(); |
|
17 | - private $font_css_array = array(); |
|
18 | - private $js_array = array(); |
|
19 | - |
|
20 | - private $data_array = array(); |
|
21 | - private $body_view_array = array(); |
|
22 | - |
|
23 | - protected function set_head_data() {} |
|
24 | - protected function set_body_data() {} |
|
25 | - protected function set_data() {} |
|
26 | - |
|
27 | - public function __construct() |
|
28 | - { |
|
29 | - $this->set_header_method('sendHTML'); |
|
10 | + protected static $DEPRECATED_BLOGS = array( |
|
11 | + 10 => 63, |
|
12 | + 55 => 67, |
|
13 | + ); |
|
14 | + |
|
15 | + private $headers; |
|
16 | + private $css_array = array(); |
|
17 | + private $font_css_array = array(); |
|
18 | + private $js_array = array(); |
|
19 | + |
|
20 | + private $data_array = array(); |
|
21 | + private $body_view_array = array(); |
|
22 | + |
|
23 | + protected function set_head_data() {} |
|
24 | + protected function set_body_data() {} |
|
25 | + protected function set_data() {} |
|
26 | + |
|
27 | + public function __construct() |
|
28 | + { |
|
29 | + $this->set_header_method('sendHTML'); |
|
30 | 30 | |
31 | - $this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM'); |
|
32 | - $this->set_head('bing_verification', 'AF1A4CEA30A7589590E9294C4B512607'); |
|
31 | + $this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM'); |
|
32 | + $this->set_head('bing_verification', 'AF1A4CEA30A7589590E9294C4B512607'); |
|
33 | 33 | |
34 | - $this->set_body('domain_container', $this->get_domain_container()); |
|
35 | - $this->set_body('footer', array( |
|
36 | - 'link' => Loader::getRootUrl('site'), |
|
37 | - 'anchor' => 'jacobemerick.com', |
|
38 | - 'date' => date('Y'))); |
|
39 | - } |
|
40 | - |
|
41 | - protected function get_domain_container() |
|
42 | - { |
|
43 | - $domain_container = new stdclass(); |
|
34 | + $this->set_body('domain_container', $this->get_domain_container()); |
|
35 | + $this->set_body('footer', array( |
|
36 | + 'link' => Loader::getRootUrl('site'), |
|
37 | + 'anchor' => 'jacobemerick.com', |
|
38 | + 'date' => date('Y'))); |
|
39 | + } |
|
40 | + |
|
41 | + protected function get_domain_container() |
|
42 | + { |
|
43 | + $domain_container = new stdclass(); |
|
44 | 44 | |
45 | - $domain_container->blog = Loader::getRootUrl('blog'); |
|
46 | - $domain_container->home = Loader::getRootUrl('home'); |
|
47 | - $domain_container->lifestream = Loader::getRootUrl('lifestream'); |
|
48 | - $domain_container->map = Loader::getRootUrl('map'); |
|
49 | - $domain_container->portfolio = Loader::getRootUrl('portfolio'); |
|
50 | - $domain_container->waterfalls = Loader::getRootUrl('waterfalls'); |
|
45 | + $domain_container->blog = Loader::getRootUrl('blog'); |
|
46 | + $domain_container->home = Loader::getRootUrl('home'); |
|
47 | + $domain_container->lifestream = Loader::getRootUrl('lifestream'); |
|
48 | + $domain_container->map = Loader::getRootUrl('map'); |
|
49 | + $domain_container->portfolio = Loader::getRootUrl('portfolio'); |
|
50 | + $domain_container->waterfalls = Loader::getRootUrl('waterfalls'); |
|
51 | 51 | |
52 | - return $domain_container; |
|
53 | - } |
|
52 | + return $domain_container; |
|
53 | + } |
|
54 | 54 | |
55 | 55 | protected function get_recent_activity() |
56 | 56 | { |
@@ -84,24 +84,24 @@ discard block |
||
84 | 84 | return (object) $post; |
85 | 85 | } |
86 | 86 | |
87 | - public function activate() |
|
88 | - { |
|
89 | - $this->set_head_data(); |
|
90 | - $this->set_body_data(); |
|
91 | - $this->set_data(); |
|
87 | + public function activate() |
|
88 | + { |
|
89 | + $this->set_head_data(); |
|
90 | + $this->set_body_data(); |
|
91 | + $this->set_data(); |
|
92 | 92 | |
93 | - $this->load_assets(); |
|
93 | + $this->load_assets(); |
|
94 | 94 | |
95 | - $headers = $this->headers; |
|
96 | - Header::$headers(); |
|
97 | - Loader::load('view', '/Head', $this->data_array['head']); |
|
98 | - foreach($this->body_view_array as $view) |
|
99 | - { |
|
100 | - if(substr($view, 0, 1) == '/') |
|
101 | - Loader::load('view', $view, $this->data_array['body']); |
|
102 | - else |
|
103 | - Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
104 | - } |
|
95 | + $headers = $this->headers; |
|
96 | + Header::$headers(); |
|
97 | + Loader::load('view', '/Head', $this->data_array['head']); |
|
98 | + foreach($this->body_view_array as $view) |
|
99 | + { |
|
100 | + if(substr($view, 0, 1) == '/') |
|
101 | + Loader::load('view', $view, $this->data_array['body']); |
|
102 | + else |
|
103 | + Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
104 | + } |
|
105 | 105 | |
106 | 106 | if (URLDecode::getSite() == 'waterfalls') { |
107 | 107 | Loader::load('view', '/WaterfallFoot'); |
@@ -109,211 +109,211 @@ discard block |
||
109 | 109 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
110 | 110 | } |
111 | 111 | |
112 | - if($view == '/404' || $view == '/503') |
|
113 | - exit; |
|
114 | - } |
|
115 | - |
|
116 | - protected function set_header_method($method) |
|
117 | - { |
|
118 | - $this->headers = $method; |
|
119 | - } |
|
120 | - |
|
121 | - protected function set_title($value) |
|
122 | - { |
|
123 | - $this->set_head('title', $value); |
|
124 | - } |
|
125 | - |
|
126 | - protected function set_author($value) |
|
127 | - { |
|
128 | - $this->set_head('author', $value); |
|
129 | - } |
|
130 | - |
|
131 | - protected function set_description($value) |
|
132 | - { |
|
133 | - $this->set_head('description', $value); |
|
134 | - } |
|
135 | - |
|
136 | - protected function set_keywords($array) |
|
137 | - { |
|
138 | - $this->set_head('keywords', implode(', ', $array)); |
|
139 | - } |
|
112 | + if($view == '/404' || $view == '/503') |
|
113 | + exit; |
|
114 | + } |
|
115 | + |
|
116 | + protected function set_header_method($method) |
|
117 | + { |
|
118 | + $this->headers = $method; |
|
119 | + } |
|
120 | + |
|
121 | + protected function set_title($value) |
|
122 | + { |
|
123 | + $this->set_head('title', $value); |
|
124 | + } |
|
125 | + |
|
126 | + protected function set_author($value) |
|
127 | + { |
|
128 | + $this->set_head('author', $value); |
|
129 | + } |
|
130 | + |
|
131 | + protected function set_description($value) |
|
132 | + { |
|
133 | + $this->set_head('description', $value); |
|
134 | + } |
|
135 | + |
|
136 | + protected function set_keywords($array) |
|
137 | + { |
|
138 | + $this->set_head('keywords', implode(', ', $array)); |
|
139 | + } |
|
140 | 140 | |
141 | - protected function set_canonical($url) |
|
142 | - { |
|
143 | - $this->set_head('canonical', $url); |
|
144 | - } |
|
145 | - |
|
146 | - protected function set_head($set, $value) |
|
147 | - { |
|
148 | - $this->data_array['head'][$set] = $value; |
|
149 | - } |
|
150 | - |
|
151 | - protected function set_body($set, $value) |
|
152 | - { |
|
153 | - $this->data_array['body'][$set] = $value; |
|
154 | - } |
|
155 | - |
|
156 | - protected function add_css($file, $version = 1) |
|
157 | - { |
|
158 | - $this->css_array[] = [$file, $version]; |
|
159 | - } |
|
160 | - |
|
161 | - protected function add_js($file) |
|
162 | - { |
|
163 | - $this->js_array[] = $file; |
|
164 | - } |
|
165 | - |
|
166 | - private function load_assets() |
|
167 | - { |
|
141 | + protected function set_canonical($url) |
|
142 | + { |
|
143 | + $this->set_head('canonical', $url); |
|
144 | + } |
|
145 | + |
|
146 | + protected function set_head($set, $value) |
|
147 | + { |
|
148 | + $this->data_array['head'][$set] = $value; |
|
149 | + } |
|
150 | + |
|
151 | + protected function set_body($set, $value) |
|
152 | + { |
|
153 | + $this->data_array['body'][$set] = $value; |
|
154 | + } |
|
155 | + |
|
156 | + protected function add_css($file, $version = 1) |
|
157 | + { |
|
158 | + $this->css_array[] = [$file, $version]; |
|
159 | + } |
|
160 | + |
|
161 | + protected function add_js($file) |
|
162 | + { |
|
163 | + $this->js_array[] = $file; |
|
164 | + } |
|
165 | + |
|
166 | + private function load_assets() |
|
167 | + { |
|
168 | 168 | $css_array = array_map(function ($stylesheet) { |
169 | - $path = "/css/{$stylesheet[0]}.css"; |
|
170 | - if ($stylesheet[1] > 1) { |
|
169 | + $path = "/css/{$stylesheet[0]}.css"; |
|
170 | + if ($stylesheet[1] > 1) { |
|
171 | 171 | $path .= "?v={$stylesheet[1]}"; |
172 | - } |
|
173 | - return $path; |
|
172 | + } |
|
173 | + return $path; |
|
174 | 174 | }, $this->css_array); |
175 | 175 | $js_array = array_map(function ($script) { |
176 | - if (substr($script, 0, 4) == 'http') { |
|
176 | + if (substr($script, 0, 4) == 'http') { |
|
177 | 177 | return $script; |
178 | - } |
|
179 | - return "/js/{$script}.min.js"; |
|
178 | + } |
|
179 | + return "/js/{$script}.min.js"; |
|
180 | 180 | }, $this->js_array); |
181 | 181 | |
182 | - $this->set_head('css_link_array', $css_array); |
|
183 | - $this->set_head('js_link_array', $js_array); |
|
184 | - } |
|
185 | - |
|
186 | - protected function set_body_view($view) |
|
187 | - { |
|
188 | - $this->body_view_array[] = $view; |
|
189 | - } |
|
190 | - |
|
191 | - protected function eject() |
|
192 | - { |
|
193 | - if(get_class($this) !== 'Error404Controller') |
|
194 | - Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
195 | - } |
|
196 | - |
|
197 | - protected function unavailable() |
|
198 | - { |
|
199 | - if(get_class($this) !== 'Error503Controller') |
|
200 | - Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
201 | - } |
|
202 | - |
|
203 | - protected function redirect($uri, $method = 301) |
|
204 | - { |
|
205 | - switch($method) |
|
206 | - { |
|
207 | - case 301 : |
|
208 | - if(get_class($this) !== 'Error301Controller') |
|
209 | - Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
210 | - break; |
|
211 | - case 303 : |
|
212 | - if(get_class($this) !== 'Error303Controller') |
|
213 | - Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
214 | - break; |
|
215 | - } |
|
216 | - } |
|
217 | - |
|
218 | - final protected function get_parsed_date($date) |
|
219 | - { |
|
220 | - $parsed_date = new stdclass(); |
|
182 | + $this->set_head('css_link_array', $css_array); |
|
183 | + $this->set_head('js_link_array', $js_array); |
|
184 | + } |
|
185 | + |
|
186 | + protected function set_body_view($view) |
|
187 | + { |
|
188 | + $this->body_view_array[] = $view; |
|
189 | + } |
|
190 | + |
|
191 | + protected function eject() |
|
192 | + { |
|
193 | + if(get_class($this) !== 'Error404Controller') |
|
194 | + Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
195 | + } |
|
196 | + |
|
197 | + protected function unavailable() |
|
198 | + { |
|
199 | + if(get_class($this) !== 'Error503Controller') |
|
200 | + Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
201 | + } |
|
202 | + |
|
203 | + protected function redirect($uri, $method = 301) |
|
204 | + { |
|
205 | + switch($method) |
|
206 | + { |
|
207 | + case 301 : |
|
208 | + if(get_class($this) !== 'Error301Controller') |
|
209 | + Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
210 | + break; |
|
211 | + case 303 : |
|
212 | + if(get_class($this) !== 'Error303Controller') |
|
213 | + Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
214 | + break; |
|
215 | + } |
|
216 | + } |
|
217 | + |
|
218 | + final protected function get_parsed_date($date) |
|
219 | + { |
|
220 | + $parsed_date = new stdclass(); |
|
221 | 221 | |
222 | - $parsed_date->stamp = date('c', strtotime($date)); |
|
223 | - $parsed_date->friendly = date('F j, Y', strtotime($date)); |
|
224 | - $parsed_date->elapsed = Content::instance('ElapsedTime', $date)->activate(); |
|
222 | + $parsed_date->stamp = date('c', strtotime($date)); |
|
223 | + $parsed_date->friendly = date('F j, Y', strtotime($date)); |
|
224 | + $parsed_date->elapsed = Content::instance('ElapsedTime', $date)->activate(); |
|
225 | 225 | |
226 | - return $parsed_date; |
|
227 | - } |
|
228 | - |
|
229 | - private $comment_errors; |
|
230 | - protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
|
231 | - { |
|
232 | - if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
233 | - { |
|
234 | - $parameters = array($site_id, $path, $redirect_url, $page_title); |
|
235 | - $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate(); |
|
236 | - } |
|
226 | + return $parsed_date; |
|
227 | + } |
|
228 | + |
|
229 | + private $comment_errors; |
|
230 | + protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
|
231 | + { |
|
232 | + if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
233 | + { |
|
234 | + $parameters = array($site_id, $path, $redirect_url, $page_title); |
|
235 | + $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate(); |
|
236 | + } |
|
237 | 237 | |
238 | - return; |
|
239 | - } |
|
238 | + return; |
|
239 | + } |
|
240 | 240 | |
241 | - protected function get_comment_array($site, $path) |
|
242 | - { |
|
243 | - Loader::load('collector', 'comment/CommentCollector'); |
|
241 | + protected function get_comment_array($site, $path) |
|
242 | + { |
|
243 | + Loader::load('collector', 'comment/CommentCollector'); |
|
244 | 244 | |
245 | - $commenter = $this->get_commenter(); |
|
245 | + $commenter = $this->get_commenter(); |
|
246 | 246 | |
247 | - $comment_array = array(); |
|
248 | - $comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id); |
|
247 | + $comment_array = array(); |
|
248 | + $comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id); |
|
249 | 249 | |
250 | - foreach($comment_result as $comment) |
|
251 | - { |
|
252 | - $comment_object = new stdclass(); |
|
253 | - $comment_object->id = $comment->id; |
|
254 | - $comment_object->body = $comment->body_format; |
|
255 | - $comment_object->date = date("M j, 'y", strtotime($comment->date)); |
|
256 | - $comment_object->name = $comment->name; |
|
257 | - $comment_object->url = $comment->url; |
|
258 | - $comment_object->trusted = $comment->trusted; |
|
250 | + foreach($comment_result as $comment) |
|
251 | + { |
|
252 | + $comment_object = new stdclass(); |
|
253 | + $comment_object->id = $comment->id; |
|
254 | + $comment_object->body = $comment->body_format; |
|
255 | + $comment_object->date = date("M j, 'y", strtotime($comment->date)); |
|
256 | + $comment_object->name = $comment->name; |
|
257 | + $comment_object->url = $comment->url; |
|
258 | + $comment_object->trusted = $comment->trusted; |
|
259 | 259 | |
260 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
261 | - $comment_object->errors = $this->comment_errors; |
|
262 | - else |
|
263 | - $comment_object->errors = array(); |
|
260 | + if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
261 | + $comment_object->errors = $this->comment_errors; |
|
262 | + else |
|
263 | + $comment_object->errors = array(); |
|
264 | 264 | |
265 | - if($comment->reply == 0) |
|
266 | - { |
|
267 | - $comment_object->replies = array(); |
|
268 | - $comment_array[$comment->id] = $comment_object; |
|
269 | - } |
|
270 | - else |
|
271 | - $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
272 | - } |
|
265 | + if($comment->reply == 0) |
|
266 | + { |
|
267 | + $comment_object->replies = array(); |
|
268 | + $comment_array[$comment->id] = $comment_object; |
|
269 | + } |
|
270 | + else |
|
271 | + $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
272 | + } |
|
273 | 273 | |
274 | - $comment_count = CommentCollector::getCommentCountForURL($site, $path); |
|
274 | + $comment_count = CommentCollector::getCommentCountForURL($site, $path); |
|
275 | 275 | |
276 | - return array( |
|
277 | - 'comments' => $comment_array, |
|
278 | - 'commenter' => $commenter, |
|
279 | - 'errors' => $this->comment_errors, |
|
280 | - 'comment_count' => $comment_count); |
|
281 | - } |
|
276 | + return array( |
|
277 | + 'comments' => $comment_array, |
|
278 | + 'commenter' => $commenter, |
|
279 | + 'errors' => $this->comment_errors, |
|
280 | + 'comment_count' => $comment_count); |
|
281 | + } |
|
282 | 282 | |
283 | - private function get_commenter() |
|
284 | - { |
|
285 | - Loader::load('collector', 'comment/CommentCollector'); |
|
283 | + private function get_commenter() |
|
284 | + { |
|
285 | + Loader::load('collector', 'comment/CommentCollector'); |
|
286 | 286 | |
287 | - $commenter = new stdclass(); |
|
287 | + $commenter = new stdclass(); |
|
288 | 288 | |
289 | - $commenter->id = 0; |
|
290 | - $commenter->name = ''; |
|
291 | - $commenter->email = ''; |
|
292 | - $commenter->website = ''; |
|
289 | + $commenter->id = 0; |
|
290 | + $commenter->name = ''; |
|
291 | + $commenter->email = ''; |
|
292 | + $commenter->website = ''; |
|
293 | 293 | |
294 | 294 | if (!isset($_COOKIE['commenter'])) { |
295 | - return $commenter; |
|
295 | + return $commenter; |
|
296 | 296 | } |
297 | 297 | |
298 | - $commenter_cookie_value = json_decode($_COOKIE['commenter']); |
|
298 | + $commenter_cookie_value = json_decode($_COOKIE['commenter']); |
|
299 | 299 | |
300 | - if($commenter_cookie_value === NULL) |
|
301 | - return $commenter; |
|
300 | + if($commenter_cookie_value === NULL) |
|
301 | + return $commenter; |
|
302 | 302 | |
303 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
304 | - return $commenter; |
|
303 | + if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
304 | + return $commenter; |
|
305 | 305 | |
306 | - $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
|
306 | + $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
|
307 | 307 | |
308 | - if($commenter_object === NULL) |
|
309 | - return $commenter; |
|
308 | + if($commenter_object === NULL) |
|
309 | + return $commenter; |
|
310 | 310 | |
311 | - $commenter->id = $commenter_object->id; |
|
312 | - $commenter->name = $commenter_object->name; |
|
313 | - $commenter->email = $commenter_object->email; |
|
314 | - $commenter->website = $commenter_object->url; |
|
311 | + $commenter->id = $commenter_object->id; |
|
312 | + $commenter->name = $commenter_object->name; |
|
313 | + $commenter->email = $commenter_object->email; |
|
314 | + $commenter->website = $commenter_object->url; |
|
315 | 315 | |
316 | - return $commenter; |
|
317 | - } |
|
316 | + return $commenter; |
|
317 | + } |
|
318 | 318 | |
319 | 319 | } |
@@ -5,144 +5,144 @@ |
||
5 | 5 | final class TagController extends DefaultListController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = "%s Activity | Jacob Emerick's Lifestream"; |
|
9 | - private static $DESCRIPTION = "%s activity on Jacob Emerick's lifestream, all nice and paginated in one awesome website."; |
|
8 | + private static $TITLE = "%s Activity | Jacob Emerick's Lifestream"; |
|
9 | + private static $DESCRIPTION = "%s activity on Jacob Emerick's lifestream, all nice and paginated in one awesome website."; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array( |
|
12 | - 'lifestream', |
|
13 | - 'activity stream', |
|
14 | - 'Jacob Emerick'); |
|
11 | + private static $KEYWORD_ARRAY = array( |
|
12 | + 'lifestream', |
|
13 | + 'activity stream', |
|
14 | + 'Jacob Emerick'); |
|
15 | 15 | |
16 | - private static $LIST_DESCRIPTION = 'viewing %d - %d of %d %s activities'; |
|
16 | + private static $LIST_DESCRIPTION = 'viewing %d - %d of %d %s activities'; |
|
17 | 17 | |
18 | - private $tag; |
|
18 | + private $tag; |
|
19 | 19 | |
20 | - public function __construct() |
|
21 | - { |
|
22 | - parent::__construct(); |
|
20 | + public function __construct() |
|
21 | + { |
|
22 | + parent::__construct(); |
|
23 | 23 | |
24 | - $this->tag = URLDecode::getPiece(1); |
|
25 | - } |
|
24 | + $this->tag = URLDecode::getPiece(1); |
|
25 | + } |
|
26 | 26 | |
27 | - protected function set_head_data() |
|
28 | - { |
|
29 | - $this->set_title(sprintf(self::$TITLE, ucwords($this->tag))); |
|
30 | - $this->set_description(sprintf(self::$DESCRIPTION, ucwords($this->tag))); |
|
27 | + protected function set_head_data() |
|
28 | + { |
|
29 | + $this->set_title(sprintf(self::$TITLE, ucwords($this->tag))); |
|
30 | + $this->set_description(sprintf(self::$DESCRIPTION, ucwords($this->tag))); |
|
31 | 31 | |
32 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
33 | - array_unshift($keyword_array, $this->tag); |
|
34 | - $this->set_keywords($keyword_array); |
|
32 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
33 | + array_unshift($keyword_array, $this->tag); |
|
34 | + $this->set_keywords($keyword_array); |
|
35 | 35 | |
36 | - parent::set_head_data(); |
|
37 | - } |
|
36 | + parent::set_head_data(); |
|
37 | + } |
|
38 | 38 | |
39 | - protected function set_body_data() |
|
40 | - { |
|
41 | - $this->set_body('title', $this->get_title()); |
|
42 | - $this->set_body('description', $this->get_description()); |
|
39 | + protected function set_body_data() |
|
40 | + { |
|
41 | + $this->set_body('title', $this->get_title()); |
|
42 | + $this->set_body('description', $this->get_description()); |
|
43 | 43 | |
44 | - parent::set_body_data(); |
|
45 | - } |
|
46 | - |
|
47 | - private function get_title() |
|
48 | - { |
|
49 | - switch($this->tag) |
|
50 | - { |
|
51 | - case 'blog' : |
|
52 | - return 'Jacob has a Blog'; |
|
53 | - break; |
|
54 | - case 'book' : |
|
55 | - return 'Jacob reads Books'; |
|
56 | - break; |
|
57 | - case 'distance' : |
|
58 | - return 'Run, Jacob, and Hike'; |
|
59 | - break; |
|
60 | - case 'github' : |
|
44 | + parent::set_body_data(); |
|
45 | + } |
|
46 | + |
|
47 | + private function get_title() |
|
48 | + { |
|
49 | + switch($this->tag) |
|
50 | + { |
|
51 | + case 'blog' : |
|
52 | + return 'Jacob has a Blog'; |
|
53 | + break; |
|
54 | + case 'book' : |
|
55 | + return 'Jacob reads Books'; |
|
56 | + break; |
|
57 | + case 'distance' : |
|
58 | + return 'Run, Jacob, and Hike'; |
|
59 | + break; |
|
60 | + case 'github' : |
|
61 | 61 | return 'Jacob, Code Monkey'; |
62 | - break; |
|
63 | - case 'hulu' : |
|
64 | - return 'Jacob watches Hulu'; |
|
65 | - break; |
|
66 | - case 'twitter' : |
|
67 | - return 'Jacob likes to Tweet'; |
|
68 | - break; |
|
69 | - case 'youtube' : |
|
70 | - return 'Videos Jacob Likes'; |
|
71 | - break; |
|
72 | - } |
|
73 | - } |
|
74 | - |
|
75 | - private function get_description() |
|
76 | - { |
|
77 | - switch($this->tag) |
|
78 | - { |
|
79 | - case 'blog' : |
|
80 | - return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
|
81 | - break; |
|
82 | - case 'book' : |
|
83 | - return "Outside of building websites, hiking, and <em>being awesome</em>, Jacob reads books. Check out what he's been reading."; |
|
84 | - break; |
|
85 | - case 'distance' : |
|
86 | - return 'All the cool kids like to be in shape. Jacob goes running and hiking.'; |
|
87 | - break; |
|
88 | - case 'github' : |
|
62 | + break; |
|
63 | + case 'hulu' : |
|
64 | + return 'Jacob watches Hulu'; |
|
65 | + break; |
|
66 | + case 'twitter' : |
|
67 | + return 'Jacob likes to Tweet'; |
|
68 | + break; |
|
69 | + case 'youtube' : |
|
70 | + return 'Videos Jacob Likes'; |
|
71 | + break; |
|
72 | + } |
|
73 | + } |
|
74 | + |
|
75 | + private function get_description() |
|
76 | + { |
|
77 | + switch($this->tag) |
|
78 | + { |
|
79 | + case 'blog' : |
|
80 | + return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
|
81 | + break; |
|
82 | + case 'book' : |
|
83 | + return "Outside of building websites, hiking, and <em>being awesome</em>, Jacob reads books. Check out what he's been reading."; |
|
84 | + break; |
|
85 | + case 'distance' : |
|
86 | + return 'All the cool kids like to be in shape. Jacob goes running and hiking.'; |
|
87 | + break; |
|
88 | + case 'github' : |
|
89 | 89 | return 'Since he is trying to be a developer, Jacob codes. Here is some code that he pushed around on the Githubs.'; |
90 | - break; |
|
91 | - case 'hulu' : |
|
92 | - return 'Occasionally Jacob chills and watches some Hulu. Well, used to, anyways.'; |
|
93 | - break; |
|
94 | - case 'twitter' : |
|
95 | - return 'All the cool kids are on Twitter. The cool kids and Jacob. Check his tweets, yo.'; |
|
96 | - break; |
|
97 | - case 'youtube' : |
|
98 | - return 'Jacob watches videos on YouTube. Some videos he likes more than others.'; |
|
99 | - break; |
|
100 | - } |
|
101 | - } |
|
102 | - |
|
103 | - protected function get_page_number() |
|
104 | - { |
|
105 | - $page = URLDecode::getPiece(3); |
|
106 | - if(isset($page) && is_numeric($page)) |
|
107 | - return $page; |
|
108 | - return 1; |
|
109 | - } |
|
110 | - |
|
111 | - protected function get_list_results() |
|
112 | - { |
|
113 | - return $this->activityRepository->getActivitiesByType($this->tag, self::$POSTS_PER_PAGE, $this->offset); |
|
114 | - } |
|
115 | - |
|
116 | - protected function get_list_description() |
|
117 | - { |
|
118 | - $start = $this->offset + 1; |
|
119 | - $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
90 | + break; |
|
91 | + case 'hulu' : |
|
92 | + return 'Occasionally Jacob chills and watches some Hulu. Well, used to, anyways.'; |
|
93 | + break; |
|
94 | + case 'twitter' : |
|
95 | + return 'All the cool kids are on Twitter. The cool kids and Jacob. Check his tweets, yo.'; |
|
96 | + break; |
|
97 | + case 'youtube' : |
|
98 | + return 'Jacob watches videos on YouTube. Some videos he likes more than others.'; |
|
99 | + break; |
|
100 | + } |
|
101 | + } |
|
102 | + |
|
103 | + protected function get_page_number() |
|
104 | + { |
|
105 | + $page = URLDecode::getPiece(3); |
|
106 | + if(isset($page) && is_numeric($page)) |
|
107 | + return $page; |
|
108 | + return 1; |
|
109 | + } |
|
110 | + |
|
111 | + protected function get_list_results() |
|
112 | + { |
|
113 | + return $this->activityRepository->getActivitiesByType($this->tag, self::$POSTS_PER_PAGE, $this->offset); |
|
114 | + } |
|
115 | + |
|
116 | + protected function get_list_description() |
|
117 | + { |
|
118 | + $start = $this->offset + 1; |
|
119 | + $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
120 | 120 | |
121 | - return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->tag); |
|
122 | - } |
|
123 | - |
|
124 | - protected function get_list_next_link() |
|
125 | - { |
|
126 | - if($this->page == 1) |
|
127 | - return; |
|
128 | - if($this->page == 2) |
|
129 | - return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
130 | - return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
|
131 | - } |
|
132 | - |
|
133 | - protected function get_list_prev_link() |
|
134 | - { |
|
135 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
136 | - return; |
|
137 | - return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
|
138 | - } |
|
139 | - |
|
140 | - private $total_post_count; |
|
141 | - protected function get_total_post_count() |
|
142 | - { |
|
143 | - if(!isset($this->total_post_count)) |
|
144 | - $this->total_post_count = $this->activityRepository->getActivitiesByTypeCount($this->tag); |
|
145 | - return $this->total_post_count; |
|
146 | - } |
|
121 | + return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->tag); |
|
122 | + } |
|
123 | + |
|
124 | + protected function get_list_next_link() |
|
125 | + { |
|
126 | + if($this->page == 1) |
|
127 | + return; |
|
128 | + if($this->page == 2) |
|
129 | + return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
130 | + return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
|
131 | + } |
|
132 | + |
|
133 | + protected function get_list_prev_link() |
|
134 | + { |
|
135 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
136 | + return; |
|
137 | + return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
|
138 | + } |
|
139 | + |
|
140 | + private $total_post_count; |
|
141 | + protected function get_total_post_count() |
|
142 | + { |
|
143 | + if(!isset($this->total_post_count)) |
|
144 | + $this->total_post_count = $this->activityRepository->getActivitiesByTypeCount($this->tag); |
|
145 | + return $this->total_post_count; |
|
146 | + } |
|
147 | 147 | |
148 | 148 | } |
@@ -5,112 +5,112 @@ |
||
5 | 5 | final class PostController extends DefaultPageController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = "Post %d | %s Activity | Jacob Emerick's Lifestream"; |
|
9 | - private static $DESCRIPTION = "Post %d of %s activity on Jacob Emerick's Lifestream."; |
|
8 | + private static $TITLE = "Post %d | %s Activity | Jacob Emerick's Lifestream"; |
|
9 | + private static $DESCRIPTION = "Post %d of %s activity on Jacob Emerick's Lifestream."; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array( |
|
12 | - 'lifestream', |
|
13 | - 'activity stream', |
|
14 | - 'Jacob Emerick'); |
|
11 | + private static $KEYWORD_ARRAY = array( |
|
12 | + 'lifestream', |
|
13 | + 'activity stream', |
|
14 | + 'Jacob Emerick'); |
|
15 | 15 | |
16 | - private $post; |
|
16 | + private $post; |
|
17 | 17 | |
18 | - public function __construct() |
|
19 | - { |
|
20 | - parent::__construct(); |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + parent::__construct(); |
|
21 | 21 | |
22 | - $id = URLDecode::getPiece(2); |
|
23 | - if(!$id || !is_numeric($id)) |
|
24 | - $this->eject(); |
|
22 | + $id = URLDecode::getPiece(2); |
|
23 | + if(!$id || !is_numeric($id)) |
|
24 | + $this->eject(); |
|
25 | 25 | |
26 | - $post = $this->activityRepository->getActivityById($id); |
|
27 | - if(!$post) |
|
28 | - $this->eject(); |
|
26 | + $post = $this->activityRepository->getActivityById($id); |
|
27 | + if(!$post) |
|
28 | + $this->eject(); |
|
29 | 29 | |
30 | - if(URLDecode::getPiece(1) != $post['type']) |
|
31 | - $this->eject(); |
|
30 | + if(URLDecode::getPiece(1) != $post['type']) |
|
31 | + $this->eject(); |
|
32 | 32 | |
33 | - $this->post = $post; |
|
34 | - } |
|
33 | + $this->post = $post; |
|
34 | + } |
|
35 | 35 | |
36 | - protected function set_head_data() |
|
37 | - { |
|
38 | - $this->set_title(sprintf(self::$TITLE, $this->post['id'], ucwords($this->post['type']))); |
|
39 | - $this->set_description(sprintf(self::$DESCRIPTION, $this->post['id'], ucwords($this->post['type']))); |
|
36 | + protected function set_head_data() |
|
37 | + { |
|
38 | + $this->set_title(sprintf(self::$TITLE, $this->post['id'], ucwords($this->post['type']))); |
|
39 | + $this->set_description(sprintf(self::$DESCRIPTION, $this->post['id'], ucwords($this->post['type']))); |
|
40 | 40 | |
41 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
42 | - array_unshift($keyword_array, $this->post['type']); |
|
43 | - $this->set_keywords($keyword_array); |
|
41 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
42 | + array_unshift($keyword_array, $this->post['type']); |
|
43 | + $this->set_keywords($keyword_array); |
|
44 | 44 | |
45 | - parent::set_head_data(); |
|
46 | - } |
|
45 | + parent::set_head_data(); |
|
46 | + } |
|
47 | 47 | |
48 | - protected function set_body_data() |
|
49 | - { |
|
50 | - $this->set_body('title', $this->get_title()); |
|
51 | - $this->set_body('description', $this->get_description()); |
|
48 | + protected function set_body_data() |
|
49 | + { |
|
50 | + $this->set_body('title', $this->get_title()); |
|
51 | + $this->set_body('description', $this->get_description()); |
|
52 | 52 | |
53 | - $this->set_body('post', $this->expand_post($this->post, 'full')); |
|
54 | - $this->set_body('type', 'single'); |
|
55 | - $this->set_body('view', 'Post'); |
|
53 | + $this->set_body('post', $this->expand_post($this->post, 'full')); |
|
54 | + $this->set_body('type', 'single'); |
|
55 | + $this->set_body('view', 'Post'); |
|
56 | 56 | |
57 | - parent::set_body_data(); |
|
58 | - } |
|
57 | + parent::set_body_data(); |
|
58 | + } |
|
59 | 59 | |
60 | - private function get_title() |
|
61 | - { |
|
62 | - switch($this->post['type']) |
|
63 | - { |
|
64 | - case 'blog' : |
|
65 | - return 'Jacob blogged'; |
|
66 | - break; |
|
67 | - case 'book' : |
|
68 | - return 'Jacob read again'; |
|
69 | - break; |
|
70 | - case 'distance' : |
|
71 | - return 'Jacob ran xor hiked'; |
|
72 | - break; |
|
73 | - case 'github' : |
|
60 | + private function get_title() |
|
61 | + { |
|
62 | + switch($this->post['type']) |
|
63 | + { |
|
64 | + case 'blog' : |
|
65 | + return 'Jacob blogged'; |
|
66 | + break; |
|
67 | + case 'book' : |
|
68 | + return 'Jacob read again'; |
|
69 | + break; |
|
70 | + case 'distance' : |
|
71 | + return 'Jacob ran xor hiked'; |
|
72 | + break; |
|
73 | + case 'github' : |
|
74 | 74 | return 'Jacob did code'; |
75 | - break; |
|
76 | - case 'hulu' : |
|
77 | - return 'What Jacob watched'; |
|
78 | - break; |
|
79 | - case 'twitter' : |
|
80 | - return 'What Jacob tweeted'; |
|
81 | - break; |
|
82 | - case 'youtube' : |
|
83 | - return 'Jacob Liked a Video'; |
|
84 | - break; |
|
85 | - } |
|
86 | - } |
|
75 | + break; |
|
76 | + case 'hulu' : |
|
77 | + return 'What Jacob watched'; |
|
78 | + break; |
|
79 | + case 'twitter' : |
|
80 | + return 'What Jacob tweeted'; |
|
81 | + break; |
|
82 | + case 'youtube' : |
|
83 | + return 'Jacob Liked a Video'; |
|
84 | + break; |
|
85 | + } |
|
86 | + } |
|
87 | 87 | |
88 | - private function get_description() |
|
89 | - { |
|
90 | - switch($this->post['type']) |
|
91 | - { |
|
92 | - case 'blog' : |
|
93 | - return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
|
94 | - break; |
|
95 | - case 'book' : |
|
96 | - return "Yup, Jacob read another book. Don't tell his parents."; |
|
97 | - break; |
|
98 | - case 'distance' : |
|
99 | - return 'Well, it might have been both at the same time if there was a bear.'; |
|
100 | - break; |
|
101 | - case 'github' : |
|
88 | + private function get_description() |
|
89 | + { |
|
90 | + switch($this->post['type']) |
|
91 | + { |
|
92 | + case 'blog' : |
|
93 | + return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
|
94 | + break; |
|
95 | + case 'book' : |
|
96 | + return "Yup, Jacob read another book. Don't tell his parents."; |
|
97 | + break; |
|
98 | + case 'distance' : |
|
99 | + return 'Well, it might have been both at the same time if there was a bear.'; |
|
100 | + break; |
|
101 | + case 'github' : |
|
102 | 102 | return 'An epic code change by Jacob on the Githubs.'; |
103 | - break; |
|
104 | - case 'hulu' : |
|
105 | - return 'It was a cold, dark night, so Jacob watched something on Hulu.'; |
|
106 | - break; |
|
107 | - case 'twitter' : |
|
108 | - return 'Just another awesome insight/thought/RT/random from Jacob.'; |
|
109 | - break; |
|
110 | - case 'youtube' : |
|
111 | - return "This is a video that Jacob liked on Youtube. It's probably awesome. You should check it out."; |
|
112 | - break; |
|
113 | - } |
|
114 | - } |
|
103 | + break; |
|
104 | + case 'hulu' : |
|
105 | + return 'It was a cold, dark night, so Jacob watched something on Hulu.'; |
|
106 | + break; |
|
107 | + case 'twitter' : |
|
108 | + return 'Just another awesome insight/thought/RT/random from Jacob.'; |
|
109 | + break; |
|
110 | + case 'youtube' : |
|
111 | + return "This is a video that Jacob liked on Youtube. It's probably awesome. You should check it out."; |
|
112 | + break; |
|
113 | + } |
|
114 | + } |
|
115 | 115 | |
116 | 116 | } |
@@ -5,63 +5,63 @@ |
||
5 | 5 | abstract class DefaultListController extends DefaultPageController |
6 | 6 | { |
7 | 7 | |
8 | - protected static $POSTS_PER_PAGE = 15; |
|
8 | + protected static $POSTS_PER_PAGE = 15; |
|
9 | 9 | |
10 | - protected $page; |
|
11 | - protected $offset; |
|
10 | + protected $page; |
|
11 | + protected $offset; |
|
12 | 12 | |
13 | - public function __construct() |
|
14 | - { |
|
15 | - parent::__construct(); |
|
13 | + public function __construct() |
|
14 | + { |
|
15 | + parent::__construct(); |
|
16 | 16 | |
17 | - $this->page = $this->get_page_number(); |
|
18 | - $this->offset = ($this->page - 1) * self::$POSTS_PER_PAGE; |
|
19 | - } |
|
17 | + $this->page = $this->get_page_number(); |
|
18 | + $this->offset = ($this->page - 1) * self::$POSTS_PER_PAGE; |
|
19 | + } |
|
20 | 20 | |
21 | - abstract protected function get_page_number(); |
|
22 | - abstract protected function get_list_results(); |
|
23 | - abstract protected function get_list_description(); |
|
24 | - abstract protected function get_list_next_link(); |
|
25 | - abstract protected function get_list_prev_link(); |
|
26 | - abstract protected function get_total_post_count(); |
|
21 | + abstract protected function get_page_number(); |
|
22 | + abstract protected function get_list_results(); |
|
23 | + abstract protected function get_list_description(); |
|
24 | + abstract protected function get_list_next_link(); |
|
25 | + abstract protected function get_list_prev_link(); |
|
26 | + abstract protected function get_total_post_count(); |
|
27 | 27 | |
28 | - protected function set_head_data() |
|
29 | - { |
|
30 | - parent::set_head_data(); |
|
28 | + protected function set_head_data() |
|
29 | + { |
|
30 | + parent::set_head_data(); |
|
31 | 31 | |
32 | - $this->set_head('next_link', $this->get_list_next_link()); |
|
33 | - $this->set_head('previous_link', $this->get_list_prev_link()); |
|
34 | - } |
|
32 | + $this->set_head('next_link', $this->get_list_next_link()); |
|
33 | + $this->set_head('previous_link', $this->get_list_prev_link()); |
|
34 | + } |
|
35 | 35 | |
36 | - protected function set_body_data() |
|
37 | - { |
|
38 | - parent::set_body_data(); |
|
36 | + protected function set_body_data() |
|
37 | + { |
|
38 | + parent::set_body_data(); |
|
39 | 39 | |
40 | - $this->set_body('view', 'Listing'); |
|
41 | - $this->set_body('data', $this->get_list_body_data()); |
|
42 | - } |
|
40 | + $this->set_body('view', 'Listing'); |
|
41 | + $this->set_body('data', $this->get_list_body_data()); |
|
42 | + } |
|
43 | 43 | |
44 | - final private function get_list_body_data() |
|
45 | - { |
|
46 | - return array( |
|
47 | - 'posts' => $this->get_list_posts(), |
|
48 | - 'type' => 'list', |
|
49 | - 'pagination' => array( |
|
50 | - 'description' => $this->get_list_description(), |
|
51 | - 'next' => $this->get_list_next_link(), |
|
52 | - 'prev' => $this->get_list_prev_link())); |
|
53 | - } |
|
44 | + final private function get_list_body_data() |
|
45 | + { |
|
46 | + return array( |
|
47 | + 'posts' => $this->get_list_posts(), |
|
48 | + 'type' => 'list', |
|
49 | + 'pagination' => array( |
|
50 | + 'description' => $this->get_list_description(), |
|
51 | + 'next' => $this->get_list_next_link(), |
|
52 | + 'prev' => $this->get_list_prev_link())); |
|
53 | + } |
|
54 | 54 | |
55 | - final private function get_list_posts() |
|
56 | - { |
|
57 | - $post_array = array(); |
|
58 | - foreach($this->get_list_results() as $post) |
|
59 | - { |
|
60 | - $post_array[] = $this->expand_post($post, 'full'); |
|
61 | - } |
|
62 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | - $this->eject(); |
|
64 | - return $post_array; |
|
65 | - } |
|
55 | + final private function get_list_posts() |
|
56 | + { |
|
57 | + $post_array = array(); |
|
58 | + foreach($this->get_list_results() as $post) |
|
59 | + { |
|
60 | + $post_array[] = $this->expand_post($post, 'full'); |
|
61 | + } |
|
62 | + if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | + $this->eject(); |
|
64 | + return $post_array; |
|
65 | + } |
|
66 | 66 | |
67 | 67 | } |
@@ -6,25 +6,25 @@ |
||
6 | 6 | abstract class DefaultPageController extends PageController |
7 | 7 | { |
8 | 8 | |
9 | - protected $activityRepository; |
|
9 | + protected $activityRepository; |
|
10 | 10 | |
11 | - public function __construct() |
|
12 | - { |
|
11 | + public function __construct() |
|
12 | + { |
|
13 | 13 | parent::__construct(); |
14 | 14 | |
15 | 15 | global $container; |
16 | 16 | $this->activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']); |
17 | - } |
|
18 | - |
|
19 | - protected function set_head_data() |
|
20 | - { |
|
21 | - $this->add_css('normalize'); |
|
22 | - $this->add_css('lifestream', 2); |
|
23 | - } |
|
24 | - |
|
25 | - protected function set_body_data() |
|
26 | - { |
|
27 | - $this->set_body_view('Page'); |
|
28 | - } |
|
17 | + } |
|
18 | + |
|
19 | + protected function set_head_data() |
|
20 | + { |
|
21 | + $this->add_css('normalize'); |
|
22 | + $this->add_css('lifestream', 2); |
|
23 | + } |
|
24 | + |
|
25 | + protected function set_body_data() |
|
26 | + { |
|
27 | + $this->set_body_view('Page'); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | } |