@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function addImage($postValues) |
| 35 | 35 | { |
| 36 | - $destinationPath = realpath(__DIR__ . '/../../../www/images/'); |
|
| 36 | + $destinationPath = realpath(__DIR__.'/../../../www/images/'); |
|
| 37 | 37 | |
| 38 | 38 | $filename = $this->validateFilename($postValues['name'], $destinationPath); |
| 39 | - $destination = $destinationPath . '/' . $filename; |
|
| 39 | + $destination = $destinationPath.'/'.$filename; |
|
| 40 | 40 | |
| 41 | 41 | if ($postValues['error'] != '0') { |
| 42 | - throw new \Exception('Error uploading file. Error code: ' . $postValues['error']); |
|
| 42 | + throw new \Exception('Error uploading file. Error code: '.$postValues['error']); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (move_uploaded_file($postValues['tmp_name'], $destination)) { |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function deleteImageByName($filename) |
| 66 | 66 | { |
| 67 | - $destinationPath = realpath(__DIR__ . '/../../../www/images/'); |
|
| 67 | + $destinationPath = realpath(__DIR__.'/../../../www/images/'); |
|
| 68 | 68 | |
| 69 | 69 | $images = $this->getImages(); |
| 70 | 70 | |
| 71 | 71 | foreach ($images as $key => $image) { |
| 72 | 72 | if ($image->file == $filename) { |
| 73 | 73 | foreach ($image->set as $imageSetFilename) { |
| 74 | - $destination = $destinationPath . '/' . $imageSetFilename; |
|
| 74 | + $destination = $destinationPath.'/'.$imageSetFilename; |
|
| 75 | 75 | if (file_exists($destination)) { |
| 76 | 76 | unlink($destination); |
| 77 | 77 | } else { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * @param $request |
|
| 71 | + * @param Request $request |
|
| 72 | 72 | * @param CmsComponent $cmsComponent |
| 73 | 73 | */ |
| 74 | 74 | private function newRoute($request, $cmsComponent) |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @param $request |
|
| 86 | + * @param Request $request |
|
| 87 | 87 | * @param CmsComponent $cmsComponent |
| 88 | 88 | */ |
| 89 | 89 | private function deleteRoute($request, $cmsComponent) |
@@ -39,21 +39,21 @@ discard block |
||
| 39 | 39 | private function downloadRoute($slug, $cmsComponent) |
| 40 | 40 | { |
| 41 | 41 | $file = $cmsComponent->storage->getFiles()->getFileByName($slug); |
| 42 | - $path = realpath(__DIR__ . '/../../../www/files/'); |
|
| 43 | - $quoted = sprintf('"%s"', addcslashes(basename($path . '/' . $file->file), '"\\')); |
|
| 44 | - $size = filesize($path . '/' . $file->file); |
|
| 42 | + $path = realpath(__DIR__.'/../../../www/files/'); |
|
| 43 | + $quoted = sprintf('"%s"', addcslashes(basename($path.'/'.$file->file), '"\\')); |
|
| 44 | + $size = filesize($path.'/'.$file->file); |
|
| 45 | 45 | |
| 46 | 46 | header('Content-Description: File Transfer'); |
| 47 | - header('Content-Type: ' . $file->type); |
|
| 48 | - header('Content-Disposition: attachment; filename=' . $quoted); |
|
| 47 | + header('Content-Type: '.$file->type); |
|
| 48 | + header('Content-Disposition: attachment; filename='.$quoted); |
|
| 49 | 49 | header('Content-Transfer-Encoding: binary'); |
| 50 | 50 | header('Connection: Keep-Alive'); |
| 51 | 51 | header('Expires: 0'); |
| 52 | 52 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 53 | 53 | header('Pragma: public'); |
| 54 | - header('Content-Length: ' . $size); |
|
| 54 | + header('Content-Length: '.$size); |
|
| 55 | 55 | |
| 56 | - readfile($path . '/' . $file->file); |
|
| 56 | + readfile($path.'/'.$file->file); |
|
| 57 | 57 | exit; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_FILES); |
| 78 | 78 | if (isset($_FILES[CmsComponent::FILES_PARAMETER_FILE])) { |
| 79 | 79 | $cmsComponent->storage->getFiles()->addFile($_FILES[CmsComponent::FILES_PARAMETER_FILE]); |
| 80 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/files'); |
|
| 80 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/files'); |
|
| 81 | 81 | exit; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | private function deleteRoute($request, $cmsComponent) |
| 90 | 90 | { |
| 91 | 91 | $cmsComponent->storage->getFiles()->deleteFileByName($request::$get[CmsComponent::FILES_PARAMETER_FILE]); |
| 92 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/files'); |
|
| 92 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/files'); |
|
| 93 | 93 | exit; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function addFile($postValues) |
| 27 | 27 | { |
| 28 | - $destinationPath = realpath(__DIR__ . '/../../../www/files/'); |
|
| 28 | + $destinationPath = realpath(__DIR__.'/../../../www/files/'); |
|
| 29 | 29 | |
| 30 | 30 | $filename = $this->validateFilename($postValues['name'], $destinationPath); |
| 31 | - $destination = $destinationPath . '/' . $filename; |
|
| 31 | + $destination = $destinationPath.'/'.$filename; |
|
| 32 | 32 | |
| 33 | 33 | if ($postValues['error'] != '0') { |
| 34 | - throw new \Exception('Error uploading file. Error code: ' . $postValues['error']); |
|
| 34 | + throw new \Exception('Error uploading file. Error code: '.$postValues['error']); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (move_uploaded_file($postValues['tmp_name'], $destination)) { |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function deleteFileByName($filename) |
| 75 | 75 | { |
| 76 | - $destinationPath = realpath(__DIR__ . '/../../../www/files/'); |
|
| 77 | - $destination = $destinationPath . '/' . $filename; |
|
| 76 | + $destinationPath = realpath(__DIR__.'/../../../www/files/'); |
|
| 77 | + $destination = $destinationPath.'/'.$filename; |
|
| 78 | 78 | |
| 79 | 79 | if (file_exists($destination)) { |
| 80 | 80 | $files = $this->getFiles(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
| 57 | 57 | if (isset($request::$post[CmsComponent::POST_PARAMETER_USERNAME])) { |
| 58 | 58 | $cmsComponent->storage->getUsers()->addUser($request::$post); |
| 59 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/users'); |
|
| 59 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/users'); |
|
| 60 | 60 | exit; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | private function deleteRoute($request, $cmsComponent) |
| 69 | 69 | { |
| 70 | 70 | $cmsComponent->storage->getUsers()->deleteUserBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 71 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/users'); |
|
| 71 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/users'); |
|
| 72 | 72 | exit; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $cmsComponent->setParameter(CmsComponent::PARAMETER_USER, $cmsComponent->storage->getUsers()->getUserBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG])); |
| 84 | 84 | if (isset($_POST[CmsComponent::POST_PARAMETER_USERNAME])) { |
| 85 | 85 | $cmsComponent->storage->getUsers()->saveUser($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 86 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/users'); |
|
| 86 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/users'); |
|
| 87 | 87 | exit; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
| 56 | 56 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 57 | 57 | $cmsComponent->storage->getBricks()->addBrick($request::$post); |
| 58 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/bricks'); |
|
| 58 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/bricks'); |
|
| 59 | 59 | exit; |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $brick = $cmsComponent->storage->getBricks()->getBrickBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 72 | 72 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 73 | 73 | $cmsComponent->storage->getBricks()->saveBrick($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 74 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/bricks'); |
|
| 74 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/bricks'); |
|
| 75 | 75 | exit; |
| 76 | 76 | } |
| 77 | 77 | $cmsComponent->setParameter(CmsComponent::PARAMETER_BRICK, $brick); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | private function deleteRoute($request, $cmsComponent) |
| 85 | 85 | { |
| 86 | 86 | $cmsComponent->storage->getBricks()->deleteBrickBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 87 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/bricks'); |
|
| 87 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/bricks'); |
|
| 88 | 88 | exit; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $bricks = $cmsComponent->storage->getBricks()->getBricks(); |
| 57 | 57 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 58 | 58 | $cmsComponent->storage->getDocumentTypes()->addDocumentType($request::$post); |
| 59 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types'); |
|
| 59 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types'); |
|
| 60 | 60 | exit; |
| 61 | 61 | } |
| 62 | 62 | $cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $bricks); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $bricks = $cmsComponent->storage->getBricks()->getBricks(); |
| 75 | 75 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 76 | 76 | $cmsComponent->storage->getDocumentTypes()->saveDocumentType($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 77 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types'); |
|
| 77 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types'); |
|
| 78 | 78 | exit; |
| 79 | 79 | } |
| 80 | 80 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $documentType); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | private function deleteRoute($request, $cmsComponent) |
| 89 | 89 | { |
| 90 | 90 | $cmsComponent->storage->getDocumentTypes()->deleteDocumentTypeBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 91 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types'); |
|
| 91 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types'); |
|
| 92 | 92 | exit; |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | \ No newline at end of file |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | private function tokenizeBrick($brick, $brickSlug) |
| 91 | 91 | { |
| 92 | - $fields = $brick->fields; |
|
| 92 | + $fields = $brick->fields; |
|
| 93 | 93 | $brickDefinition = $this->storage->getBricks()->getBrickBySlug($brick->type); |
| 94 | 94 | foreach ($fields as $fieldName => $field) { |
| 95 | 95 | $fieldType = $this->getFieldType($fieldName, $brickDefinition); |
| 96 | - $this->tokenizeField($field, $brickSlug . '__' . $fieldName, $fieldType); |
|
| 96 | + $this->tokenizeField($field, $brickSlug.'__'.$fieldName, $fieldType); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $dynamicBricks = $this->document->dynamicBricks; |
| 103 | 103 | foreach ($dynamicBricks as $key => $brick) { |
| 104 | - $this->tokenizeBrick($brick, 'dynamicBricks__' . $brick->type . $key); |
|
| 104 | + $this->tokenizeBrick($brick, 'dynamicBricks__'.$brick->type.$key); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -154,6 +154,6 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - throw new \Exception('Unknown field type for field' . $fieldName . ' in document ' . $this->document->path); |
|
| 157 | + throw new \Exception('Unknown field type for field'.$fieldName.' in document '.$this->document->path); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
| 56 | 56 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 57 | 57 | $cmsComponent->storage->getApplicationComponents()->addApplicationComponent($request::$post); |
| 58 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
| 58 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
| 59 | 59 | exit; |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $applicationComponent = $cmsComponent->storage->getApplicationComponents()->getApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 72 | 72 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 73 | 73 | $cmsComponent->storage->getApplicationComponents()->saveApplicationComponent($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 74 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
| 74 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
| 75 | 75 | exit; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | private function deleteRoute($request, $cmsComponent) |
| 86 | 86 | { |
| 87 | 87 | $cmsComponent->storage->getApplicationComponents()->deleteApplicationComponentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 88 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/application-components'); |
|
| 88 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/application-components'); |
|
| 89 | 89 | exit; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | \ No newline at end of file |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if (isset($this->parameters['document'])) { |
| 86 | 86 | $this->runByDocumentParameter(); |
| 87 | 87 | } else { |
| 88 | - throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title); |
|
| 88 | + throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $relativeDocumentUri = current($this->matchedSitemapItem->matches[1]); |
| 103 | 103 | if (isset($this->parameters['folder'])) { |
| 104 | 104 | if (substr($this->parameters['folder'], -1) !== '/') { |
| 105 | - $this->parameters['folder'] = $this->parameters['folder'] . '/'; |
|
| 105 | + $this->parameters['folder'] = $this->parameters['folder'].'/'; |
|
| 106 | 106 | } |
| 107 | - $relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri; |
|
| 107 | + $relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $document = $this->storage->getDocuments()->getDocumentBySlug($relativeDocumentUri); |