@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class PhotoCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class PhotoCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function fetchRow($category, $photo) |
|
| 9 | - { |
|
| 8 | + public static function fetchRow($category, $photo) |
|
| 9 | + {
|
|
| 10 | 10 | $query = " |
| 11 | 11 | SELECT |
| 12 | 12 | `photo`.`name`, |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | return self::run_row_query($query); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public static function getRow($id) |
|
| 31 | - { |
|
| 30 | + public static function getRow($id) |
|
| 31 | + {
|
|
| 32 | 32 | $query = " |
| 33 | 33 | SELECT |
| 34 | 34 | `photo`.`name`, |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class CountyCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class CountyCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getByAlias($alias) |
|
| 9 | - { |
|
| 8 | + public static function getByAlias($alias) |
|
| 9 | + {
|
|
| 10 | 10 | $alias = self::escape($alias); |
| 11 | 11 | |
| 12 | 12 | $query = " |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | return self::run_row_query($query); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public static function getCountyList() |
|
| 39 | - { |
|
| 38 | + public static function getCountyList() |
|
| 39 | + {
|
|
| 40 | 40 | $query = " |
| 41 | 41 | SELECT |
| 42 | 42 | `county`.`name`, |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | return self::run_query($query); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public static function getLogListForCounty($county, $total, $offset = 0) |
|
| 61 | - { |
|
| 60 | + public static function getLogListForCounty($county, $total, $offset = 0) |
|
| 61 | + {
|
|
| 62 | 62 | $query = " |
| 63 | 63 | SELECT |
| 64 | 64 | `waterfall`.`id`, |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | return self::run_query($query); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - public static function getLogCountForCounty($county) |
|
| 100 | - { |
|
| 99 | + public static function getLogCountForCounty($county) |
|
| 100 | + {
|
|
| 101 | 101 | $query = " |
| 102 | 102 | SELECT |
| 103 | 103 | COUNT(1) AS `count` |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class WaterfallCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class WaterfallCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getList($total, $offset = 0) |
|
| 9 | - { |
|
| 8 | + public static function getList($total, $offset = 0) |
|
| 9 | + {
|
|
| 10 | 10 | $query = " |
| 11 | 11 | SELECT |
| 12 | 12 | `waterfall`.`id`, |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | return self::run_query($query); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public static function getMapList() |
|
| 47 | - { |
|
| 46 | + public static function getMapList() |
|
| 47 | + {
|
|
| 48 | 48 | $query = " |
| 49 | 49 | SELECT |
| 50 | 50 | `waterfall`.`name`, |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | return self::run_query($query); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public static function getListCount() |
|
| 78 | - { |
|
| 77 | + public static function getListCount() |
|
| 78 | + {
|
|
| 79 | 79 | $query = " |
| 80 | 80 | SELECT |
| 81 | 81 | COUNT(1) AS `count` |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | return self::get_count($query); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public static function getNearbyList($waterfall) |
|
| 96 | - { |
|
| 95 | + public static function getNearbyList($waterfall) |
|
| 96 | + {
|
|
| 97 | 97 | $query = " |
| 98 | 98 | SELECT |
| 99 | 99 | `waterfall`.`name`, |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | return self::run_query($query); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - public static function getByOldAlias($alias) |
|
| 121 | - { |
|
| 120 | + public static function getByOldAlias($alias) |
|
| 121 | + {
|
|
| 122 | 122 | $alias = self::escape($alias); |
| 123 | 123 | |
| 124 | 124 | $query = " |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | return self::run_row_query($query); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public static function getByAlias($watercourse, $waterfall) |
|
| 141 | - { |
|
| 140 | + public static function getByAlias($watercourse, $waterfall) |
|
| 141 | + {
|
|
| 142 | 142 | $watercourse = self::escape($watercourse); |
| 143 | 143 | $waterfall = self::escape($waterfall); |
| 144 | 144 | |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class WatercourseCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class WatercourseCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getById($id) |
|
| 9 | - { |
|
| 8 | + public static function getById($id) |
|
| 9 | + {
|
|
| 10 | 10 | $query = " |
| 11 | 11 | SELECT |
| 12 | 12 | `watercourse`.`name`, |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | return self::run_row_query($query); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public static function getByAlias($alias) |
|
| 24 | - { |
|
| 23 | + public static function getByAlias($alias) |
|
| 24 | + {
|
|
| 25 | 25 | $alias = self::escape($alias); |
| 26 | 26 | |
| 27 | 27 | $query = " |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | return self::run_row_query($query); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public static function getWatercourseList() |
|
| 55 | - { |
|
| 54 | + public static function getWatercourseList() |
|
| 55 | + {
|
|
| 56 | 56 | $query = " |
| 57 | 57 | SELECT |
| 58 | 58 | `sum_table`.`name`, |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | return self::run_query($query); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - public static function getLogListForWatercourse($watercourse, $total, $offset = 0) |
|
| 118 | - { |
|
| 117 | + public static function getLogListForWatercourse($watercourse, $total, $offset = 0) |
|
| 118 | + {
|
|
| 119 | 119 | $query = " |
| 120 | 120 | SELECT |
| 121 | 121 | `waterfall`.`id`, |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | return self::run_query($query); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - public static function getParentWatercourse($watercourse) |
|
| 157 | - { |
|
| 156 | + public static function getParentWatercourse($watercourse) |
|
| 157 | + {
|
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - public static function getLogCountForWatercourse($watercourse) |
|
| 161 | - { |
|
| 160 | + public static function getLogCountForWatercourse($watercourse) |
|
| 161 | + {
|
|
| 162 | 162 | $query = " |
| 163 | 163 | SELECT |
| 164 | 164 | SUM(`count`) AS `count` |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class LogTagCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class LogTagCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getTag($alias) |
|
| 9 | - { |
|
| 8 | + public static function getTag($alias) |
|
| 9 | + {
|
|
| 10 | 10 | $alias = self::escape($alias); |
| 11 | 11 | |
| 12 | 12 | $query = " |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | return self::run_row_query($query); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public static function getLogListForTag($tag, $total, $offset = 0) |
|
| 27 | - { |
|
| 26 | + public static function getLogListForTag($tag, $total, $offset = 0) |
|
| 27 | + {
|
|
| 28 | 28 | $query = " |
| 29 | 29 | SELECT |
| 30 | 30 | `log`.`id`, |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | return self::run_query($query); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public static function getLogCountForTag($tag) |
|
| 61 | - { |
|
| 60 | + public static function getLogCountForTag($tag) |
|
| 61 | + {
|
|
| 62 | 62 | $query = " |
| 63 | 63 | SELECT |
| 64 | 64 | COUNT(1) AS `count` |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class LogCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class LogCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getList($total, $offset = 0) |
|
| 9 | - { |
|
| 8 | + public static function getList($total, $offset = 0) |
|
| 9 | + {
|
|
| 10 | 10 | $query = " |
| 11 | 11 | SELECT |
| 12 | 12 | `log`.`id`, |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | return self::run_query($query); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public static function getRecentList($total) |
|
| 38 | - { |
|
| 37 | + public static function getRecentList($total) |
|
| 38 | + {
|
|
| 39 | 39 | $query = " |
| 40 | 40 | SELECT |
| 41 | 41 | `log`.`title`, |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | return self::run_query($query); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - public static function getListCount() |
|
| 66 | - { |
|
| 65 | + public static function getListCount() |
|
| 66 | + {
|
|
| 67 | 67 | $query = " |
| 68 | 68 | SELECT |
| 69 | 69 | COUNT(1) AS `count` |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | return self::get_count($query); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public static function getCompanionListForLog($log) |
|
| 78 | - { |
|
| 77 | + public static function getCompanionListForLog($log) |
|
| 78 | + {
|
|
| 79 | 79 | $query = " |
| 80 | 80 | SELECT |
| 81 | 81 | `companion`.`name`, |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | return self::run_query($query); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - public static function getWaterfallListForLog($log) |
|
| 94 | - { |
|
| 93 | + public static function getWaterfallListForLog($log) |
|
| 94 | + {
|
|
| 95 | 95 | $query = " |
| 96 | 96 | SELECT |
| 97 | 97 | `waterfall`.`name`, |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | return self::run_query($query); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - public static function getLogListForWaterfall($waterfall) |
|
| 117 | - { |
|
| 116 | + public static function getLogListForWaterfall($waterfall) |
|
| 117 | + {
|
|
| 118 | 118 | $query = " |
| 119 | 119 | SELECT |
| 120 | 120 | `log`.`title`, |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | return self::run_query($query); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - public static function getTagListForLog($log) |
|
| 137 | - { |
|
| 136 | + public static function getTagListForLog($log) |
|
| 137 | + {
|
|
| 138 | 138 | $query = " |
| 139 | 139 | SELECT |
| 140 | 140 | `tag`.`name`, |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | return self::run_query($query); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - public static function getByAlias($alias) |
|
| 151 | - { |
|
| 150 | + public static function getByAlias($alias) |
|
| 151 | + {
|
|
| 152 | 152 | $alias = self::escape($alias); |
| 153 | 153 | |
| 154 | 154 | $query = " |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | return self::run_row_query($query); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - public static function getByDate($date) |
|
| 182 | - { |
|
| 181 | + public static function getByDate($date) |
|
| 182 | + {
|
|
| 183 | 183 | $date = self::escape($date); |
| 184 | 184 | |
| 185 | 185 | $query = " |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | return self::run_row_query($query); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - public static function getById($log) |
|
| 199 | - { |
|
| 198 | + public static function getById($log) |
|
| 199 | + {
|
|
| 200 | 200 | $query = " |
| 201 | 201 | SELECT |
| 202 | 202 | `title`, |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | return self::run_row_query($query); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - public static function getPreviousLog($log) |
|
| 215 | - { |
|
| 214 | + public static function getPreviousLog($log) |
|
| 215 | + {
|
|
| 216 | 216 | $query = " |
| 217 | 217 | SELECT |
| 218 | 218 | `title`, |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | return self::run_row_query($query); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - public static function getNextLog($log) |
|
| 240 | - { |
|
| 239 | + public static function getNextLog($log) |
|
| 240 | + {
|
|
| 241 | 241 | $query = " |
| 242 | 242 | SELECT |
| 243 | 243 | `title`, |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class CompanionCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class CompanionCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getByAlias($alias) |
|
| 9 | - { |
|
| 8 | + public static function getByAlias($alias) |
|
| 9 | + {
|
|
| 10 | 10 | $alias = self::escape($alias); |
| 11 | 11 | |
| 12 | 12 | $query = " |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | return self::run_row_query($query); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public static function getCompanionList() |
|
| 39 | - { |
|
| 38 | + public static function getCompanionList() |
|
| 39 | + {
|
|
| 40 | 40 | $query = " |
| 41 | 41 | SELECT |
| 42 | 42 | `companion`.`name`, |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | return self::run_query($query); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - public static function getLogListForCompanion($companion, $total, $offset = 0) |
|
| 64 | - { |
|
| 63 | + public static function getLogListForCompanion($companion, $total, $offset = 0) |
|
| 64 | + {
|
|
| 65 | 65 | $query = " |
| 66 | 66 | SELECT |
| 67 | 67 | `log`.`id`, |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | return self::run_query($query); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public static function getLogCountForCompanion($companion) |
|
| 97 | - { |
|
| 96 | + public static function getLogCountForCompanion($companion) |
|
| 97 | + {
|
|
| 98 | 98 | $query = " |
| 99 | 99 | SELECT |
| 100 | 100 | COUNT(1) AS `count` |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('collector', 'Collector'); |
| 4 | 4 | |
| 5 | -final class PeriodCollector extends Collector |
|
| 6 | -{ |
|
| 5 | +final class PeriodCollector extends Collector |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | - public static function getByAlias($alias) |
|
| 9 | - { |
|
| 8 | + public static function getByAlias($alias) |
|
| 9 | + {
|
|
| 10 | 10 | $alias = self::escape($alias); |
| 11 | 11 | |
| 12 | 12 | $query = " |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | return self::run_row_query($query); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public static function getPeriodList() |
|
| 38 | - { |
|
| 37 | + public static function getPeriodList() |
|
| 38 | + {
|
|
| 39 | 39 | $query = " |
| 40 | 40 | SELECT |
| 41 | 41 | `period`.`name`, |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | return self::run_query($query); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - public static function getLogListForPeriod($period, $total, $offset = 0) |
|
| 59 | - { |
|
| 58 | + public static function getLogListForPeriod($period, $total, $offset = 0) |
|
| 59 | + {
|
|
| 60 | 60 | $query = " |
| 61 | 61 | SELECT |
| 62 | 62 | `log`.`id`, |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | return self::run_query($query); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - public static function getLogCountForPeriod($period) |
|
| 90 | - { |
|
| 89 | + public static function getLogCountForPeriod($period) |
|
| 90 | + {
|
|
| 91 | 91 | $query = " |
| 92 | 92 | SELECT |
| 93 | 93 | COUNT(1) AS `count` |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Loader::load('utility', 'Header'); |
| 4 | 4 | |
| 5 | -abstract class PageController |
|
| 6 | -{ |
|
| 5 | +abstract class PageController |
|
| 6 | +{
|
|
| 7 | 7 | |
| 8 | 8 | private static $TRACKING_CODE = 'UA-11745070-1'; |
| 9 | 9 | |
@@ -20,12 +20,18 @@ discard block |
||
| 20 | 20 | private $data_array = array(); |
| 21 | 21 | private $body_view_array = array(); |
| 22 | 22 | |
| 23 | - protected function set_head_data() {} |
|
| 24 | - protected function set_body_data() {} |
|
| 25 | - protected function set_data() {} |
|
| 23 | + protected function set_head_data() |
|
| 24 | + {
|
|
| 25 | +} |
|
| 26 | + protected function set_body_data() |
|
| 27 | + {
|
|
| 28 | +} |
|
| 29 | + protected function set_data() |
|
| 30 | + {
|
|
| 31 | +} |
|
| 26 | 32 | |
| 27 | - public function __construct() |
|
| 28 | - { |
|
| 33 | + public function __construct() |
|
| 34 | + {
|
|
| 29 | 35 | $this->set_header_method('sendHTML'); |
| 30 | 36 | |
| 31 | 37 | $this->set_head('google_verification', 'sgAISiuoWfK54KXnOfm2oU4vQdad8eyNCQX7LkZ1OxM'); |
@@ -38,8 +44,8 @@ discard block |
||
| 38 | 44 | 'date' => date('Y'))); |
| 39 | 45 | } |
| 40 | 46 | |
| 41 | - protected function get_domain_container() |
|
| 42 | - { |
|
| 47 | + protected function get_domain_container() |
|
| 48 | + {
|
|
| 43 | 49 | $domain_container = new stdclass(); |
| 44 | 50 | |
| 45 | 51 | $domain_container->blog = Loader::getRootUrl('blog'); |
@@ -52,8 +58,8 @@ discard block |
||
| 52 | 58 | return $domain_container; |
| 53 | 59 | } |
| 54 | 60 | |
| 55 | - protected function get_recent_activity() |
|
| 56 | - { |
|
| 61 | + protected function get_recent_activity() |
|
| 62 | + {
|
|
| 57 | 63 | global $container; |
| 58 | 64 | $activityRepository = new Jacobemerick\Web\Domain\Stream\Activity\MysqlActivityRepository($container['db_connection_locator']); |
| 59 | 65 | $post_result = $activityRepository->getActivities(5); |
@@ -66,8 +72,8 @@ discard block |
||
| 66 | 72 | return $post_array; |
| 67 | 73 | } |
| 68 | 74 | |
| 69 | - protected function expand_post($raw_post, $format = 'short') |
|
| 70 | - { |
|
| 75 | + protected function expand_post($raw_post, $format = 'short') |
|
| 76 | + {
|
|
| 71 | 77 | $post = [ |
| 72 | 78 | 'type' => $raw_post['type'], |
| 73 | 79 | 'title' => ($format == 'short') ? $raw_post['message'] : $raw_post['message_long'], |
@@ -84,8 +90,8 @@ discard block |
||
| 84 | 90 | return (object) $post; |
| 85 | 91 | } |
| 86 | 92 | |
| 87 | - public function activate() |
|
| 88 | - { |
|
| 93 | + public function activate() |
|
| 94 | + {
|
|
| 89 | 95 | $this->set_head_data(); |
| 90 | 96 | $this->set_body_data(); |
| 91 | 97 | $this->set_data(); |
@@ -97,10 +103,11 @@ discard block |
||
| 97 | 103 | Loader::load('view', '/Head', $this->data_array['head']); |
| 98 | 104 | foreach($this->body_view_array as $view) |
| 99 | 105 | { |
| 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']); |
|
| 106 | + if(substr($view, 0, 1) == '/') {
|
|
| 107 | + Loader::load('view', $view, $this->data_array['body']);
|
|
| 108 | + } else {
|
|
| 109 | + Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
|
|
| 110 | + } |
|
| 104 | 111 | } |
| 105 | 112 | |
| 106 | 113 | if (URLDecode::getSite() == 'waterfalls') { |
@@ -109,62 +116,63 @@ discard block |
||
| 109 | 116 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
| 110 | 117 | } |
| 111 | 118 | |
| 112 | - if($view == '/404' || $view == '/503') |
|
| 113 | - exit; |
|
| 119 | + if($view == '/404' || $view == '/503') {
|
|
| 120 | + exit; |
|
| 121 | + } |
|
| 114 | 122 | } |
| 115 | 123 | |
| 116 | - protected function set_header_method($method) |
|
| 117 | - { |
|
| 124 | + protected function set_header_method($method) |
|
| 125 | + {
|
|
| 118 | 126 | $this->headers = $method; |
| 119 | 127 | } |
| 120 | 128 | |
| 121 | - protected function set_title($value) |
|
| 122 | - { |
|
| 129 | + protected function set_title($value) |
|
| 130 | + {
|
|
| 123 | 131 | $this->set_head('title', $value); |
| 124 | 132 | } |
| 125 | 133 | |
| 126 | - protected function set_author($value) |
|
| 127 | - { |
|
| 134 | + protected function set_author($value) |
|
| 135 | + {
|
|
| 128 | 136 | $this->set_head('author', $value); |
| 129 | 137 | } |
| 130 | 138 | |
| 131 | - protected function set_description($value) |
|
| 132 | - { |
|
| 139 | + protected function set_description($value) |
|
| 140 | + {
|
|
| 133 | 141 | $this->set_head('description', $value); |
| 134 | 142 | } |
| 135 | 143 | |
| 136 | - protected function set_keywords($array) |
|
| 137 | - { |
|
| 144 | + protected function set_keywords($array) |
|
| 145 | + {
|
|
| 138 | 146 | $this->set_head('keywords', implode(', ', $array)); |
| 139 | 147 | } |
| 140 | 148 | |
| 141 | - protected function set_canonical($url) |
|
| 142 | - { |
|
| 149 | + protected function set_canonical($url) |
|
| 150 | + {
|
|
| 143 | 151 | $this->set_head('canonical', $url); |
| 144 | 152 | } |
| 145 | 153 | |
| 146 | - protected function set_head($set, $value) |
|
| 147 | - { |
|
| 154 | + protected function set_head($set, $value) |
|
| 155 | + {
|
|
| 148 | 156 | $this->data_array['head'][$set] = $value; |
| 149 | 157 | } |
| 150 | 158 | |
| 151 | - protected function set_body($set, $value) |
|
| 152 | - { |
|
| 159 | + protected function set_body($set, $value) |
|
| 160 | + {
|
|
| 153 | 161 | $this->data_array['body'][$set] = $value; |
| 154 | 162 | } |
| 155 | 163 | |
| 156 | - protected function add_css($file, $version = 1) |
|
| 157 | - { |
|
| 164 | + protected function add_css($file, $version = 1) |
|
| 165 | + {
|
|
| 158 | 166 | $this->css_array[] = [$file, $version]; |
| 159 | 167 | } |
| 160 | 168 | |
| 161 | - protected function add_js($file) |
|
| 162 | - { |
|
| 169 | + protected function add_js($file) |
|
| 170 | + {
|
|
| 163 | 171 | $this->js_array[] = $file; |
| 164 | 172 | } |
| 165 | 173 | |
| 166 | - private function load_assets() |
|
| 167 | - { |
|
| 174 | + private function load_assets() |
|
| 175 | + {
|
|
| 168 | 176 | $css_array = array_map(function ($stylesheet) { |
| 169 | 177 | $path = "/css/{$stylesheet[0]}.css"; |
| 170 | 178 | if ($stylesheet[1] > 1) { |
@@ -183,40 +191,44 @@ discard block |
||
| 183 | 191 | $this->set_head('js_link_array', $js_array); |
| 184 | 192 | } |
| 185 | 193 | |
| 186 | - protected function set_body_view($view) |
|
| 187 | - { |
|
| 194 | + protected function set_body_view($view) |
|
| 195 | + {
|
|
| 188 | 196 | $this->body_view_array[] = $view; |
| 189 | 197 | } |
| 190 | 198 | |
| 191 | - protected function eject() |
|
| 192 | - { |
|
| 193 | - if(get_class($this) !== 'Error404Controller') |
|
| 194 | - Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
| 199 | + protected function eject() |
|
| 200 | + {
|
|
| 201 | + if(get_class($this) !== 'Error404Controller') {
|
|
| 202 | + Loader::loadNew('controller', '/Error404Controller')->activate();
|
|
| 203 | + } |
|
| 195 | 204 | } |
| 196 | 205 | |
| 197 | - protected function unavailable() |
|
| 198 | - { |
|
| 199 | - if(get_class($this) !== 'Error503Controller') |
|
| 200 | - Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
| 206 | + protected function unavailable() |
|
| 207 | + {
|
|
| 208 | + if(get_class($this) !== 'Error503Controller') {
|
|
| 209 | + Loader::loadNew('controller', '/Error503Controller')->activate();
|
|
| 210 | + } |
|
| 201 | 211 | } |
| 202 | 212 | |
| 203 | - protected function redirect($uri, $method = 301) |
|
| 204 | - { |
|
| 213 | + protected function redirect($uri, $method = 301) |
|
| 214 | + {
|
|
| 205 | 215 | switch($method) |
| 206 | 216 | { |
| 207 | 217 | case 301 : |
| 208 | - if(get_class($this) !== 'Error301Controller') |
|
| 209 | - Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
| 218 | + if(get_class($this) !== 'Error301Controller') {
|
|
| 219 | + Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
|
|
| 220 | + } |
|
| 210 | 221 | break; |
| 211 | 222 | case 303 : |
| 212 | - if(get_class($this) !== 'Error303Controller') |
|
| 213 | - Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
| 223 | + if(get_class($this) !== 'Error303Controller') {
|
|
| 224 | + Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
|
|
| 225 | + } |
|
| 214 | 226 | break; |
| 215 | 227 | } |
| 216 | 228 | } |
| 217 | 229 | |
| 218 | - final protected function get_parsed_date($date) |
|
| 219 | - { |
|
| 230 | + final protected function get_parsed_date($date) |
|
| 231 | + {
|
|
| 220 | 232 | $parsed_date = new stdclass(); |
| 221 | 233 | |
| 222 | 234 | $parsed_date->stamp = date('c', strtotime($date)); |
@@ -227,8 +239,8 @@ discard block |
||
| 227 | 239 | } |
| 228 | 240 | |
| 229 | 241 | private $comment_errors; |
| 230 | - protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
|
| 231 | - { |
|
| 242 | + protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
|
| 243 | + {
|
|
| 232 | 244 | if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
| 233 | 245 | { |
| 234 | 246 | $parameters = array($site_id, $path, $redirect_url, $page_title); |
@@ -238,8 +250,8 @@ discard block |
||
| 238 | 250 | return; |
| 239 | 251 | } |
| 240 | 252 | |
| 241 | - protected function get_comment_array($site, $path) |
|
| 242 | - { |
|
| 253 | + protected function get_comment_array($site, $path) |
|
| 254 | + {
|
|
| 243 | 255 | global $container; |
| 244 | 256 | $repository = new Jacobemerick\Web\Domain\Comment\Comment\ServiceCommentRepository($container['comment_service_api']); |
| 245 | 257 | $start = microtime(true); |