@@ -14,8 +14,10 @@ |
||
| 14 | 14 | <? if (isset($dynamicBrick)) : |
| 15 | 15 | $fieldSlug = $field->slug; |
| 16 | 16 | $value = isset($dynamicBrick->fields->$fieldSlug) ? current($dynamicBrick->fields->$fieldSlug) : ''; |
| 17 | - else : |
|
| 17 | + else { |
|
| 18 | + : |
|
| 18 | 19 | $value = ''; |
| 20 | + } |
|
| 19 | 21 | endif ?> |
| 20 | 22 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 21 | 23 | <ul class="grid-wrapper sortable"> |
@@ -27,7 +27,9 @@ |
||
| 27 | 27 | |
| 28 | 28 | // Define which ratio will be used, depending on which is the smallest side |
| 29 | 29 | $ratio = min($hRatio, $wRatio); |
| 30 | - if ($ratio > 1) $ratio = 1; |
|
| 30 | + if ($ratio > 1) { |
|
| 31 | + $ratio = 1; |
|
| 32 | + } |
|
| 31 | 33 | |
| 32 | 34 | // Define sizes |
| 33 | 35 | $this->_destWidth = floor($originalWidth * $ratio); |
@@ -37,7 +37,9 @@ |
||
| 37 | 37 | |
| 38 | 38 | // Define which ratio will be used, depending on which is the biggest side |
| 39 | 39 | $ratio = $wRatio < $hRatio ? $wRatio : $hRatio; |
| 40 | - if ($ratio < 1) $ratio = 1; |
|
| 40 | + if ($ratio < 1) { |
|
| 41 | + $ratio = 1; |
|
| 42 | + } |
|
| 41 | 43 | |
| 42 | 44 | // Calculate the destination width, height, x and y |
| 43 | 45 | $this->_destWidth = $originalWidth / $ratio; |
@@ -63,7 +63,9 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function calculateX($imageResource) |
| 65 | 65 | { |
| 66 | - if (intval($this->_x) === $this->_x) return $this->_x; |
|
| 66 | + if (intval($this->_x) === $this->_x) { |
|
| 67 | + return $this->_x; |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | $x = strtolower($this->_x); |
| 69 | 71 | |
@@ -88,7 +90,9 @@ discard block |
||
| 88 | 90 | */ |
| 89 | 91 | public function calculateY($imageResource) |
| 90 | 92 | { |
| 91 | - if (intval($this->_y) === $this->_y) return $this->_y; |
|
| 93 | + if (intval($this->_y) === $this->_y) { |
|
| 94 | + return $this->_y; |
|
| 95 | + } |
|
| 92 | 96 | |
| 93 | 97 | $y = strtolower($this->_y); |
| 94 | 98 | |
@@ -125,7 +129,9 @@ discard block |
||
| 125 | 129 | */ |
| 126 | 130 | public function GetWatermark() |
| 127 | 131 | { |
| 128 | - if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
| 132 | + if ($this->_watermark == null) { |
|
| 133 | + throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
| 134 | + } |
|
| 129 | 135 | return $this->_watermark; |
| 130 | 136 | } |
| 131 | 137 | |
@@ -78,12 +78,15 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public static function humanFileSize($size, $unit = "") |
| 80 | 80 | { |
| 81 | - if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
| 82 | - return number_format($size / (1 << 30), 2) . "GB"; |
|
| 83 | - if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
| 84 | - return number_format($size / (1 << 20), 2) . "MB"; |
|
| 85 | - if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
| 86 | - return number_format($size / (1 << 10), 2) . "KB"; |
|
| 81 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") { |
|
| 82 | + return number_format($size / (1 << 30), 2) . "GB"; |
|
| 83 | + } |
|
| 84 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") { |
|
| 85 | + return number_format($size / (1 << 20), 2) . "MB"; |
|
| 86 | + } |
|
| 87 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") { |
|
| 88 | + return number_format($size / (1 << 10), 2) . "KB"; |
|
| 89 | + } |
|
| 87 | 90 | |
| 88 | 91 | return number_format($size) . " bytes"; |
| 89 | 92 | } |
@@ -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 ?> |
@@ -17,15 +18,19 @@ discard block |
||
| 17 | 18 | <input required="required" value="<?=isset($document) ? $document->title : '' ?>"<?= isset($document, $document->title) && !empty($document->title) ? ' readonly="readonly"' : '' ?> type="text" id="title" name="title" placeholder="Title" /> |
| 18 | 19 | </div> |
| 19 | 20 | <? endif ?> |
| 20 | - <?$fieldPrefix='fields';?> |
|
| 21 | + <?$fieldPrefix='fields'; |
|
| 22 | +} |
|
| 23 | +?> |
|
| 21 | 24 | <? foreach ($documentType->fields as $field) : ?> |
| 22 | 25 | <div class="form-element"> |
| 23 | 26 | <label for="<?=$field->slug?>"><?=$field->title?></label> |
| 24 | 27 | <? if (isset($document)) : |
| 25 | 28 | $fieldSlug = $field->slug; |
| 26 | 29 | $value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : ''; |
| 27 | - else : |
|
| 30 | + else { |
|
| 31 | + : |
|
| 28 | 32 | $value = ''; |
| 33 | + } |
|
| 29 | 34 | endif ?> |
| 30 | 35 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 31 | 36 | <ul class="grid-wrapper sortable"> |
@@ -135,8 +140,11 @@ discard block |
||
| 135 | 140 | </ul> |
| 136 | 141 | <a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a> |
| 137 | 142 | <?$static_brick_nr += 1?> |
| 138 | - <? else : ?> |
|
| 139 | - <?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?> |
|
| 143 | + <? else { |
|
| 144 | + : ?> |
|
| 145 | + <?$fieldPrefix='bricks[' . $brick->slug . '][fields]'; |
|
| 146 | +} |
|
| 147 | +?> |
|
| 140 | 148 | <input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" /> |
| 141 | 149 | <? foreach ($brick->structure->fields as $field) : ?> |
| 142 | 150 | <div class="form-element"> |
@@ -145,8 +153,10 @@ discard block |
||
| 145 | 153 | $brickSlug = $brick->slug; |
| 146 | 154 | $fieldSlug = $field->slug; |
| 147 | 155 | $value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : ''; |
| 148 | - else : |
|
| 156 | + else { |
|
| 157 | + : |
|
| 149 | 158 | $value = ''; |
| 159 | + } |
|
| 150 | 160 | endif ?> |
| 151 | 161 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 152 | 162 | <ul class="grid-wrapper sortable"> |
@@ -18,7 +18,8 @@ discard block |
||
| 18 | 18 | <i class="fa fa-exclamation-triangle"></i> Search index is no longer in sync with documents. |
| 19 | 19 | <a href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/search/update-index?returnUrl=<?= urlencode($request::$subfolders . $cmsPrefix . '/documents') ?>" title="Update Index">Update Index</a> |
| 20 | 20 | </div> |
| 21 | - <? else : ?> |
|
| 21 | + <? else { |
|
| 22 | + : ?> |
|
| 22 | 23 | <div class="message valid"> |
| 23 | 24 | <i class="fa fa-check"></i> Search index is in sync with documents. |
| 24 | 25 | </div> |
@@ -47,7 +48,9 @@ discard block |
||
| 47 | 48 | <? foreach ($documents as $document) : ?> |
| 48 | 49 | <li class="grid-container"> |
| 49 | 50 | <? if ($document->type == 'document') : ?> |
| 50 | - <? renderDocument($document, $cmsPrefix, '', $request); ?> |
|
| 51 | + <? renderDocument($document, $cmsPrefix, '', $request); |
|
| 52 | +} |
|
| 53 | +?> |
|
| 51 | 54 | <? elseif ($document->type == 'folder') : ?> |
| 52 | 55 | <? renderFolder($document, $cmsPrefix, '', true, $request); ?> |
| 53 | 56 | <? endif ?> |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
| 146 | - * @param $template |
|
| 146 | + * @param string $template |
|
| 147 | 147 | * @param null | Application $application |
| 148 | 148 | * @return string |
| 149 | 149 | */ |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * @param string $template |
| 162 | - * @param $application |
|
| 162 | + * @param Application|null $application |
|
| 163 | 163 | * @return string |
| 164 | 164 | */ |
| 165 | 165 | private function getTemplatePath($template, $application) |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * @param $request |
|
| 57 | + * @param Request $request |
|
| 58 | 58 | * @param CmsComponent $cmsComponent |
| 59 | 59 | * |
| 60 | 60 | * @throws \Exception |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | - * @param $request |
|
| 92 | + * @param Request $request |
|
| 93 | 93 | * @param CmsComponent $cmsComponent |
| 94 | 94 | */ |
| 95 | 95 | private function editDocumentRoute($request, $cmsComponent) |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | - * @param $request |
|
| 122 | + * @param Request $request |
|
| 123 | 123 | * @param CmsComponent $cmsComponent |
| 124 | 124 | */ |
| 125 | 125 | private function getBrickRoute($request, $cmsComponent) |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | - * @param $request |
|
| 143 | + * @param Request $request |
|
| 144 | 144 | * @param CmsComponent $cmsComponent |
| 145 | 145 | */ |
| 146 | 146 | private function deleteDocumentRoute($request, $cmsComponent) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | - * @param $request |
|
| 155 | + * @param Request $request |
|
| 156 | 156 | * @param CmsComponent $cmsComponent |
| 157 | 157 | */ |
| 158 | 158 | private function publishDocumentRoute($request, $cmsComponent) |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
| 169 | - * @param $request |
|
| 169 | + * @param Request $request |
|
| 170 | 170 | * @param CmsComponent $cmsComponent |
| 171 | 171 | */ |
| 172 | 172 | private function unpublishDocumentRoute($request, $cmsComponent) |