@@ -16,4 +16,4 @@ |
||
| 16 | 16 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | -require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; |
|
| 19 | +require 'webroot'.DIRECTORY_SEPARATOR.'index.php'; |
|
@@ -105,4 +105,4 @@ |
||
| 105 | 105 | * Load the CakePHP default routes. Only remove this if you do not want to use |
| 106 | 106 | * the built-in default routes. |
| 107 | 107 | */ |
| 108 | - require CAKE . 'Config' . DS . 'routes.php'; |
|
| 108 | + require CAKE.'Config'.DS.'routes.php'; |
|
@@ -208,8 +208,8 @@ |
||
| 208 | 208 | Configure::write('Saito.Globals.postingsPerThread', 10); |
| 209 | 209 | |
| 210 | 210 | /** |
| 211 | - * Check if the forum is installed |
|
| 212 | - */ |
|
| 211 | + * Check if the forum is installed |
|
| 212 | + */ |
|
| 213 | 213 | if ( file_exists(APP . 'Config' . DS . 'installed.txt') ) : |
| 214 | 214 | Configure::write('Saito.installed', TRUE); |
| 215 | 215 | else : |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include App::path('Lib')[0] . 'BaseFunctions.php'; |
|
| 3 | +include App::path('Lib')[0].'BaseFunctions.php'; |
|
| 4 | 4 | |
| 5 | 5 | // Load Composer autoload. |
| 6 | -require ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'autoload.php'; |
|
| 6 | +require ROOT.DS.APP_DIR.DS.'Vendor'.DS.'autoload.php'; |
|
| 7 | 7 | Cake2ComposerAutoloadFix(); |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | /** |
| 211 | 211 | * Check if the forum is installed |
| 212 | 212 | */ |
| 213 | -if ( file_exists(APP . 'Config' . DS . 'installed.txt') ) : |
|
| 213 | +if (file_exists(APP.'Config'.DS.'installed.txt')) : |
|
| 214 | 214 | Configure::write('Saito.installed', TRUE); |
| 215 | 215 | else : |
| 216 | 216 | Configure::write('Saito.installed', FALSE); |
@@ -212,8 +212,10 @@ |
||
| 212 | 212 | */ |
| 213 | 213 | if ( file_exists(APP . 'Config' . DS . 'installed.txt') ) : |
| 214 | 214 | Configure::write('Saito.installed', TRUE); |
| 215 | -else : |
|
| 215 | +else { |
|
| 216 | + : |
|
| 216 | 217 | Configure::write('Saito.installed', FALSE); |
| 218 | +} |
|
| 217 | 219 | endif; |
| 218 | 220 | |
| 219 | 221 | /** |
@@ -135,9 +135,9 @@ |
||
| 135 | 135 | */ |
| 136 | 136 | Configure::write('Routing.prefixes', array('admin')); |
| 137 | 137 | /** |
| 138 | - * Turn off all caching application-wide. |
|
| 139 | - * |
|
| 140 | - */ |
|
| 138 | + * Turn off all caching application-wide. |
|
| 139 | + * |
|
| 140 | + */ |
|
| 141 | 141 | //Configure::write('Cache.disable', true); |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -337,8 +337,8 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | Cache::config('_cake_core_', array( |
| 339 | 339 | 'engine' => $engine, |
| 340 | - 'prefix' => $prefix . 'cake_core_', |
|
| 341 | - 'path' => CACHE . 'persistent' . DS, |
|
| 340 | + 'prefix' => $prefix.'cake_core_', |
|
| 341 | + 'path' => CACHE.'persistent'.DS, |
|
| 342 | 342 | 'serialize' => ($engine === 'File'), |
| 343 | 343 | 'duration' => $duration |
| 344 | 344 | )); |
@@ -349,8 +349,8 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | Cache::config('_cake_model_', array( |
| 351 | 351 | 'engine' => $engine, |
| 352 | - 'prefix' => $prefix . 'cake_model_', |
|
| 353 | - 'path' => CACHE . 'models' . DS, |
|
| 352 | + 'prefix' => $prefix.'cake_model_', |
|
| 353 | + 'path' => CACHE.'models'.DS, |
|
| 354 | 354 | 'serialize' => ($engine === 'File'), |
| 355 | 355 | 'duration' => $duration |
| 356 | 356 | )); |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Add additional buttons to editor |
| 49 | - * |
|
| 50 | - * You can theme them with |
|
| 51 | - * |
|
| 52 | - * <code> |
|
| 53 | - * .markItUp .markItUpButton<Id> a { |
|
| 54 | - * … |
|
| 55 | - * } |
|
| 56 | - * </code> |
|
| 49 | + * |
|
| 50 | + * You can theme them with |
|
| 51 | + * |
|
| 52 | + * <code> |
|
| 53 | + * .markItUp .markItUpButton<Id> a { |
|
| 54 | + * … |
|
| 55 | + * } |
|
| 56 | + * </code> |
|
| 57 | 57 | * |
| 58 | 58 | /* |
| 59 | 59 | Configure::write( |
@@ -75,22 +75,22 @@ discard block |
||
| 75 | 75 | // image in img/markitup/<replacement> |
| 76 | 76 | 'replacement' => 'resultofbutton1.png' |
| 77 | 77 | ), |
| 78 | - * // … |
|
| 78 | + * // … |
|
| 79 | 79 | ) |
| 80 | 80 | ); |
| 81 | - * |
|
| 82 | - */ |
|
| 81 | + * |
|
| 82 | + */ |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Users to notify via email if a new users registers successfully |
| 86 | - * |
|
| 87 | - * Provide an array with user IDs. To notify the admin (usually user-id 1): |
|
| 88 | - * |
|
| 89 | - * [1] |
|
| 90 | - * |
|
| 91 | - * To notify the admin with id 1 and the user with the id 5: |
|
| 92 | - * |
|
| 93 | - * [1, 5] |
|
| 86 | + * |
|
| 87 | + * Provide an array with user IDs. To notify the admin (usually user-id 1): |
|
| 88 | + * |
|
| 89 | + * [1] |
|
| 90 | + * |
|
| 91 | + * To notify the admin with id 1 and the user with the id 5: |
|
| 92 | + * |
|
| 93 | + * [1, 5] |
|
| 94 | 94 | */ |
| 95 | 95 | /* |
| 96 | 96 | Configure::write('Saito.Notification.userActivatedAdminNoticeToUserWithID', [1]); |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | if ($lastAction !== 'add'): |
| 28 | 28 | if ($this->Session->read('paginator.lastPage')): |
| 29 | - $indexPage .= '/page:' . $this->Session->read('paginator.lastPage'); |
|
| 29 | + $indexPage .= '/page:'.$this->Session->read('paginator.lastPage'); |
|
| 30 | 30 | endif; |
| 31 | 31 | endif; |
| 32 | - $indexPage .= '/jump:' . $tid; |
|
| 32 | + $indexPage .= '/jump:'.$tid; |
|
| 33 | 33 | |
| 34 | 34 | return $indexPage; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function getFastLink($entry, $params = array('class' => '')) { |
| 38 | 38 | // @todo @performance |
| 39 | - $out = "<a href='{$this->request->webroot}entries/view/{$entry['Entry']['id']}' class='{$params['class']}'>" . |
|
| 40 | - $this->getSubject($this->dic->newInstance('\Saito\Posting\Posting', ['rawData' => $entry])) . '</a>'; |
|
| 39 | + $out = "<a href='{$this->request->webroot}entries/view/{$entry['Entry']['id']}' class='{$params['class']}'>". |
|
| 40 | + $this->getSubject($this->dic->newInstance('\Saito\Posting\Posting', ['rawData' => $entry])).'</a>'; |
|
| 41 | 41 | return $out; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | public function renderThread(&$tree, array $options = []) { |
| 74 | 74 | $options += [ |
| 75 | 75 | 'lineCache' => $this->_View->get('LineCache'), |
| 76 | - 'maxThreadDepthIndent' => (int)Configure::read('Saito.Settings.thread_depth_indent'), |
|
| 76 | + 'maxThreadDepthIndent' => (int) Configure::read('Saito.Settings.thread_depth_indent'), |
|
| 77 | 77 | 'renderer' => 'thread', |
| 78 | 78 | 'rootWrap' => false |
| 79 | 79 | ]; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $_nErrorsToShow = 20; |
| 79 | 79 | $errors = preg_split('/(?=^\d{4}-\d{2}-\d{2})/m', $log, -1, PREG_SPLIT_NO_EMPTY); |
| 80 | 80 | if (empty($errors)) { |
| 81 | - return '<p>' . __('No log file found.') . '</p>'; |
|
| 81 | + return '<p>'.__('No log file found.').'</p>'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $out = ''; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | $_i = self::tagId(); |
| 90 | 90 | $_details = $e->details(); |
| 91 | 91 | if (!empty($_details)) { |
| 92 | - $out .= '<button class="btn btn-mini" style="float:right;" onclick="$(\'#' . $_i . '\').toggle(); return false;">' . __('Details') . '</button>' . "\n"; |
|
| 92 | + $out .= '<button class="btn btn-mini" style="float:right;" onclick="$(\'#'.$_i.'\').toggle(); return false;">'.__('Details').'</button>'."\n"; |
|
| 93 | 93 | } |
| 94 | - $out .= '<pre style="font-size: 10px;">' . "\n"; |
|
| 94 | + $out .= '<pre style="font-size: 10px;">'."\n"; |
|
| 95 | 95 | $out .= '<div class="row"><div class="span2" style="text-align: right">'; |
| 96 | 96 | $out .= $this->TimeH->formatTime($e->time(), 'eng'); |
| 97 | 97 | |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | $out .= '<div class="span7">'; |
| 100 | 100 | $out .= $e->message(); |
| 101 | 101 | if (!empty($_details)) { |
| 102 | - $out .= '<span id="' . $_i . '" style="display: none;">' . "\n"; |
|
| 102 | + $out .= '<span id="'.$_i.'" style="display: none;">'."\n"; |
|
| 103 | 103 | $out .= $_details; |
| 104 | 104 | $out .= '</span>'; |
| 105 | 105 | } |
| 106 | 106 | $out .= '</div></div>'; |
| 107 | - $out .= '</pre>' . "\n"; |
|
| 107 | + $out .= '</pre>'."\n"; |
|
| 108 | 108 | if ($k++ > $_nErrorsToShow) { |
| 109 | 109 | break; |
| 110 | 110 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | protected $_assetsIncluded = false; |
| 18 | 18 | |
| 19 | 19 | public function beforeRender($viewFile) { |
| 20 | - $this->_apiEnabled = (bool)Configure::read('Saito.Settings.map_enabled'); |
|
| 20 | + $this->_apiEnabled = (bool) Configure::read('Saito.Settings.map_enabled'); |
|
| 21 | 21 | if (!$this->_apiEnabled) { |
| 22 | 22 | return; |
| 23 | 23 | } |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | $this->Html->script([ |
| 37 | 37 | '../dist/leaflet/leaflet.js', |
| 38 | 38 | '../dist/leaflet/leaflet.markercluster.js', |
| 39 | - '//open.mapquestapi.com/sdk/leaflet/v1.0/mq-map.js?key=' . $this->_apiKey, |
|
| 40 | - '//open.mapquestapi.com/sdk/leaflet/v1.0/mq-geocoding.js?key=' . $this->_apiKey |
|
| 39 | + '//open.mapquestapi.com/sdk/leaflet/v1.0/mq-map.js?key='.$this->_apiKey, |
|
| 40 | + '//open.mapquestapi.com/sdk/leaflet/v1.0/mq-geocoding.js?key='.$this->_apiKey |
|
| 41 | 41 | ], |
| 42 | 42 | ['inline' => false, 'block' => 'script-head']); |
| 43 | 43 | $this->_assetsIncluded = true; |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | // @performance |
| 77 | 77 | // filter out every field except the place fields |
| 78 | 78 | $users[$key] = [ |
| 79 | - 'id' => (int)$user['User']['id'], |
|
| 79 | + 'id' => (int) $user['User']['id'], |
|
| 80 | 80 | 'name' => $user['User']['username'], |
| 81 | - 'lat' => (float)$user['User']['user_place_lat'], |
|
| 82 | - 'lng' => (float)$user['User']['user_place_lng'] |
|
| 81 | + 'lat' => (float) $user['User']['user_place_lat'], |
|
| 82 | + 'lng' => (float) $user['User']['user_place_lng'] |
|
| 83 | 83 | ]; |
| 84 | 84 | if ($edit) { |
| 85 | - $users[$key]['zoom'] = (int)$user['User']['user_place_zoom']; |
|
| 85 | + $users[$key]['zoom'] = (int) $user['User']['user_place_zoom']; |
|
| 86 | 86 | } else { |
| 87 | 87 | // add simple jitter |
| 88 | 88 | $rand = 0; // rand(-9,9) / pow(10, $this->_precision + 1); |
@@ -20,17 +20,17 @@ discard block |
||
| 20 | 20 | 'version' => Configure::read('Saito.v'), |
| 21 | 21 | 'settings' => [ |
| 22 | 22 | 'autoPageReload' => (isset($View->viewVars['autoPageReload']) ? $View->viewVars['autoPageReload'] : 0), |
| 23 | - 'embedly_enabled' => (bool)Configure::read('Saito.Settings.embedly_enabled'), |
|
| 24 | - 'editPeriod' => (int)Configure::read('Saito.Settings.edit_period'), |
|
| 23 | + 'embedly_enabled' => (bool) Configure::read('Saito.Settings.embedly_enabled'), |
|
| 24 | + 'editPeriod' => (int) Configure::read('Saito.Settings.edit_period'), |
|
| 25 | 25 | 'notificationIcon' => $this->assetUrl( |
| 26 | 26 | 'html5-notification-icon.png', |
| 27 | 27 | [ |
| 28 | 28 | 'pathPrefix' => Configure::read('App.imageBaseUrl'), |
| 29 | 29 | 'fullBase' => true |
| 30 | 30 | ]), |
| 31 | - 'subject_maxlength' => (int)Configure::read('Saito.Settings.subject_maxlength'), |
|
| 32 | - 'upload_max_img_size' => (int)Configure::read('Saito.Settings.upload_max_img_size') * 1024, |
|
| 33 | - 'upload_max_number_of_uploads' => (int)Configure::read('Saito.Settings.upload_max_number_of_uploads'), |
|
| 31 | + 'subject_maxlength' => (int) Configure::read('Saito.Settings.subject_maxlength'), |
|
| 32 | + 'upload_max_img_size' => (int) Configure::read('Saito.Settings.upload_max_img_size') * 1024, |
|
| 33 | + 'upload_max_number_of_uploads' => (int) Configure::read('Saito.Settings.upload_max_number_of_uploads'), |
|
| 34 | 34 | 'webroot' => $View->request->webroot |
| 35 | 35 | ] |
| 36 | 36 | ], |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'isPreview' => $View->request->isPreview() |
| 42 | 42 | ], |
| 43 | 43 | 'currentUser' => [ |
| 44 | - 'id' => (int)$View->viewVars['CurrentUser']['id'], |
|
| 44 | + 'id' => (int) $View->viewVars['CurrentUser']['id'], |
|
| 45 | 45 | 'username' => $View->viewVars['CurrentUser']['username'], |
| 46 | 46 | 'user_show_inline' => $View->viewVars['CurrentUser']['inline_view_on_click'] || false, |
| 47 | 47 | 'user_show_thread_collapsed' => $View->viewVars['CurrentUser']['user_show_thread_collapsed'] || false |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'afterViewInit' => [] |
| 53 | 53 | ] |
| 54 | 54 | ]; |
| 55 | - $out = 'var SaitoApp = ' . json_encode($js); |
|
| 55 | + $out = 'var SaitoApp = '.json_encode($js); |
|
| 56 | 56 | $out .= '; SaitoApp.timeAppStart = new Date().getTime();'; |
| 57 | 57 | return $out; |
| 58 | 58 | } |