@@ -61,7 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected function calculateX($imageResource) |
| 63 | 63 | { |
| 64 | - if (intval($this->_x) === $this->_x) return $this->_x; |
|
| 64 | + if (intval($this->_x) === $this->_x) { |
|
| 65 | + return $this->_x; |
|
| 66 | + } |
|
| 65 | 67 | |
| 66 | 68 | $x = strtolower($this->_x); |
| 67 | 69 | |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | */ |
| 87 | 89 | public function calculateY($imageResource) |
| 88 | 90 | { |
| 89 | - if (intval($this->_y) === $this->_y) return $this->_y; |
|
| 91 | + if (intval($this->_y) === $this->_y) { |
|
| 92 | + return $this->_y; |
|
| 93 | + } |
|
| 90 | 94 | |
| 91 | 95 | $y = strtolower($this->_y); |
| 92 | 96 | |
@@ -123,7 +127,9 @@ discard block |
||
| 123 | 127 | */ |
| 124 | 128 | public function GetWatermark() |
| 125 | 129 | { |
| 126 | - if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \library\image\Image using $this->SetWatermark'); |
|
| 130 | + if ($this->_watermark == null) { |
|
| 131 | + throw new \Exception('A watermark is not set. Please supply a \library\image\Image using $this->SetWatermark'); |
|
| 132 | + } |
|
| 127 | 133 | return $this->_watermark; |
| 128 | 134 | } |
| 129 | 135 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Use build-in logic to position the x of watermark |
| 58 | 58 | * |
| 59 | 59 | * @param string $imageResource |
| 60 | - * @return self |
|
| 60 | + * @return integer |
|
| 61 | 61 | */ |
| 62 | 62 | protected function calculateX($imageResource) |
| 63 | 63 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * Use build-in logic to position the y of watermark |
| 83 | 83 | * |
| 84 | 84 | * @param string $imageResource |
| 85 | - * @return self |
|
| 85 | + * @return integer |
|
| 86 | 86 | */ |
| 87 | 87 | public function calculateY($imageResource) |
| 88 | 88 | { |
@@ -131,6 +131,7 @@ discard block |
||
| 131 | 131 | * Set the x |
| 132 | 132 | * |
| 133 | 133 | * @param int | string $x |
| 134 | + * @param string $x |
|
| 134 | 135 | * @return self |
| 135 | 136 | */ |
| 136 | 137 | public function SetX($x) |
@@ -143,6 +144,7 @@ discard block |
||
| 143 | 144 | * Set the y |
| 144 | 145 | * |
| 145 | 146 | * @param int | string $y |
| 147 | + * @param string $y |
|
| 146 | 148 | * @return self |
| 147 | 149 | */ |
| 148 | 150 | public function SetY($y) |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | // Define the ratio and adjust the width and height |
| 65 | 65 | if ($this->_preserveAspectRatio) { |
| 66 | - $ratio = min($this->_width/$originalWidth, $this->_height/$originalHeight); |
|
| 66 | + $ratio = min($this->_width / $originalWidth, $this->_height / $originalHeight); |
|
| 67 | 67 | $this->_width = $originalWidth * $ratio; |
| 68 | 68 | $this->_height = $originalHeight * $ratio; |
| 69 | 69 | } |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Define which ratio will be used, depending on which is the smallest side |
| 28 | 28 | $ratio = min($hRatio, $wRatio); |
| 29 | - if($ratio > 1) $ratio = 1; |
|
| 29 | + if ($ratio > 1) $ratio = 1; |
|
| 30 | 30 | |
| 31 | 31 | // Define sizes |
| 32 | 32 | $this->_destWidth = floor($originalWidth * $ratio); |
| 33 | 33 | $this->_destHeight = floor($originalHeight * $ratio); |
| 34 | 34 | |
| 35 | 35 | // Define margins |
| 36 | - $this->_destX = floor(($this->_width - $this->_destWidth) / 2); |
|
| 36 | + $this->_destX = floor(($this->_width - $this->_destWidth) / 2); |
|
| 37 | 37 | $this->_destY = floor(($this->_height - $this->_destHeight) / 2); |
| 38 | 38 | |
| 39 | 39 | // Execute the Crop method with the given parameters |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Define which ratio will be used, depending on which is the smallest side |
| 28 | 28 | $ratio = min($hRatio, $wRatio); |
| 29 | - if($ratio > 1) $ratio = 1; |
|
| 29 | + if($ratio > 1) { |
|
| 30 | + $ratio = 1; |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | // Define sizes |
| 32 | 34 | $this->_destWidth = floor($originalWidth * $ratio); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @param resource $imageResource |
| 19 | 19 | * @return resource |
| 20 | - */ |
|
| 20 | + */ |
|
| 21 | 21 | public function Execute($imageResource) |
| 22 | 22 | { |
| 23 | 23 | // Define the origial width and height |
@@ -62,8 +62,8 @@ |
||
| 62 | 62 | |
| 63 | 63 | // Preserve transparency |
| 64 | 64 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
| 65 | - imagealphablending($new, false); |
|
| 66 | - imagesavealpha($new, true); |
|
| 65 | + imagealphablending($new, false); |
|
| 66 | + imagesavealpha($new, true); |
|
| 67 | 67 | |
| 68 | 68 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight); |
| 69 | 69 | |
@@ -40,7 +40,9 @@ |
||
| 40 | 40 | |
| 41 | 41 | // Define which ratio will be used, depending on which is the biggest side |
| 42 | 42 | $ratio = $wRatio < $hRatio ? $wRatio : $hRatio; |
| 43 | - if ($ratio < 1) $ratio = 1; |
|
| 43 | + if ($ratio < 1) { |
|
| 44 | + $ratio = 1; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | // Calculate the destination width, height, x and y |
| 46 | 48 | $this->_destWidth = $originalWidth / $ratio; |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $output = ''; |
| 50 | 50 | for ($i = 0; $i < $count; $i += 16) { |
| 51 | 51 | $random_state = |
| 52 | - md5(microtime() . $random_state); |
|
| 52 | + md5(microtime().$random_state); |
|
| 53 | 53 | $output .= |
| 54 | 54 | pack('H*', md5($random_state)); |
| 55 | 55 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | $relativeDocumentUri = current($this->matchedSitemapItem->matches[1]); |
| 17 | 17 | if (isset($this->parameters['folder'])) { |
| 18 | - $relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri; |
|
| 18 | + $relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $document = $storage->getDocumentBySlug($relativeDocumentUri); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param array $parameters |
| 41 | 41 | * @param $matchedSitemapItem |
| 42 | 42 | */ |
| 43 | - public function __construct($template='', Request $request, $parameters=array(), $matchedSitemapItem) |
|
| 43 | + public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem) |
|
| 44 | 44 | { |
| 45 | 45 | $this->template = $template; |
| 46 | 46 | $this->request = $request; |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | * @return string |
| 87 | 87 | * @throws \Exception |
| 88 | 88 | */ |
| 89 | - public function renderTemplate($template='') |
|
| 89 | + public function renderTemplate($template = '') |
|
| 90 | 90 | { |
| 91 | - $templatePath = __DIR__ . '/../../templates/' . $template . '.php'; |
|
| 91 | + $templatePath = __DIR__.'/../../templates/'.$template.'.php'; |
|
| 92 | 92 | if (realpath($templatePath) !== false) { |
| 93 | 93 | ob_clean(); |
| 94 | 94 | $this->parameters['request'] = $this->request; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | include($templatePath); |
| 97 | 97 | return ob_get_contents(); |
| 98 | 98 | } else { |
| 99 | - throw new \Exception('Couldnt find template ' . $templatePath); |
|
| 99 | + throw new \Exception('Couldnt find template '.$templatePath); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $this->parameters['mainNavClass'] = 'documents'; |
| 126 | 126 | if (isset($request::$post['title'], $request::$post['path'])) { |
| 127 | 127 | $this->storage->addDocumentFolder($request::$post); |
| 128 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 128 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 129 | 129 | exit; |
| 130 | 130 | } |
| 131 | 131 | } elseif ($relativeCmsUri == '/documents/new-document' && isset($request::$get['path']) && in_array('documents', $userRights)) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if (isset($request::$get['documentType'])) { |
| 136 | 136 | if (isset($request::$post['title'], $request::$get['documentType'], $request::$get['path'])) { |
| 137 | 137 | $this->storage->addDocument($request::$post); |
| 138 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 138 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 139 | 139 | exit; |
| 140 | 140 | } |
| 141 | 141 | $this->parameters['documentType'] = $this->storage->getDocumentTypeBySlug($request::$get['documentType'], true); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->parameters['smallestImage'] = $this->storage->getSmallestImageSet()->slug; |
| 150 | 150 | if (isset($request::$post['title'], $request::$get['slug'])) { |
| 151 | 151 | $this->storage->saveDocument($request::$post); |
| 152 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 152 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 153 | 153 | exit; |
| 154 | 154 | } |
| 155 | 155 | $this->parameters['document'] = $this->storage->getDocumentBySlug($request::$get['slug']); |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | array_pop($path); |
| 171 | 171 | $path = implode('/', $path); |
| 172 | 172 | |
| 173 | - $request::$get['path'] = '/' . $path; |
|
| 173 | + $request::$get['path'] = '/'.$path; |
|
| 174 | 174 | |
| 175 | 175 | if (isset($request::$post['title'], $request::$post['content'])) { |
| 176 | 176 | $this->storage->saveDocumentFolder($request::$post); |
| 177 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 177 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 178 | 178 | exit; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -182,11 +182,11 @@ discard block |
||
| 182 | 182 | $this->parameters['folder'] = $folder; |
| 183 | 183 | } else if ($relativeCmsUri == '/documents/delete-document' && isset($request::$get['slug']) && in_array('documents', $userRights)) { |
| 184 | 184 | $this->storage->deleteDocumentBySlug($request::$get['slug']); |
| 185 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 185 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 186 | 186 | exit; |
| 187 | 187 | } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get['slug']) && in_array('documents', $userRights)) { |
| 188 | 188 | $this->storage->deleteDocumentFolderBySlug($request::$get['slug']); |
| 189 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 189 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 190 | 190 | exit; |
| 191 | 191 | } elseif ($relativeCmsUri == '/sitemap' && in_array('sitemap', $userRights)) { |
| 192 | 192 | $template = 'cms/sitemap'; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $this->parameters['mainNavClass'] = 'sitemap'; |
| 201 | 201 | if (isset($request::$post['title'], $request::$post['template'], $request::$post['component'])) { |
| 202 | 202 | $this->storage->addSitemapItem($request::$post); |
| 203 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 203 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 204 | 204 | exit; |
| 205 | 205 | } |
| 206 | 206 | } elseif ($relativeCmsUri == '/sitemap/edit' && isset($request::$get['slug']) && in_array('sitemap', $userRights)) { |
@@ -209,13 +209,13 @@ discard block |
||
| 209 | 209 | $sitemapItem = $this->storage->getSitemapItemBySlug($request::$get['slug']); |
| 210 | 210 | if (isset($request::$post['title'], $request::$post['template'], $request::$post['component'])) { |
| 211 | 211 | $this->storage->saveSitemapItem($request::$get['slug'], $request::$post); |
| 212 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 212 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 213 | 213 | exit; |
| 214 | 214 | } |
| 215 | 215 | $this->parameters['sitemapItem'] = $sitemapItem; |
| 216 | 216 | } elseif ($relativeCmsUri == '/sitemap/delete' && isset($request::$get['slug']) && in_array('sitemap', $userRights)) { |
| 217 | 217 | $this->storage->deleteSitemapItemBySlug($request::$get['slug']); |
| 218 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 218 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 219 | 219 | exit; |
| 220 | 220 | } elseif ($relativeCmsUri == '/images' && in_array('images', $userRights)) { |
| 221 | 221 | $template = 'cms/images'; |
@@ -231,12 +231,12 @@ discard block |
||
| 231 | 231 | $this->parameters['mainNavClass'] = 'images'; |
| 232 | 232 | if (isset($_FILES['file'])) { |
| 233 | 233 | $this->storage->addImage($_FILES['file']); |
| 234 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/images'); |
|
| 234 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/images'); |
|
| 235 | 235 | exit; |
| 236 | 236 | } |
| 237 | 237 | } elseif ($relativeCmsUri == '/images/delete' && isset($request::$get['file']) && in_array('images', $userRights)) { |
| 238 | 238 | $this->storage->deleteImageByName($request::$get['file']); |
| 239 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/images'); |
|
| 239 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/images'); |
|
| 240 | 240 | exit; |
| 241 | 241 | } elseif ($relativeCmsUri == '/images/show' && isset($request::$get['file']) && in_array('images', $userRights)) { |
| 242 | 242 | $template = 'cms/images/show'; |
@@ -255,30 +255,30 @@ discard block |
||
| 255 | 255 | $this->parameters['mainNavClass'] = 'files'; |
| 256 | 256 | if (isset($_FILES['file'])) { |
| 257 | 257 | $this->storage->addFile($_FILES['file']); |
| 258 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/files'); |
|
| 258 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/files'); |
|
| 259 | 259 | exit; |
| 260 | 260 | } |
| 261 | 261 | } elseif ($relativeCmsUri == '/files/get' && isset($request::$get['file']) && in_array('files', $userRights)) { |
| 262 | 262 | $file = $this->storage->getFileByName($request::$get['file']); |
| 263 | - $path = realpath(__DIR__ . '/../../www/files/'); |
|
| 264 | - $quoted = sprintf('"%s"', addcslashes(basename($path . '/' . $file->file), '"\\')); |
|
| 265 | - $size = filesize($path . '/' . $file->file); |
|
| 263 | + $path = realpath(__DIR__.'/../../www/files/'); |
|
| 264 | + $quoted = sprintf('"%s"', addcslashes(basename($path.'/'.$file->file), '"\\')); |
|
| 265 | + $size = filesize($path.'/'.$file->file); |
|
| 266 | 266 | |
| 267 | 267 | header('Content-Description: File Transfer'); |
| 268 | - header('Content-Type: ' . $file->type); |
|
| 269 | - header('Content-Disposition: attachment; filename=' . $quoted); |
|
| 268 | + header('Content-Type: '.$file->type); |
|
| 269 | + header('Content-Disposition: attachment; filename='.$quoted); |
|
| 270 | 270 | header('Content-Transfer-Encoding: binary'); |
| 271 | 271 | header('Connection: Keep-Alive'); |
| 272 | 272 | header('Expires: 0'); |
| 273 | 273 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 274 | 274 | header('Pragma: public'); |
| 275 | - header('Content-Length: ' . $size); |
|
| 275 | + header('Content-Length: '.$size); |
|
| 276 | 276 | |
| 277 | - readfile($path . '/' . $file->file); |
|
| 277 | + readfile($path.'/'.$file->file); |
|
| 278 | 278 | exit; |
| 279 | 279 | } elseif ($relativeCmsUri == '/files/delete' && isset($request::$get['file']) && in_array('files', $userRights)) { |
| 280 | 280 | $this->storage->deleteFileByName($request::$get['file']); |
| 281 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/files'); |
|
| 281 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/files'); |
|
| 282 | 282 | exit; |
| 283 | 283 | } elseif ($relativeCmsUri == '/configuration' && in_array('configuration', $userRights)) { |
| 284 | 284 | $template = 'cms/configuration'; |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | $this->parameters['mainNavClass'] = 'configuration'; |
| 293 | 293 | if (isset($_POST['username'])) { |
| 294 | 294 | $this->storage->addUser($request::$post); |
| 295 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 295 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 296 | 296 | exit; |
| 297 | 297 | } |
| 298 | 298 | } elseif ($relativeCmsUri == '/configuration/users/delete' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
| 299 | 299 | $this->storage->deleteUserBySlug($request::$get['slug']); |
| 300 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 300 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 301 | 301 | exit; |
| 302 | 302 | } elseif ($relativeCmsUri == '/configuration/users/edit' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
| 303 | 303 | $template = 'cms/configuration/users-form'; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $this->parameters['user'] = $this->storage->getUserBySlug($request::$get['slug']); |
| 306 | 306 | if (isset($_POST['username'])) { |
| 307 | 307 | $this->storage->saveUser($request::$get['slug'], $request::$post); |
| 308 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 308 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 309 | 309 | exit; |
| 310 | 310 | } |
| 311 | 311 | } elseif ($relativeCmsUri == '/configuration/document-types' && in_array('configuration', $userRights)) { |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $bricks = $this->storage->getBricks(); |
| 319 | 319 | if (isset($request::$post['title'])) { |
| 320 | 320 | $this->storage->addDocumentType($request::$post); |
| 321 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 321 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 322 | 322 | exit; |
| 323 | 323 | } |
| 324 | 324 | $this->parameters['bricks'] = $bricks; |
@@ -329,14 +329,14 @@ discard block |
||
| 329 | 329 | $bricks = $this->storage->getBricks(); |
| 330 | 330 | if (isset($request::$post['title'])) { |
| 331 | 331 | $this->storage->saveDocumentType($request::$get['slug'], $request::$post); |
| 332 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 332 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 333 | 333 | exit; |
| 334 | 334 | } |
| 335 | 335 | $this->parameters['documentType'] = $documentType; |
| 336 | 336 | $this->parameters['bricks'] = $bricks; |
| 337 | 337 | } elseif ($relativeCmsUri == '/configuration/document-types/delete' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
| 338 | 338 | $this->storage->deleteDocumentTypeBySlug($request::$get['slug']); |
| 339 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 339 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 340 | 340 | exit; |
| 341 | 341 | } elseif ($relativeCmsUri == '/configuration/bricks' && in_array('configuration', $userRights)) { |
| 342 | 342 | $template = 'cms/configuration/bricks'; |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $this->parameters['mainNavClass'] = 'configuration'; |
| 348 | 348 | if (isset($request::$post['title'])) { |
| 349 | 349 | $this->storage->addBrick($request::$post); |
| 350 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 350 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 351 | 351 | exit; |
| 352 | 352 | } |
| 353 | 353 | } elseif ($relativeCmsUri == '/configuration/bricks/edit' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
@@ -356,13 +356,13 @@ discard block |
||
| 356 | 356 | $brick = $this->storage->getBrickBySlug($request::$get['slug']); |
| 357 | 357 | if (isset($request::$post['title'])) { |
| 358 | 358 | $this->storage->saveBrick($request::$get['slug'], $request::$post); |
| 359 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 359 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 360 | 360 | exit; |
| 361 | 361 | } |
| 362 | 362 | $this->parameters['brick'] = $brick; |
| 363 | 363 | } elseif ($relativeCmsUri == '/configuration/bricks/delete' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
| 364 | 364 | $this->storage->deleteBrickBySlug($request::$get['slug']); |
| 365 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 365 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 366 | 366 | exit; |
| 367 | 367 | } elseif ($relativeCmsUri == '/configuration/image-set' && in_array('configuration', $userRights)) { |
| 368 | 368 | $template = 'cms/configuration/image-set'; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | $imageSet = $this->storage->getImageSetBySlug($request::$get['slug']); |
| 375 | 375 | if (isset($request::$post['title'])) { |
| 376 | 376 | $this->storage->saveImageSet($request::$get['slug'], $request::$post); |
| 377 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 377 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 378 | 378 | exit; |
| 379 | 379 | } |
| 380 | 380 | $this->parameters['imageSet'] = $imageSet; |
@@ -383,17 +383,17 @@ discard block |
||
| 383 | 383 | $this->parameters['mainNavClass'] = 'configuration'; |
| 384 | 384 | if (isset($request::$post['title'])) { |
| 385 | 385 | $this->storage->addImageSet($request::$post); |
| 386 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 386 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 387 | 387 | exit; |
| 388 | 388 | } |
| 389 | 389 | } elseif ($relativeCmsUri == '/configuration/image-set/delete' && isset($request::$get['slug']) && in_array('configuration', $userRights)) { |
| 390 | 390 | $this->storage->deleteImageSetBySlug($request::$get['slug']); |
| 391 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 391 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 392 | 392 | exit; |
| 393 | 393 | } elseif ($relativeCmsUri == '/log-off') { |
| 394 | 394 | $_SESSION['cloudcontrol'] = null; |
| 395 | 395 | unset($_SESSION['cloudcontrol']); |
| 396 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix']); |
|
| 396 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix']); |
|
| 397 | 397 | exit; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | $whitelistIps = explode(',', $this->parameters['whitelistIps']); |
| 409 | 409 | $whitelistIps = array_map("trim", $whitelistIps); |
| 410 | 410 | if (!in_array($remoteAddress, $whitelistIps)) { |
| 411 | - throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
| 411 | + throw new \Exception('Ip address '.$remoteAddress.' is not on whitelist'); |
|
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | } |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $blacklistIps = explode(',', $this->parameters['blacklistIps']); |
| 420 | 420 | $blacklistIps = array_map("trim", $blacklistIps); |
| 421 | 421 | if (in_array($remoteAddress, $blacklistIps)) { |
| 422 | - throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
| 422 | + throw new \Exception('Ip address '.$remoteAddress.' is on blacklist'); |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | spl_autoload_extensions('.php'); |
| 3 | 3 | spl_autoload_register("autoloader"); |
| 4 | 4 | |
| 5 | -$rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 5 | +$rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)).'/../../').'/'); |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * The function to be registered as the default autoload functino |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | global $rootPath; |
| 35 | - $file = $rootPath . str_replace('\\', '/', $class) . ".php"; |
|
| 35 | + $file = $rootPath.str_replace('\\', '/', $class).".php"; |
|
| 36 | 36 | $debug_backtrace = debug_backtrace(); |
| 37 | 37 | |
| 38 | 38 | if (file_exists($file)) { |
| 39 | 39 | require_once($file); |
| 40 | 40 | if ($throwException) { |
| 41 | 41 | if (class_exists($class, false) == false && interface_exists($class, false) == false) { |
| 42 | - throw new \Exception('Could not load class "' . $class . '" in file ' . $file); |
|
| 42 | + throw new \Exception('Could not load class "'.$class.'" in file '.$file); |
|
| 43 | 43 | } else { |
| 44 | 44 | return true; |
| 45 | 45 | } |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | } else { |
| 49 | 49 | if (isset($debug_backtrace[2]) && isset($debug_backtrace[2]['file']) && isset($debug_backtrace[2]['line'])) { |
| 50 | 50 | if ($throwException) { |
| 51 | - errorHandler(0, 'Could not load class \'' . $class . '\' in file ' . $rootPath . $file, $debug_backtrace[2]['file'], $debug_backtrace[2]['line']); |
|
| 51 | + errorHandler(0, 'Could not load class \''.$class.'\' in file '.$rootPath.$file, $debug_backtrace[2]['file'], $debug_backtrace[2]['line']); |
|
| 52 | 52 | } else { |
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | 55 | } else { |
| 56 | 56 | if ($throwException) { |
| 57 | - throw new \Exception('Could not load class "' . $class . '" in file ' . $file . "\n" . 'Called from unknown origin.'); |
|
| 57 | + throw new \Exception('Could not load class "'.$class.'" in file '.$file."\n".'Called from unknown origin.'); |
|
| 58 | 58 | } else { |
| 59 | 59 | return false; |
| 60 | 60 | } |