@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | protected function get_list_results() |
| 47 | 47 | { |
| 48 | - return $this->activityRepository->getActivities(self::$POSTS_PER_PAGE, $this->offset); |
|
| 48 | + return $this->activityRepository->getActivities(self::$POSTS_PER_PAGE, $this->offset); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | protected function get_list_description() |
@@ -56,37 +56,37 @@ discard block |
||
| 56 | 56 | return $domain_container; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - protected function get_recent_activity() |
|
| 60 | - { |
|
| 61 | - global $container; |
|
| 62 | - $activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']); |
|
| 63 | - $post_result = $activityRepository->getActivities(5); |
|
| 64 | - |
|
| 65 | - $post_array = array(); |
|
| 66 | - foreach($post_result as $row) { |
|
| 67 | - array_push($post_array, $this->expand_post($row)); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - return $post_array; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - protected function expand_post($raw_post, $format = 'short') |
|
| 74 | - { |
|
| 75 | - $post = [ |
|
| 76 | - 'type' => $raw_post['type'], |
|
| 77 | - 'title' => ($format == 'short') ? $raw_post['message'] : $raw_post['message_long'], |
|
| 78 | - 'date' => $this->get_parsed_date($raw_post['datetime']), |
|
| 79 | - ]; |
|
| 80 | - |
|
| 81 | - if ($format != 'short') { |
|
| 82 | - $post['url'] = Loader::getRootUrl('lifestream') . "{$raw_post['type']}/{$raw_post['id']}/"; |
|
| 83 | - |
|
| 84 | - $metadata = json_decode($raw_post['metadata'], true); |
|
| 85 | - $post = array_merge($post, $metadata); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - return (object) $post; |
|
| 89 | - } |
|
| 59 | + protected function get_recent_activity() |
|
| 60 | + { |
|
| 61 | + global $container; |
|
| 62 | + $activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']); |
|
| 63 | + $post_result = $activityRepository->getActivities(5); |
|
| 64 | + |
|
| 65 | + $post_array = array(); |
|
| 66 | + foreach($post_result as $row) { |
|
| 67 | + array_push($post_array, $this->expand_post($row)); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + return $post_array; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + protected function expand_post($raw_post, $format = 'short') |
|
| 74 | + { |
|
| 75 | + $post = [ |
|
| 76 | + 'type' => $raw_post['type'], |
|
| 77 | + 'title' => ($format == 'short') ? $raw_post['message'] : $raw_post['message_long'], |
|
| 78 | + 'date' => $this->get_parsed_date($raw_post['datetime']), |
|
| 79 | + ]; |
|
| 80 | + |
|
| 81 | + if ($format != 'short') { |
|
| 82 | + $post['url'] = Loader::getRootUrl('lifestream') . "{$raw_post['type']}/{$raw_post['id']}/"; |
|
| 83 | + |
|
| 84 | + $metadata = json_decode($raw_post['metadata'], true); |
|
| 85 | + $post = array_merge($post, $metadata); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + return (object) $post; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | 91 | public function activate() |
| 92 | 92 | { |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (URLDecode::getSite() == 'waterfalls') { |
|
| 111 | - Loader::load('view', '/WaterfallFoot'); |
|
| 112 | - } else { |
|
| 113 | - Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
| 114 | - } |
|
| 110 | + if (URLDecode::getSite() == 'waterfalls') { |
|
| 111 | + Loader::load('view', '/WaterfallFoot'); |
|
| 112 | + } else { |
|
| 113 | + Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | 116 | if($view == '/404' || $view == '/503') |
| 117 | 117 | exit; |
@@ -169,19 +169,19 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | private function load_assets() |
| 171 | 171 | { |
| 172 | - $css_array = array_map(function ($stylesheet) { |
|
| 173 | - $path = "/css/{$stylesheet[0]}.css"; |
|
| 174 | - if ($stylesheet[1] > 1) { |
|
| 175 | - $path .= "?v={$stylesheet[1]}"; |
|
| 176 | - } |
|
| 177 | - return $path; |
|
| 178 | - }, $this->css_array); |
|
| 179 | - $js_array = array_map(function ($script) { |
|
| 180 | - if (substr($script, 0, 4) == 'http') { |
|
| 181 | - return $script; |
|
| 182 | - } |
|
| 183 | - return "/js/{$script}.min.js"; |
|
| 184 | - }, $this->js_array); |
|
| 172 | + $css_array = array_map(function ($stylesheet) { |
|
| 173 | + $path = "/css/{$stylesheet[0]}.css"; |
|
| 174 | + if ($stylesheet[1] > 1) { |
|
| 175 | + $path .= "?v={$stylesheet[1]}"; |
|
| 176 | + } |
|
| 177 | + return $path; |
|
| 178 | + }, $this->css_array); |
|
| 179 | + $js_array = array_map(function ($script) { |
|
| 180 | + if (substr($script, 0, 4) == 'http') { |
|
| 181 | + return $script; |
|
| 182 | + } |
|
| 183 | + return "/js/{$script}.min.js"; |
|
| 184 | + }, $this->js_array); |
|
| 185 | 185 | |
| 186 | 186 | $this->set_head('css_link_array', $css_array); |
| 187 | 187 | $this->set_head('js_link_array', $js_array); |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | case 'distance' : |
| 58 | 58 | return 'Run, Jacob, and Hike'; |
| 59 | 59 | break; |
| 60 | - case 'github' : |
|
| 61 | - return 'Jacob, Code Monkey'; |
|
| 62 | - break; |
|
| 60 | + case 'github' : |
|
| 61 | + return 'Jacob, Code Monkey'; |
|
| 62 | + break; |
|
| 63 | 63 | case 'hulu' : |
| 64 | 64 | return 'Jacob watches Hulu'; |
| 65 | 65 | break; |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | case 'distance' : |
| 86 | 86 | return 'All the cool kids like to be in shape. Jacob goes running and hiking.'; |
| 87 | 87 | break; |
| 88 | - case 'github' : |
|
| 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; |
|
| 88 | + case 'github' : |
|
| 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 | 91 | case 'hulu' : |
| 92 | 92 | return 'Occasionally Jacob chills and watches some Hulu. Well, used to, anyways.'; |
| 93 | 93 | break; |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | case 'distance' : |
| 71 | 71 | return 'Jacob ran xor hiked'; |
| 72 | 72 | break; |
| 73 | - case 'github' : |
|
| 74 | - return 'Jacob did code'; |
|
| 75 | - break; |
|
| 73 | + case 'github' : |
|
| 74 | + return 'Jacob did code'; |
|
| 75 | + break; |
|
| 76 | 76 | case 'hulu' : |
| 77 | 77 | return 'What Jacob watched'; |
| 78 | 78 | break; |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | case 'distance' : |
| 99 | 99 | return 'Well, it might have been both at the same time if there was a bear.'; |
| 100 | 100 | break; |
| 101 | - case 'github' : |
|
| 102 | - return 'An epic code change by Jacob on the Githubs.'; |
|
| 103 | - break; |
|
| 101 | + case 'github' : |
|
| 102 | + return 'An epic code change by Jacob on the Githubs.'; |
|
| 103 | + break; |
|
| 104 | 104 | case 'hulu' : |
| 105 | 105 | return 'It was a cold, dark night, so Jacob watched something on Hulu.'; |
| 106 | 106 | break; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | (object) array( |
| 20 | 20 | 'match' => '/get/portfolioImage.json', |
| 21 | 21 | 'controller' => 'GetPortfolioImageController'), |
| 22 | - ); |
|
| 22 | + ); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | } |
@@ -46,16 +46,16 @@ |
||
| 46 | 46 | 'value' => Request::getPost()); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - global $container; |
|
| 50 | - $sent = $container['mail'] |
|
| 51 | - ->addTo($container['config']->admin_email) |
|
| 52 | - ->setSubject('Site Contact') |
|
| 53 | - ->setPlainMessage( |
|
| 54 | - 'Name: ' . Request::getPost('name') . "\n" . |
|
| 55 | - 'Email: ' . Request::getPost('email') . "\n" . |
|
| 56 | - 'Message: ' . Request::getPost('message') |
|
| 57 | - ) |
|
| 58 | - ->send(); |
|
| 49 | + global $container; |
|
| 50 | + $sent = $container['mail'] |
|
| 51 | + ->addTo($container['config']->admin_email) |
|
| 52 | + ->setSubject('Site Contact') |
|
| 53 | + ->setPlainMessage( |
|
| 54 | + 'Name: ' . Request::getPost('name') . "\n" . |
|
| 55 | + 'Email: ' . Request::getPost('email') . "\n" . |
|
| 56 | + 'Message: ' . Request::getPost('message') |
|
| 57 | + ) |
|
| 58 | + ->send(); |
|
| 59 | 59 | |
| 60 | 60 | return array( |
| 61 | 61 | 'success_message' => "Thank you for your message, " . Request::getPost('name') . "! I'll get back to you as soon as possible."); |
@@ -44,16 +44,16 @@ |
||
| 44 | 44 | 'value' => Request::getPost()); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - global $container; |
|
| 48 | - $sent = $container['mail'] |
|
| 49 | - ->addTo($container['config']->admin_email) |
|
| 50 | - ->setSubject('Portfolio Contact') |
|
| 51 | - ->setPlainMessage( |
|
| 52 | - 'Name: ' . Request::getPost('name') . "\n" . |
|
| 53 | - 'Email: ' . Request::getPost('email') . "\n" . |
|
| 54 | - 'Message: ' . Request::getPost('message') |
|
| 55 | - ) |
|
| 56 | - ->send(); |
|
| 47 | + global $container; |
|
| 48 | + $sent = $container['mail'] |
|
| 49 | + ->addTo($container['config']->admin_email) |
|
| 50 | + ->setSubject('Portfolio Contact') |
|
| 51 | + ->setPlainMessage( |
|
| 52 | + 'Name: ' . Request::getPost('name') . "\n" . |
|
| 53 | + 'Email: ' . Request::getPost('email') . "\n" . |
|
| 54 | + 'Message: ' . Request::getPost('message') |
|
| 55 | + ) |
|
| 56 | + ->send(); |
|
| 57 | 57 | |
| 58 | 58 | return array( |
| 59 | 59 | 'success_message' => "Thank you for your message, ".Request::getPost('name')."! I'll get back to you as soon as possible."); |
@@ -58,16 +58,16 @@ |
||
| 58 | 58 | 'values' => $values); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - global $container; |
|
| 62 | - $sent = $container['mail'] |
|
| 63 | - ->addTo($container['config']->admin_email) |
|
| 64 | - ->setSubject('Waterfall Site Contact') |
|
| 65 | - ->setPlainMessage( |
|
| 66 | - "Name: {$values->name}\n" . |
|
| 67 | - "Email: {$values->email}\n" . |
|
| 68 | - "Message: {$values->message}" |
|
| 69 | - ) |
|
| 70 | - ->send(); |
|
| 61 | + global $container; |
|
| 62 | + $sent = $container['mail'] |
|
| 63 | + ->addTo($container['config']->admin_email) |
|
| 64 | + ->setSubject('Waterfall Site Contact') |
|
| 65 | + ->setPlainMessage( |
|
| 66 | + "Name: {$values->name}\n" . |
|
| 67 | + "Email: {$values->email}\n" . |
|
| 68 | + "Message: {$values->message}" |
|
| 69 | + ) |
|
| 70 | + ->send(); |
|
| 71 | 71 | |
| 72 | 72 | return (object) array('display' => 'success'); |
| 73 | 73 | } |
@@ -60,16 +60,16 @@ |
||
| 60 | 60 | 'values' => $values); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - global $container; |
|
| 64 | - $sent = $container['mail'] |
|
| 65 | - ->addTo($container['config']->admin_email) |
|
| 66 | - ->setSubject('Home Page Contact') |
|
| 67 | - ->setPlainMessage( |
|
| 68 | - "Name: {$values->name}\n" . |
|
| 69 | - "Email: {$values->email}\n" . |
|
| 70 | - "Message: {$values->message}" |
|
| 71 | - ) |
|
| 72 | - ->send(); |
|
| 63 | + global $container; |
|
| 64 | + $sent = $container['mail'] |
|
| 65 | + ->addTo($container['config']->admin_email) |
|
| 66 | + ->setSubject('Home Page Contact') |
|
| 67 | + ->setPlainMessage( |
|
| 68 | + "Name: {$values->name}\n" . |
|
| 69 | + "Email: {$values->email}\n" . |
|
| 70 | + "Message: {$values->message}" |
|
| 71 | + ) |
|
| 72 | + ->send(); |
|
| 73 | 73 | |
| 74 | 74 | return (object) array('display' => 'success'); |
| 75 | 75 | } |