@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | if ($lastAction !== 'add') { |
| 50 | 50 | $session = $this->request->getSession(); |
| 51 | 51 | if ($session->read('paginator.lastPage')) { |
| 52 | - $params[] = 'page=' . $session->read('paginator.lastPage'); |
|
| 52 | + $params[] = 'page='.$session->read('paginator.lastPage'); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | - $params[] = 'jump=' . $tid; |
|
| 55 | + $params[] = 'jump='.$tid; |
|
| 56 | 56 | |
| 57 | - return '/?' . implode('&', $params); |
|
| 57 | + return '/?'.implode('&', $params); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $id = $posting->get('id'); |
| 71 | 71 | $webroot = $this->request->getAttribute('webroot'); |
| 72 | 72 | $url = "{$webroot}entries/view/{$id}"; |
| 73 | - $link = "<a href=\"{$url}\" class=\"{$options['class']}\">" . $this->getSubject($posting) . '</a>'; |
|
| 73 | + $link = "<a href=\"{$url}\" class=\"{$options['class']}\">".$this->getSubject($posting).'</a>'; |
|
| 74 | 74 | |
| 75 | 75 | return $link; |
| 76 | 76 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function views(BasicPostingInterface $posting) |
| 127 | 127 | { |
| 128 | - return __('views_headline') . ': ' . $posting->get('views'); |
|
| 128 | + return __('views_headline').': '.$posting->get('views'); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $options += [ |
| 143 | 143 | 'lineCache' => $this->_View->get('LineCache'), |
| 144 | - 'maxThreadDepthIndent' => (int)Configure::read( |
|
| 144 | + 'maxThreadDepthIndent' => (int) Configure::read( |
|
| 145 | 145 | 'Saito.Settings.thread_depth_indent' |
| 146 | 146 | ), |
| 147 | 147 | 'renderer' => 'thread', |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | { |
| 185 | 185 | $out = ''; |
| 186 | 186 | if ($entry->isPinned()) { |
| 187 | - $out .= '<i class="fa fa-thumb-tack" title="' . __('fixed') . '"></i> '; |
|
| 187 | + $out .= '<i class="fa fa-thumb-tack" title="'.__('fixed').'"></i> '; |
|
| 188 | 188 | } |
| 189 | 189 | // anchor for inserting solve-icon via FE-JS |
| 190 | - $out .= '<span class="solves ' . $entry->get('id') . '">'; |
|
| 190 | + $out .= '<span class="solves '.$entry->get('id').'">'; |
|
| 191 | 191 | if ($entry->get('solves')) { |
| 192 | 192 | $out .= $this->solvedBadge(); |
| 193 | 193 | } |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function solvedBadge() |
| 213 | 213 | { |
| 214 | - return '<i class="fa fa-badge-solves solves-isSolved" title="' . |
|
| 215 | - __('Helpful entry') . '"></i>'; |
|
| 214 | + return '<i class="fa fa-badge-solves solves-isSolved" title="'. |
|
| 215 | + __('Helpful entry').'"></i>'; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function getSubject(BasicPostingInterface $posting) |
| 226 | 226 | { |
| 227 | - return \h($posting->get('subject')) . ($posting->isNt() ? ' n/t' : ''); |
|
| 227 | + return \h($posting->get('subject')).($posting->isNt() ? ' n/t' : ''); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function tagId() |
| 32 | 32 | { |
| 33 | - return 'id' . static::$_tagId++; |
|
| 33 | + return 'id'.static::$_tagId++; |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'version' => Configure::read('Saito.v'), |
| 62 | 62 | 'settings' => [ |
| 63 | 63 | 'autoPageReload' => (isset($View->viewVars['autoPageReload']) ? $View->viewVars['autoPageReload'] : 0), |
| 64 | - 'editPeriod' => (int)Configure::read( |
|
| 64 | + 'editPeriod' => (int) Configure::read( |
|
| 65 | 65 | 'Saito.Settings.edit_period' |
| 66 | 66 | ), |
| 67 | 67 | 'language' => Configure::read('Saito.language'), |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | 'quote_symbol' => $settings['quote_symbol'], |
| 76 | 76 | 'subject_maxlength' => $settings['subject_maxlength'], |
| 77 | 77 | 'upload_max_img_size' => $settings['upload_max_img_size'] * 1024, |
| 78 | - 'upload_max_number_of_uploads' => (int)$settings['upload_max_number_of_uploads'], |
|
| 78 | + 'upload_max_number_of_uploads' => (int) $settings['upload_max_number_of_uploads'], |
|
| 79 | 79 | 'theme' => $View->getTheme(), |
| 80 | - 'apiroot' => $View->request->getAttribute('webroot') . 'api/v2/', |
|
| 80 | + 'apiroot' => $View->request->getAttribute('webroot').'api/v2/', |
|
| 81 | 81 | 'webroot' => $View->request->getAttribute('webroot') |
| 82 | 82 | ] |
| 83 | 83 | ], |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | 'csrf' => $this->_getCsrf($View) |
| 90 | 90 | ], |
| 91 | 91 | 'currentUser' => [ |
| 92 | - 'id' => (int)$CurrentUser->get('id'), |
|
| 92 | + 'id' => (int) $CurrentUser->get('id'), |
|
| 93 | 93 | 'username' => $CurrentUser->get('username'), |
| 94 | 94 | 'user_show_inline' => $CurrentUser->get('inline_view_on_click') || false, |
| 95 | 95 | 'user_show_thread_collapsed' => $CurrentUser->get('user_show_thread_collapsed') || false |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'afterViewInit' => [] |
| 101 | 101 | ] |
| 102 | 102 | ]; |
| 103 | - $out = 'var SaitoApp = ' . json_encode($js); |
|
| 103 | + $out = 'var SaitoApp = '.json_encode($js); |
|
| 104 | 104 | $out .= '; SaitoApp.timeAppStart = new Date().getTime();'; |
| 105 | 105 | |
| 106 | 106 | return $out; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Saito - The Threaded Web Forum |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $defaults = ['return' => 'html', 'embed' => true, 'multimedia' => true, 'wrap' => true]; |
| 163 | 163 | $options += $defaults; |
| 164 | 164 | |
| 165 | - $cacheId = md5(serialize($options) . $string); |
|
| 165 | + $cacheId = md5(serialize($options).$string); |
|
| 166 | 166 | if (isset($this->_parserCache[$cacheId])) { |
| 167 | 167 | $html = $this->_parserCache[$cacheId]; |
| 168 | 168 | } else { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $this->_parserCache[$cacheId] = $html; |
| 171 | 171 | } |
| 172 | 172 | if ($options['return'] === 'html' && $options['wrap']) { |
| 173 | - $html = '<div class="richtext">' . $html . '</div>'; |
|
| 173 | + $html = '<div class="richtext">'.$html.'</div>'; |
|
| 174 | 174 | } |
| 175 | 175 | Stopwatch::stop('ParseHelper::parse()'); |
| 176 | 176 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $filename = "{$basename}-{$xSize}.png"; |
| 95 | 95 | |
| 96 | 96 | $url = $this->Url->assetUrl( |
| 97 | - $this->theme . '.' . Configure::read('App.imageBaseUrl'), |
|
| 97 | + $this->theme.'.'.Configure::read('App.imageBaseUrl'), |
|
| 98 | 98 | ['fullBase' => true] |
| 99 | 99 | ); |
| 100 | 100 | $url = "{$url}{$filename}"; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $html = "<i class=\"saito-icon fa fa-{$icon}\"></i>"; |
| 148 | 148 | if (!empty($text)) { |
| 149 | - $html .= ' <span class="saito-icon-text">' . $text . '</span>'; |
|
| 149 | + $html .= ' <span class="saito-icon-text">'.$text.'</span>'; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | return $html; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | public function dropdownMenuButton(array $menuItems, array $options = []) |
| 163 | 163 | { |
| 164 | 164 | $options += ['class' => 'btn btn-primary']; |
| 165 | - $options['class'] = $options['class'] . ' dropdown-toggle'; |
|
| 165 | + $options['class'] = $options['class'].' dropdown-toggle'; |
|
| 166 | 166 | $menu = []; |
| 167 | 167 | foreach ($menuItems as $menuItem) { |
| 168 | 168 | if ($menuItem === 'divider') { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $contentArray += ['first' => '', 'middle' => '', 'last' => '']; |
| 256 | 256 | $out = ''; |
| 257 | 257 | foreach (['first', 'middle', 'last'] as $key) { |
| 258 | - $out .= '<div class="' . $key . '">'; |
|
| 258 | + $out .= '<div class="'.$key.'">'; |
|
| 259 | 259 | $out .= $options['escape'] ? h($contentArray[$key]) : $contentArray[$key]; |
| 260 | 260 | $out .= '</div>'; |
| 261 | 261 | } |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | $timeDiffToUtc = $timeInTimezone->getOffset() / 3600; |
| 79 | 79 | |
| 80 | 80 | if ($timeDiffToUtc > 0) { |
| 81 | - $timeDiffToUtc = '+' . $timeDiffToUtc; |
|
| 81 | + $timeDiffToUtc = '+'.$timeDiffToUtc; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $tz = $timeZoneTitle . ' – ' . $timeInTimezone->format('H:i'); |
|
| 84 | + $tz = $timeZoneTitle.' – '.$timeInTimezone->format('H:i'); |
|
| 85 | 85 | if ($timeDiffToUtc !== 0) { |
| 86 | - $tz .= ' (' . $timeDiffToUtc . ')'; |
|
| 86 | + $tz .= ' ('.$timeDiffToUtc.')'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $options[$groupTitle][$timeZoneTitle] = $tz; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $time = strftime("%H:%M", $timestamp); |
| 146 | 146 | } elseif ($timestamp > ($this->_today - 64800)) { |
| 147 | 147 | // yesterday but in the last 18 hours |
| 148 | - $time = __('yesterday') . ' ' . strftime("%H:%M", $timestamp); |
|
| 148 | + $time = __('yesterday').' '.strftime("%H:%M", $timestamp); |
|
| 149 | 149 | } else { |
| 150 | 150 | // yesterday and 18 hours and older |
| 151 | 151 | $time = strftime("%d.%m.%Y", $timestamp); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return '<style type="text/css">' . implode(" ", $styles) . '</style>'; |
|
| 75 | + return '<style type="text/css">'.implode(" ", $styles).'</style>'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $link = $url; |
| 126 | 126 | |
| 127 | 127 | if (substr($link, 0, 4) == 'www.') { |
| 128 | - $link = 'http://' . $link; |
|
| 128 | + $link = 'http://'.$link; |
|
| 129 | 129 | } |
| 130 | 130 | if (substr($link, 0, 4) == 'http') { |
| 131 | 131 | $text = '<i class="fa fa-home fa-lg"></i>'; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $html = $name; |
| 161 | 161 | } elseif ($link || ($link instanceof ForumsUserInterface && $link->isLoggedIn()) |
| 162 | 162 | ) { |
| 163 | - return $this->Html->link($name, '/users/view/' . $id, $options); |
|
| 163 | + return $this->Html->link($name, '/users/view/'.$id, $options); |
|
| 164 | 164 | } else { |
| 165 | 165 | $html = $name; |
| 166 | 166 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getAvatar($user, array $options = []) |
| 182 | 182 | { |
| 183 | - $getAvatar = function () use ($user, $options) { |
|
| 183 | + $getAvatar = function() use ($user, $options) { |
|
| 184 | 184 | Stopwatch::start('UserHelper::getAvatar()'); |
| 185 | 185 | $defaults = [ |
| 186 | 186 | 'class' => 'avatar-image', |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $imgUri = (new Identicon)->getImageDataUri($name, $hdpi); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - $style = "background-image: url({$imgUri});" . $options['style']; |
|
| 209 | + $style = "background-image: url({$imgUri});".$options['style']; |
|
| 210 | 210 | |
| 211 | 211 | $html = $this->Html->tag( |
| 212 | 212 | $options['tag'], |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | }; |
| 228 | 228 | |
| 229 | 229 | $name = $user->get('username'); |
| 230 | - $hash = 'avatar.' . md5($name . serialize($options)); |
|
| 230 | + $hash = 'avatar.'.md5($name.serialize($options)); |
|
| 231 | 231 | |
| 232 | 232 | return $this->remember($hash, $getAvatar); |
| 233 | 233 | } |
@@ -68,9 +68,9 @@ |
||
| 68 | 68 | $jsonApiErrors = ['errors' => []]; |
| 69 | 69 | foreach ($errors as $field => $error) { |
| 70 | 70 | $out = [ |
| 71 | - 'meta' => ['field' => '#' . $this->_domId($field)], |
|
| 71 | + 'meta' => ['field' => '#'.$this->_domId($field)], |
|
| 72 | 72 | 'status' => '400', |
| 73 | - 'title' => __d('nondynamic', $field) . ": " . __d('nondynamic', current($error)), |
|
| 73 | + 'title' => __d('nondynamic', $field).": ".__d('nondynamic', current($error)), |
|
| 74 | 74 | ]; |
| 75 | 75 | |
| 76 | 76 | $jsonApiErrors['errors'][] = $out; |
@@ -216,10 +216,10 @@ |
||
| 216 | 216 | return; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - $check = function ($locale) { |
|
| 220 | - $l10nViewPath = $this->viewBuilder()->getTemplatePath() . DS . $locale; |
|
| 221 | - $l10nViewFile = $l10nViewPath . DS . $this->viewBuilder()->getName() . '.ctp'; |
|
| 222 | - if (!file_exists(APP . 'Template' . DS . $l10nViewFile)) { |
|
| 219 | + $check = function($locale) { |
|
| 220 | + $l10nViewPath = $this->viewBuilder()->getTemplatePath().DS.$locale; |
|
| 221 | + $l10nViewFile = $l10nViewPath.DS.$this->viewBuilder()->getName().'.ctp'; |
|
| 222 | + if (!file_exists(APP.'Template'.DS.$l10nViewFile)) { |
|
| 223 | 223 | return false; |
| 224 | 224 | } |
| 225 | 225 | |