@@ -112,6 +112,9 @@ |
||
| 112 | 112 | return $_timeString; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + /** |
|
| 116 | + * @param integer $timestamp |
|
| 117 | + */ |
|
| 115 | 118 | protected function _normal($timestamp) { |
| 116 | 119 | if ($timestamp > $this->_today || $timestamp > ($this->_now - 21600)) { |
| 117 | 120 | // today or in the last 6 hours |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | $timeInTimezone = new DateTime('now', $timezone); |
| 57 | 57 | $timeDiffToUtc = $timeInTimezone->getOffset() / 3600; |
| 58 | 58 | $options[$groupTitle][$timeZoneTitle] = |
| 59 | - $timeZoneTitle . |
|
| 60 | - ' (' . $timeInTimezone->format('H:m') . |
|
| 61 | - '; ' . $timeDiffToUtc . ')'; |
|
| 59 | + $timeZoneTitle. |
|
| 60 | + ' ('.$timeInTimezone->format('H:m'). |
|
| 61 | + '; '.$timeDiffToUtc.')'; |
|
| 62 | 62 | endforeach; |
| 63 | 63 | endforeach; |
| 64 | 64 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $time = strftime("%H:%M", $timestamp); |
| 119 | 119 | } elseif ($timestamp > ($this->_today - 64800)) { |
| 120 | 120 | // yesterday but in the last 18 hours |
| 121 | - $time = __('yesterday') . ' ' . strftime("%H:%M", $timestamp); |
|
| 121 | + $time = __('yesterday').' '.strftime("%H:%M", $timestamp); |
|
| 122 | 122 | } else { |
| 123 | 123 | // yesterday and 18 hours and older |
| 124 | 124 | $time = strftime("%d.%m.%Y", $timestamp); |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | * Translates user types |
| 61 | 61 | * |
| 62 | 62 | * @param $type |
| 63 | - * @return mixed |
|
| 63 | + * @return null|string |
|
| 64 | 64 | */ |
| 65 | 65 | public function type($type) { |
| 66 | 66 | // write out all __() strings for l10n |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return '<style type="text/css">' . implode(" ", $_styles) . '</style>'; |
|
| 56 | + return '<style type="text/css">'.implode(" ", $_styles).'</style>'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $out = $url; |
| 101 | 101 | if (is_string($url)) { |
| 102 | 102 | if (substr($url, 0, 4) == 'www.') { |
| 103 | - $url = 'http://' . $url; |
|
| 103 | + $url = 'http://'.$url; |
|
| 104 | 104 | } |
| 105 | 105 | if (substr($url, 0, 4) == 'http') { |
| 106 | 106 | $out = $this->Html->link( |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | $Logger->write('Contact email failed', ['e' => $e]); |
| 129 | 129 | |
| 130 | 130 | $this->Session->setFlash( |
| 131 | - __('Message couldn\'t be send! ' . $e->getMessage()), |
|
| 131 | + __('Message couldn\'t be send! '.$e->getMessage()), |
|
| 132 | 132 | 'flash/error' |
| 133 | 133 | ); |
| 134 | 134 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | $deactivate = $this->Esnotification->read('deactivate'); |
| 27 | 27 | if (!isset($this->request->params['named']['token']) |
| 28 | - || (int)$this->request->params['named']['token'] !== (int)$deactivate['Esnotification']['deactivate'] |
|
| 28 | + || (int) $this->request->params['named']['token'] !== (int) $deactivate['Esnotification']['deactivate'] |
|
| 29 | 29 | ) { |
| 30 | 30 | throw new MethodNotAllowedException(); |
| 31 | 31 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'entry_id' => $this->request->data['id'], |
| 49 | 49 | ]; |
| 50 | 50 | $this->Bookmark->create(); |
| 51 | - return (bool)$this->Bookmark->save($data); |
|
| 51 | + return (bool) $this->Bookmark->save($data); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->_getBookmark($id, $this->CurrentUser->getId()); |
| 99 | 99 | $this->autoRender = false; |
| 100 | 100 | $this->Bookmark->id = $id; |
| 101 | - return (bool)$this->Bookmark->delete(); |
|
| 101 | + return (bool) $this->Bookmark->delete(); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function beforeFilter() { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | if (isset($this->request->data['Category']['modeMove']) && isset($this->request->data['Category']['targetCategory'])): |
| 73 | 73 | /* move category items before deleting the cateogry */ |
| 74 | 74 | |
| 75 | - $targetId = (int)$this->request->data['Category']['targetCategory']; |
|
| 75 | + $targetId = (int) $this->request->data['Category']['targetCategory']; |
|
| 76 | 76 | |
| 77 | 77 | /* make sure that target category exists */ |
| 78 | 78 | $this->Category->contain(); |
@@ -89,8 +89,10 @@ discard block |
||
| 89 | 89 | $this->Session->setFlash(__('Error moving category.'), |
| 90 | 90 | 'flash/error'); |
| 91 | 91 | $failure = $failure || true; |
| 92 | - else: |
|
| 92 | + else { |
|
| 93 | + : |
|
| 93 | 94 | $this->Session->setFlash(__('Category moved.'), 'flash/notice'); |
| 95 | + } |
|
| 94 | 96 | endif; |
| 95 | 97 | endif; |
| 96 | 98 | |
@@ -99,8 +101,10 @@ discard block |
||
| 99 | 101 | $this->Session->setFlash(__("Error deleting category."), |
| 100 | 102 | 'flash/error'); |
| 101 | 103 | $failure = $failure || true; |
| 102 | - else: |
|
| 104 | + else { |
|
| 105 | + : |
|
| 103 | 106 | $this->Session->setFlash(__('Category deleted.'), 'flash/notice'); |
| 107 | + } |
|
| 104 | 108 | endif; |
| 105 | 109 | |
| 106 | 110 | if ($failure == false) : |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | public function admin_edit($id = null) { |
| 65 | 65 | if (!$id) { |
| 66 | - $this->redirect(array( 'action ' => 'index' )); |
|
| 66 | + $this->redirect(array('action ' => 'index')); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $this->Setting->id = $id; |
@@ -20,10 +20,10 @@ |
||
| 20 | 20 | // Leave in front to have it available in all Components |
| 21 | 21 | 'Detectors.Detectors', |
| 22 | 22 | /** |
| 23 | - * You have to have Cookie before CurrentUser to have the salt initialized. |
|
| 24 | - * Check by deleting Session cookie when persistent cookie is present. |
|
| 25 | - * @td maybe bug in Cake, because Cookies should be initialized in CurrentUser's $components |
|
| 26 | - */ |
|
| 23 | + * You have to have Cookie before CurrentUser to have the salt initialized. |
|
| 24 | + * Check by deleting Session cookie when persistent cookie is present. |
|
| 25 | + * @td maybe bug in Cake, because Cookies should be initialized in CurrentUser's $components |
|
| 26 | + */ |
|
| 27 | 27 | 'Cookie', |
| 28 | 28 | 'CurrentUser', |
| 29 | 29 | 'CacheSupport', |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // activate stopwatch in debug mode |
| 138 | 138 | $this->set('showStopwatchOutput', false); |
| 139 | - if ((int)Configure::read('debug') > 0) { |
|
| 139 | + if ((int) Configure::read('debug') > 0) { |
|
| 140 | 140 | $this->set('showStopwatchOutput', true); |
| 141 | 141 | }; |
| 142 | 142 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $this->set('lastAction', $this->localReferer('action')); |
| 185 | 185 | $this->set('lastController', $this->localReferer('controller')); |
| 186 | - $this->set('isDebug', (int)Configure::read('debug') > 0); |
|
| 186 | + $this->set('isDebug', (int) Configure::read('debug') > 0); |
|
| 187 | 187 | $this->_setLayoutTitles(); |
| 188 | 188 | |
| 189 | 189 | $this->_setXFrameOptionsHeader(); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } else { |
| 289 | 289 | $_pageTitle = __d( |
| 290 | 290 | 'page_titles', |
| 291 | - $this->params['controller'] . '/' . $this->params['action'] |
|
| 291 | + $this->params['controller'].'/'.$this->params['action'] |
|
| 292 | 292 | ); |
| 293 | 293 | } |
| 294 | 294 | $this->set('title_for_page', $_pageTitle); |
@@ -449,9 +449,9 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | protected function _l10nRenderFile() { |
| 451 | 451 | $locale = Configure::read('Config.language'); |
| 452 | - $l10nViewPath = $this->viewPath . DS . $locale; |
|
| 453 | - $l10nViewFile = $l10nViewPath . DS . $this->view . '.ctp'; |
|
| 454 | - if ($locale && file_exists(APP . 'View' . DS . $l10nViewFile) |
|
| 452 | + $l10nViewPath = $this->viewPath.DS.$locale; |
|
| 453 | + $l10nViewFile = $l10nViewPath.DS.$this->view.'.ctp'; |
|
| 454 | + if ($locale && file_exists(APP.'View'.DS.$l10nViewFile) |
|
| 455 | 455 | ) { |
| 456 | 456 | $this->viewPath = $l10nViewPath; |
| 457 | 457 | } |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | * @return array with Theme names |
| 131 | 131 | */ |
| 132 | 132 | public function themeDirs() { |
| 133 | - $_ThemeDir = new Folder(App::paths()['View'][0] . 'Themed'); |
|
| 133 | + $_ThemeDir = new Folder(App::paths()['View'][0].'Themed'); |
|
| 134 | 134 | return $_ThemeDir->read()[0]; |
| 135 | 135 | } |
| 136 | 136 | |