@@ -9,8 +9,10 @@ |
||
| 9 | 9 | <? if (isset($dynamicBrick)) : |
| 10 | 10 | $fieldSlug = $field->slug; |
| 11 | 11 | $value = isset($dynamicBrick->fields->$fieldSlug) ? current($dynamicBrick->fields->$fieldSlug) : ''; |
| 12 | - else : |
|
| 12 | + else { |
|
| 13 | + : |
|
| 13 | 14 | $value = ''; |
| 15 | + } |
|
| 14 | 16 | endif ?> |
| 15 | 17 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 16 | 18 | <ul class="grid-wrapper sortable"> |
@@ -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 | |
@@ -109,8 +109,8 @@ |
||
| 109 | 109 | |
| 110 | 110 | // Preserve transparency |
| 111 | 111 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
| 112 | - imagealphablending($new, false); |
|
| 113 | - imagesavealpha($new, true); |
|
| 112 | + imagealphablending($new, false); |
|
| 113 | + imagesavealpha($new, true); |
|
| 114 | 114 | |
| 115 | 115 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $this->_destWidth, $this->_destHeight); |
| 116 | 116 | |
@@ -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; |
@@ -1,7 +1,8 @@ discard block |
||
| 1 | 1 | <form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#' . $formId : '' ?>"> |
| 2 | 2 | <? if (!isset($hideTitleAndState)) : ?> |
| 3 | 3 | <input type="hidden" name="path" value="<?=$request::$get['path']?>" /> |
| 4 | - <? else : ?> |
|
| 4 | + <? else { |
|
| 5 | + : ?> |
|
| 5 | 6 | <input type="hidden" name="formId" value="<?=$formId?>" /> |
| 6 | 7 | <a name="<?=$formId?>"></a> |
| 7 | 8 | <? endif ?> |
@@ -20,15 +21,19 @@ discard block |
||
| 20 | 21 | <input<?=isset($document) && $document->state == 'published' ? ' checked="checked"' : '' ?> type="checkbox" id="state" name="state" placeholder="State" /> |
| 21 | 22 | </div> |
| 22 | 23 | <? endif ?> |
| 23 | - <?$fieldPrefix='fields';?> |
|
| 24 | + <?$fieldPrefix='fields'; |
|
| 25 | +} |
|
| 26 | +?> |
|
| 24 | 27 | <? foreach ($documentType->fields as $field) : ?> |
| 25 | 28 | <div class="form-element"> |
| 26 | 29 | <label for="<?=$field->slug?>"><?=$field->title?></label> |
| 27 | 30 | <? if (isset($document)) : |
| 28 | 31 | $fieldSlug = $field->slug; |
| 29 | 32 | $value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : ''; |
| 30 | - else : |
|
| 33 | + else { |
|
| 34 | + : |
|
| 31 | 35 | $value = ''; |
| 36 | + } |
|
| 32 | 37 | endif ?> |
| 33 | 38 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 34 | 39 | <ul class="grid-wrapper sortable"> |
@@ -138,8 +143,11 @@ discard block |
||
| 138 | 143 | </ul> |
| 139 | 144 | <a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a> |
| 140 | 145 | <?$static_brick_nr += 1?> |
| 141 | - <? else : ?> |
|
| 142 | - <?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?> |
|
| 146 | + <? else { |
|
| 147 | + : ?> |
|
| 148 | + <?$fieldPrefix='bricks[' . $brick->slug . '][fields]'; |
|
| 149 | +} |
|
| 150 | +?> |
|
| 143 | 151 | <input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" /> |
| 144 | 152 | <? foreach ($brick->structure->fields as $field) : ?> |
| 145 | 153 | <div class="form-element"> |
@@ -148,8 +156,10 @@ discard block |
||
| 148 | 156 | $brickSlug = $brick->slug; |
| 149 | 157 | $fieldSlug = $field->slug; |
| 150 | 158 | $value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : ''; |
| 151 | - else : |
|
| 159 | + else { |
|
| 160 | + : |
|
| 152 | 161 | $value = ''; |
| 162 | + } |
|
| 153 | 163 | endif ?> |
| 154 | 164 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 155 | 165 | <ul class="grid-wrapper sortable"> |
@@ -14,24 +14,24 @@ |
||
| 14 | 14 | class SitemapRouting implements CmsRouting |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * SitemapRouting constructor. |
|
| 19 | - * @param \library\cc\Request $request |
|
| 20 | - * @param mixed|string $relativeCmsUri |
|
| 21 | - * @param CmsComponent $cmsComponent |
|
| 22 | - */ |
|
| 23 | - public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 24 | - { |
|
| 25 | - if ($relativeCmsUri == '/sitemap') { |
|
| 17 | + /** |
|
| 18 | + * SitemapRouting constructor. |
|
| 19 | + * @param \library\cc\Request $request |
|
| 20 | + * @param mixed|string $relativeCmsUri |
|
| 21 | + * @param CmsComponent $cmsComponent |
|
| 22 | + */ |
|
| 23 | + public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 24 | + { |
|
| 25 | + if ($relativeCmsUri == '/sitemap') { |
|
| 26 | 26 | $this->overviewRoute($request, $cmsComponent); |
| 27 | - } elseif ($relativeCmsUri == '/sitemap/new') { |
|
| 27 | + } elseif ($relativeCmsUri == '/sitemap/new') { |
|
| 28 | 28 | $this->newRoute($request, $cmsComponent); |
| 29 | - } elseif ($relativeCmsUri == '/sitemap/edit' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 29 | + } elseif ($relativeCmsUri == '/sitemap/edit' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 30 | 30 | $this->editRoute($request, $cmsComponent); |
| 31 | - } elseif ($relativeCmsUri == '/sitemap/delete' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 31 | + } elseif ($relativeCmsUri == '/sitemap/delete' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 32 | 32 | $this->deleteRoute($request, $cmsComponent); |
| 33 | - } |
|
| 34 | - } |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param $request |
@@ -13,26 +13,26 @@ |
||
| 13 | 13 | class ImagesRouting implements CmsRouting |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * ImagesRouting constructor. |
|
| 18 | - * @param \library\cc\Request $request |
|
| 19 | - * @param mixed|string $relativeCmsUri |
|
| 20 | - * @param CmsComponent $cmsComponent |
|
| 21 | - */ |
|
| 22 | - public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 23 | - { |
|
| 24 | - if ($relativeCmsUri == '/images') { |
|
| 16 | + /** |
|
| 17 | + * ImagesRouting constructor. |
|
| 18 | + * @param \library\cc\Request $request |
|
| 19 | + * @param mixed|string $relativeCmsUri |
|
| 20 | + * @param CmsComponent $cmsComponent |
|
| 21 | + */ |
|
| 22 | + public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 23 | + { |
|
| 24 | + if ($relativeCmsUri == '/images') { |
|
| 25 | 25 | $this->overviewRoute($cmsComponent); |
| 26 | - } elseif ($relativeCmsUri == '/images.json') { |
|
| 26 | + } elseif ($relativeCmsUri == '/images.json') { |
|
| 27 | 27 | $this->jsonRoute($cmsComponent); |
| 28 | - } elseif ($relativeCmsUri == '/images/new') { |
|
| 28 | + } elseif ($relativeCmsUri == '/images/new') { |
|
| 29 | 29 | $this->newRoute($request, $cmsComponent); |
| 30 | - } elseif ($relativeCmsUri == '/images/delete' && isset($request::$get[CmsComponent::FILES_PARAMETER_FILE])) { |
|
| 30 | + } elseif ($relativeCmsUri == '/images/delete' && isset($request::$get[CmsComponent::FILES_PARAMETER_FILE])) { |
|
| 31 | 31 | $this->deleteRoute($request, $cmsComponent); |
| 32 | - } elseif ($relativeCmsUri == '/images/show' && isset($request::$get[CmsComponent::FILES_PARAMETER_FILE])) { |
|
| 32 | + } elseif ($relativeCmsUri == '/images/show' && isset($request::$get[CmsComponent::FILES_PARAMETER_FILE])) { |
|
| 33 | 33 | $this->showRoute($request, $cmsComponent); |
| 34 | - } |
|
| 35 | - } |
|
| 34 | + } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @param $cmsComponent |
@@ -12,58 +12,58 @@ |
||
| 12 | 12 | |
| 13 | 13 | class DocumentRouting implements CmsRouting |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * DocumentRouting constructor. |
|
| 17 | - * @param $request |
|
| 18 | - * @param $relativeCmsUri |
|
| 19 | - * @param CmsComponent $cmsComponent |
|
| 20 | - */ |
|
| 21 | - public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 22 | - { |
|
| 23 | - if ($relativeCmsUri == '/documents') { |
|
| 24 | - $cmsComponent->subTemplate = 'cms/documents'; |
|
| 25 | - $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()); |
|
| 26 | - $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
|
| 27 | - } |
|
| 28 | - $this->documentRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 29 | - $this->folderRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @param $request |
|
| 35 | - * @param $relativeCmsUri |
|
| 36 | - * @param CmsComponent $cmsComponent |
|
| 37 | - * @throws \Exception |
|
| 38 | - */ |
|
| 39 | - private function documentRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 40 | - { |
|
| 41 | - if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 15 | + /** |
|
| 16 | + * DocumentRouting constructor. |
|
| 17 | + * @param $request |
|
| 18 | + * @param $relativeCmsUri |
|
| 19 | + * @param CmsComponent $cmsComponent |
|
| 20 | + */ |
|
| 21 | + public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 22 | + { |
|
| 23 | + if ($relativeCmsUri == '/documents') { |
|
| 24 | + $cmsComponent->subTemplate = 'cms/documents'; |
|
| 25 | + $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()); |
|
| 26 | + $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
|
| 27 | + } |
|
| 28 | + $this->documentRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 29 | + $this->folderRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @param $request |
|
| 35 | + * @param $relativeCmsUri |
|
| 36 | + * @param CmsComponent $cmsComponent |
|
| 37 | + * @throws \Exception |
|
| 38 | + */ |
|
| 39 | + private function documentRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 40 | + { |
|
| 41 | + if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 42 | 42 | $this->documentOverviewRoute($request, $cmsComponent); |
| 43 | - } elseif ($relativeCmsUri == '/documents/edit-document' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 43 | + } elseif ($relativeCmsUri == '/documents/edit-document' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 44 | 44 | $this->editDocumentRoute($request, $cmsComponent); |
| 45 | - } elseif ($relativeCmsUri == '/documents/get-brick' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 45 | + } elseif ($relativeCmsUri == '/documents/get-brick' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 46 | 46 | $this->getBrickRoute($request, $cmsComponent); |
| 47 | - } else if ($relativeCmsUri == '/documents/delete-document' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 47 | + } else if ($relativeCmsUri == '/documents/delete-document' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 48 | 48 | $this->deleteDocumentRoute($request, $cmsComponent); |
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @param $request |
|
| 54 | - * @param $relativeCmsUri |
|
| 55 | - * @param CmsComponent $cmsComponent |
|
| 56 | - */ |
|
| 57 | - private function folderRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 58 | - { |
|
| 59 | - if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 49 | + } |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @param $request |
|
| 54 | + * @param $relativeCmsUri |
|
| 55 | + * @param CmsComponent $cmsComponent |
|
| 56 | + */ |
|
| 57 | + private function folderRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 58 | + { |
|
| 59 | + if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 60 | 60 | $this->newFolderRoute($request, $cmsComponent); |
| 61 | - } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 61 | + } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 62 | 62 | $this->editFolderRoute($request, $cmsComponent); |
| 63 | - } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 63 | + } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 64 | 64 | $this->deleteFolderRoute($request, $cmsComponent); |
| 65 | - } |
|
| 66 | - } |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * @param $request |