| @@ -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 | |
| @@ -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); | 
| @@ -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; | 
| @@ -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 | } | 
| @@ -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"> |