| @@ -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"> | 
| @@ -4,9 +4,9 @@ discard block | ||
| 4 | 4 | </div> | 
| 5 | 5 | <label><?=$brick->title?></label> | 
| 6 | 6 |  <?if ($static == true) { | 
| 7 | -	$fieldPrefix = 'bricks[' . $myBrickSlug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . '][fields]'; | |
| 7 | +	$fieldPrefix = 'bricks['.$myBrickSlug.']['.str_replace('.', '', str_replace(' ', '', microtime())).'][fields]'; | |
| 8 | 8 |  } else { | 
| 9 | -	$fieldPrefix = 'dynamicBricks[' . $brick->slug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . ']'; | |
| 9 | +	$fieldPrefix = 'dynamicBricks['.$brick->slug.']['.str_replace('.', '', str_replace(' ', '', microtime())).']'; | |
| 10 | 10 | }?> | 
| 11 | 11 | <? foreach ($brick->fields as $field) : ?> | 
| 12 | 12 | <div class="form-element"> | 
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> | 
| 32 | 32 | <div class="form-element"> | 
| 33 | 33 | <? endif ?> | 
| 34 | -					<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> | |
| 34 | +					<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> | |
| 35 | 35 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> | 
| 36 | 36 | |
| 37 | 37 | </div> | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | <li class="grid-container"> | 
| 54 | 54 | <div class="grid-box-10"> | 
| 55 | 55 | <div class="grid-inner form-element"> | 
| 56 | -									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> | |
| 56 | +									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> | |
| 57 | 57 | </div> | 
| 58 | 58 | </div> | 
| 59 | 59 | <div class="grid-box-2"> | 
| @@ -63,7 +63,7 @@ discard block | ||
| 63 | 63 | </div> | 
| 64 | 64 | </div> | 
| 65 | 65 | </li> | 
| 66 | - <?$value='';?> | |
| 66 | + <?$value = ''; ?> | |
| 67 | 67 | <? endforeach ?> | 
| 68 | 68 | <? endif ?> | 
| 69 | 69 | </ul> | 
| @@ -80,10 +80,10 @@ discard block | ||
| 80 | 80 | <a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a> | 
| 81 | 81 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> | 
| 82 | 82 | <div class="form-element"> | 
| 83 | -							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> | |
| 83 | +							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> | |
| 84 | 84 | </div> | 
| 85 | 85 | </li> | 
| 86 | - <?$value='';?> | |
| 86 | + <?$value = ''; ?> | |
| 87 | 87 | <? endforeach ?> | 
| 88 | 88 | <? endif ?> | 
| 89 | 89 | </div> | 
| @@ -92,5 +92,5 @@ discard block | ||
| 92 | 92 | <a class="btn js-addrtemultiple">+</a> | 
| 93 | 93 | <? endif ?> | 
| 94 | 94 | </div> | 
| 95 | - <?$value='';?> | |
| 95 | + <?$value = ''; ?> | |
| 96 | 96 | <? endforeach ?> | 
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | <div class="grid-container"> | 
| 3 | 3 | <div class="grid-box-2"> | 
| 4 | 4 | <div class="grid-inner"> | 
| 5 | - <div<?=isset($value) ? ' style="background-image:url(\'' . $request::$subfolders . 'images/' . $value . '\');"' : '' ?> class="selected-image" id="<?=$field->slug?>_selectedImage"></div> | |
| 5 | + <div<?=isset($value) ? ' style="background-image:url(\''.$request::$subfolders.'images/'.$value.'\');"' : '' ?> class="selected-image" id="<?=$field->slug?>_selectedImage"></div> | |
| 6 | 6 | </div> | 
| 7 | 7 | </div> | 
| 8 | 8 | <div class="grid-box-10"> | 
| @@ -62,7 +62,7 @@ discard block | ||
| 62 | 62 | </li> | 
| 63 | 63 | <? $nrOfMenuItems += 1 ?> | 
| 64 | 64 | <? endif ?> | 
| 65 | - <li class="grid-box-<?=6 + (5-$nrOfMenuItems)?> log-off-box"> | |
| 65 | + <li class="grid-box-<?=6 + (5 - $nrOfMenuItems)?> log-off-box"> | |
| 66 | 66 | <a class="btn log-off grid-inner" href="<?=$request::$subfolders?><?=$cmsPrefix?>/log-off"> | 
| 67 | 67 | <i class="fa fa-power-off"></i> | 
| 68 | 68 | <span>Log off</span> | 
| @@ -86,7 +86,7 @@ discard block | ||
| 86 | 86 | </main> | 
| 87 | 87 | <script> | 
| 88 | 88 | var subfolders = '<?=$request::$subfolders?>', | 
| 89 | - cmsSubfolders = '<?=$request::$subfolders . $cmsPrefix?>'; | |
| 89 | + cmsSubfolders = '<?=$request::$subfolders.$cmsPrefix?>'; | |
| 90 | 90 | </script> | 
| 91 | 91 | <script src="<?=$request::$subfolders?>js/cms.js"></script> | 
| 92 | 92 | </body> | 
| @@ -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 | |
| @@ -63,7 +63,7 @@ | ||
| 63 | 63 | |
| 64 | 64 | // Define the ratio and adjust the width and height | 
| 65 | 65 |  			if ($this->_preserveAspectRatio) { | 
| 66 | - $ratio = min($this->_width/$originalWidth, $this->_height/$originalHeight); | |
| 66 | + $ratio = min($this->_width / $originalWidth, $this->_height / $originalHeight); | |
| 67 | 67 | $this->_width = $originalWidth * $ratio; | 
| 68 | 68 | $this->_height = $originalHeight * $ratio; | 
| 69 | 69 | } | 
| @@ -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,14 +26,14 @@ | ||
| 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) $ratio = 1; | |
| 30 | 30 | |
| 31 | 31 | // Define sizes | 
| 32 | 32 | $this->_destWidth = floor($originalWidth * $ratio); | 
| 33 | 33 | $this->_destHeight = floor($originalHeight * $ratio); | 
| 34 | 34 | |
| 35 | 35 | // Define margins | 
| 36 | - $this->_destX = floor(($this->_width - $this->_destWidth) / 2); | |
| 36 | + $this->_destX = floor(($this->_width - $this->_destWidth) / 2); | |
| 37 | 37 | $this->_destY = floor(($this->_height - $this->_destHeight) / 2); | 
| 38 | 38 | |
| 39 | 39 | // Execute the Crop method with the given parameters | 
| @@ -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; | 
| @@ -49,7 +49,7 @@ | ||
| 49 | 49 | $output = ''; | 
| 50 | 50 |  				for ($i = 0; $i < $count; $i += 16) { | 
| 51 | 51 | $random_state = | 
| 52 | - md5(microtime() . $random_state); | |
| 52 | + md5(microtime().$random_state); | |
| 53 | 53 | $output .= | 
| 54 | 54 |  						pack('H*', md5($random_state)); | 
| 55 | 55 | } |