@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function renderError($message = '', $file = '', $line = '', $code = 0, $trace = array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') |
| 23 | 23 | { |
| 24 | - if (ob_get_contents()) ob_end_clean(); |
|
| 24 | + if (ob_get_contents()) { |
|
| 25 | + ob_end_clean(); |
|
| 26 | + } |
|
| 25 | 27 | $line = intval($line); |
| 26 | 28 | |
| 27 | 29 | if (self::canShowError()) { |
@@ -85,7 +87,9 @@ discard block |
||
| 85 | 87 | |
| 86 | 88 | private static function renderCliException($message, $file, $line, $trace, $lines) |
| 87 | 89 | { |
| 88 | - if (ob_get_contents()) ob_end_clean(); |
|
| 90 | + if (ob_get_contents()) { |
|
| 91 | + ob_end_clean(); |
|
| 92 | + } |
|
| 89 | 93 | include(__DIR__ . DIRECTORY_SEPARATOR . 'errortemplates/errorviewcli.php'); |
| 90 | 94 | exit; |
| 91 | 95 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $error = error_get_last(); |
| 35 | 35 | if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
| 36 | 36 | \library\cc\ErrorHandlingUtil::renderError($error['message'],$error['file'],$error['line'], $error['type']); |
| 37 | - }elseif ($error['type'] == 1) { |
|
| 37 | + } elseif ($error['type'] == 1) { |
|
| 38 | 38 | dump($error); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @param string $imagePath |
| 77 | 77 | * @param bool $getExtension |
| 78 | 78 | * |
| 79 | - * @return bool|int|string |
|
| 79 | + * @return integer |
|
| 80 | 80 | */ |
| 81 | 81 | public function getImageMimeType($imagePath, $getExtension = false) |
| 82 | 82 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * @param $pathToBitmapFile |
|
| 152 | + * @param string $pathToBitmapFile |
|
| 153 | 153 | * |
| 154 | 154 | * @return string |
| 155 | 155 | */ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * @param $header |
|
| 168 | + * @param string $header |
|
| 169 | 169 | * |
| 170 | 170 | * @return array |
| 171 | 171 | */ |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | * Loop through the data in the body of the bitmap |
| 196 | 196 | * file and calculate each individual pixel based on the |
| 197 | 197 | * bytes |
| 198 | - * @param $bodySize |
|
| 199 | - * @param $x |
|
| 198 | + * @param integer $bodySize |
|
| 199 | + * @param integer $x |
|
| 200 | 200 | * @param $width |
| 201 | - * @param $usePadding |
|
| 202 | - * @param $y |
|
| 201 | + * @param boolean $usePadding |
|
| 202 | + * @param integer $y |
|
| 203 | 203 | * @param $height |
| 204 | - * @param $body |
|
| 205 | - * @param $image |
|
| 204 | + * @param string $body |
|
| 205 | + * @param resource $image |
|
| 206 | 206 | */ |
| 207 | 207 | private function loopThroughBodyAndCalculatePixels($bodySize, $x, $width, $usePadding, $y, $height, $body, $image) |
| 208 | 208 | { |
@@ -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) |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * submitting the form |
| 148 | 148 | * |
| 149 | 149 | * @param $postValues |
| 150 | - * @param $storage |
|
| 150 | + * @param Storage $storage |
|
| 151 | 151 | */ |
| 152 | 152 | protected function postSubmit($postValues, $storage) |
| 153 | 153 | {} |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
| 320 | - * @param $form |
|
| 320 | + * @param string|null $form |
|
| 321 | 321 | */ |
| 322 | 322 | private function setFormParameter($form) |
| 323 | 323 | { |
@@ -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 : '' ?>" 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"> |