@@ -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; |
@@ -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 |
@@ -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); |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | namespace CloudControl\Cms\images\methods |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - use CloudControl\Cms\images\IMethod; |
|
| 12 | + use CloudControl\Cms\images\IMethod; |
|
| 13 | 13 | |
| 14 | - class Grayscale extends IMethod |
|
| 14 | + class Grayscale extends IMethod |
|
| 15 | 15 | { |
| 16 | 16 | public function Execute($imageResource) |
| 17 | 17 | { |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | namespace CloudControl\Cms\images |
| 3 | 3 | { |
| 4 | 4 | |
| 5 | - use CloudControl\Cms\cc\StringUtil; |
|
| 5 | + use CloudControl\Cms\cc\StringUtil; |
|
| 6 | 6 | |
| 7 | - /** |
|
| 7 | + /** |
|
| 8 | 8 | * Class ImageResizer |
| 9 | 9 | * @package CloudControl\Cms\images |
| 10 | 10 | */ |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | return $returnFileNames; |
| 47 | 47 | } else { |
| 48 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 48 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | * @return string |
| 57 | 57 | * @throws \Exception |
| 58 | 58 | */ |
| 59 | - public function resize($imagePath='', $width='',$height='') |
|
| 59 | + public function resize($imagePath = '', $width = '', $height = '') |
|
| 60 | 60 | { |
| 61 | - $modifier = '-r' . $width . 'x' . $height; |
|
| 62 | - return $this->applyMethod('Resize', $imagePath, $width,$height, $modifier); |
|
| 61 | + $modifier = '-r'.$width.'x'.$height; |
|
| 62 | + return $this->applyMethod('Resize', $imagePath, $width, $height, $modifier); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | * @return string |
| 70 | 70 | * @throws \Exception |
| 71 | 71 | */ |
| 72 | - public function smartcrop($imagePath='', $width='',$height='') |
|
| 72 | + public function smartcrop($imagePath = '', $width = '', $height = '') |
|
| 73 | 73 | { |
| 74 | - $modifier = '-s' . $width . 'x' . $height; |
|
| 75 | - return $this->applyMethod('SmartCrop', $imagePath, $width,$height, $modifier); |
|
| 74 | + $modifier = '-s'.$width.'x'.$height; |
|
| 75 | + return $this->applyMethod('SmartCrop', $imagePath, $width, $height, $modifier); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | * @return string |
| 83 | 83 | * @throws \Exception |
| 84 | 84 | */ |
| 85 | - public function boxcrop($imagePath='', $width='',$height='') |
|
| 85 | + public function boxcrop($imagePath = '', $width = '', $height = '') |
|
| 86 | 86 | { |
| 87 | - $modifier = '-b' . $width . 'x' . $height; |
|
| 88 | - return $this->applyMethod('BoxCrop', $imagePath, $width,$height, $modifier); |
|
| 87 | + $modifier = '-b'.$width.'x'.$height; |
|
| 88 | + return $this->applyMethod('BoxCrop', $imagePath, $width, $height, $modifier); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return string |
| 96 | 96 | */ |
| 97 | - private function modifyName($imagePath, $modifier='') |
|
| 97 | + private function modifyName($imagePath, $modifier = '') |
|
| 98 | 98 | { |
| 99 | 99 | $filename = basename($imagePath); |
| 100 | 100 | $path = dirname($imagePath); |
@@ -104,30 +104,30 @@ discard block |
||
| 104 | 104 | array_pop($fileParts); |
| 105 | 105 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 106 | 106 | $fileNameWithoutExtension = StringUtil::slugify($fileNameWithoutExtension); |
| 107 | - $filename = $fileNameWithoutExtension . $modifier . '.' . $extension; |
|
| 107 | + $filename = $fileNameWithoutExtension.$modifier.'.'.$extension; |
|
| 108 | 108 | } else { |
| 109 | 109 | $filename = StringUtil::slugify($filename); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if (file_exists($path . '/' . $filename)) { |
|
| 112 | + if (file_exists($path.'/'.$filename)) { |
|
| 113 | 113 | $fileParts = explode('.', $filename); |
| 114 | 114 | if (count($fileParts) > 1) { |
| 115 | 115 | $extension = end($fileParts); |
| 116 | 116 | array_pop($fileParts); |
| 117 | 117 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 118 | 118 | $fileNameWithoutExtension .= '-copy'; |
| 119 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
| 119 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
| 120 | 120 | } else { |
| 121 | 121 | $filename .= '-copy'; |
| 122 | 122 | } |
| 123 | - return $this->modifyName($path . '/' . $filename); |
|
| 123 | + return $this->modifyName($path.'/'.$filename); |
|
| 124 | 124 | } |
| 125 | - return $path . '/' . $filename; |
|
| 125 | + return $path.'/'.$filename; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | private function applyMethod($method, $imagePath, $width, $height, $modifier) |
| 129 | 129 | { |
| 130 | - $method = 'CloudControl\Cms\\images\\methods\\' . $method; |
|
| 130 | + $method = 'CloudControl\Cms\\images\\methods\\'.$method; |
|
| 131 | 131 | $destination = $this->modifyName($imagePath, $modifier); |
| 132 | 132 | if (file_exists($imagePath)) { |
| 133 | 133 | $image = new Image(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $resizedImage->saveImage($destination, $resizedImage->getImageMimeType($imagePath), 80); |
| 142 | 142 | return basename($destination); |
| 143 | 143 | } else { |
| 144 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 144 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace CloudControl\Cms\cc |
| 3 | 3 | { |
| 4 | - /** |
|
| 5 | - * Class Request |
|
| 6 | - * @package CloudControl\Cms\cc |
|
| 7 | - */ |
|
| 4 | + /** |
|
| 5 | + * Class Request |
|
| 6 | + * @package CloudControl\Cms\cc |
|
| 7 | + */ |
|
| 8 | 8 | class Request { |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function __construct() |
| 47 | 47 | { |
| 48 | - $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 48 | + $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 49 | 49 | |
| 50 | 50 | self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
| 51 | 51 | self::$subfolders = str_replace('//', '/', self::$subfolders); |
@@ -45,23 +45,23 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | public function __construct() |
| 47 | 47 | { |
| 48 | - $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 48 | + $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)).'/../../').'/'); |
|
| 49 | 49 | |
| 50 | - self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
|
| 50 | + self::$subfolders = '/'.str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
|
| 51 | 51 | self::$subfolders = str_replace('//', '/', self::$subfolders); |
| 52 | 52 | if (PHP_SAPI === 'cli') { |
| 53 | 53 | global $argv; |
| 54 | 54 | array_shift($argv); |
| 55 | 55 | self::$queryString = ''; |
| 56 | - self::$requestUri = self::$subfolders . implode('/', $argv); |
|
| 56 | + self::$requestUri = self::$subfolders.implode('/', $argv); |
|
| 57 | 57 | } else { |
| 58 | 58 | self::$requestUri = $_SERVER['REQUEST_URI']; |
| 59 | 59 | self::$queryString = $_SERVER['QUERY_STRING']; |
| 60 | 60 | } |
| 61 | 61 | if (self::$subfolders === '/') { |
| 62 | - self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1)); |
|
| 62 | + self::$relativeUri = str_replace('?'.self::$queryString, '', substr(self::$requestUri, 1)); |
|
| 63 | 63 | } else { |
| 64 | - self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
| 64 | + self::$relativeUri = str_replace('?'.self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | self::$requestParameters = explode('/', self::$relativeUri); |
@@ -2,21 +2,21 @@ discard block |
||
| 2 | 2 | | THE FOLLOWING ERROR OCCURED | |
| 3 | 3 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 4 | 4 | |
| 5 | - <?php echo $message . PHP_EOL; ?> |
|
| 5 | + <?php echo $message.PHP_EOL; ?> |
|
| 6 | 6 | |
| 7 | 7 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 8 | 8 | | IN FILE | |
| 9 | 9 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 10 | 10 | |
| 11 | - <?php echo $file . ':' . $line . PHP_EOL; ?> |
|
| 11 | + <?php echo $file.':'.$line.PHP_EOL; ?> |
|
| 12 | 12 | |
| 13 | 13 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 14 | 14 | | CONTENTS OF THE FILE | |
| 15 | 15 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | -foreach($lines as $nr => $currentLine) { |
|
| 19 | - echo ($nr == $line ? '* ' : ' ' ) . str_pad($nr, 3, "0", STR_PAD_LEFT) . ' ' . $currentLine; |
|
| 18 | +foreach ($lines as $nr => $currentLine) { |
|
| 19 | + echo ($nr == $line ? '* ' : ' ').str_pad($nr, 3, "0", STR_PAD_LEFT).' '.$currentLine; |
|
| 20 | 20 | } |
| 21 | 21 | ?> |
| 22 | 22 | |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | -foreach($trace as $row) { |
|
| 29 | - echo (isset($row['file']) ? basename($row['file']) : '') . ':' |
|
| 30 | - . (isset($row['line']) ? $row['line'] : '') . "\t\t\t" |
|
| 31 | - . (isset($row['class']) ? $row['class'] : ' ') . "\t\t\t" |
|
| 32 | - . (isset($row['type']) ? $row['type'] : ' ') . "\t\t\t" |
|
| 33 | - . (isset($row['function']) ? $row['function'] : ' ') . PHP_EOL; |
|
| 28 | +foreach ($trace as $row) { |
|
| 29 | + echo (isset($row['file']) ? basename($row['file']) : '').':' |
|
| 30 | + . (isset($row['line']) ? $row['line'] : '')."\t\t\t" |
|
| 31 | + . (isset($row['class']) ? $row['class'] : ' ')."\t\t\t" |
|
| 32 | + . (isset($row['type']) ? $row['type'] : ' ')."\t\t\t" |
|
| 33 | + . (isset($row['function']) ? $row['function'] : ' ').PHP_EOL; |
|
| 34 | 34 | } |
| 35 | 35 | ?> |
| 36 | 36 | \ No newline at end of file |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public static function slugify($str, $replace = array(), $delimiter = '-') |
| 21 | 21 | { |
| 22 | 22 | if (!empty($replace)) { |
| 23 | - $str = str_replace((array)$replace, ' ', $str); |
|
| 23 | + $str = str_replace((array) $replace, ' ', $str); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -79,13 +79,13 @@ discard block |
||
| 79 | 79 | public static function humanFileSize($size, $unit = "") |
| 80 | 80 | { |
| 81 | 81 | if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
| 82 | - return number_format($size / (1 << 30), 2) . "GB"; |
|
| 82 | + return number_format($size / (1 << 30), 2)."GB"; |
|
| 83 | 83 | if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
| 84 | - return number_format($size / (1 << 20), 2) . "MB"; |
|
| 84 | + return number_format($size / (1 << 20), 2)."MB"; |
|
| 85 | 85 | if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
| 86 | - return number_format($size / (1 << 10), 2) . "KB"; |
|
| 86 | + return number_format($size / (1 << 10), 2)."KB"; |
|
| 87 | 87 | |
| 88 | - return number_format($size) . " bytes"; |
|
| 88 | + return number_format($size)." bytes"; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if ($d >= 1) { |
| 122 | 122 | $r = round($d); |
| 123 | 123 | |
| 124 | - return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; |
|
| 124 | + return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago'; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -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 | } |
@@ -31,26 +31,26 @@ |
||
| 31 | 31 | <div class="documentActions grid-box-2"> |
| 32 | 32 | <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
| 33 | 33 | <? renderAction('Publish', |
| 34 | - 'publish', |
|
| 35 | - $request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 36 | - 'check'); ?> |
|
| 34 | + 'publish', |
|
| 35 | + $request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 36 | + 'check'); ?> |
|
| 37 | 37 | <? endif ?> |
| 38 | 38 | <? if ($document->state == 'published') : ?> |
| 39 | 39 | <? renderAction('Unpublish', |
| 40 | - 'unpublish', |
|
| 41 | - $request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
|
| 42 | - 'times'); ?> |
|
| 40 | + 'unpublish', |
|
| 41 | + $request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
|
| 42 | + 'times'); ?> |
|
| 43 | 43 | <? endif ?> |
| 44 | 44 | <? renderAction('Edit', |
| 45 | - '', |
|
| 46 | - $request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
|
| 47 | - 'pencil'); ?> |
|
| 45 | + '', |
|
| 46 | + $request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
|
| 47 | + 'pencil'); ?> |
|
| 48 | 48 | <? if ($document->state == 'unpublished') : ?> |
| 49 | 49 | <? renderAction('Delete', |
| 50 | - 'error', |
|
| 51 | - $request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
|
| 52 | - 'trash', |
|
| 53 | - 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
| 50 | + 'error', |
|
| 51 | + $request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
|
| 52 | + 'trash', |
|
| 53 | + 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
| 54 | 54 | <? endif ?> |
| 55 | 55 | </div> |
| 56 | 56 | <? } ?> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { ?> |
| 10 | 10 | <div class="grid-box-10"> |
| 11 | 11 | <h3> |
| 12 | - <a class="btn documentTitle" href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/documents/edit-document?slug=<?= $slugPrefix . $document->slug ?>" title="Edit"> |
|
| 12 | + <a class="btn documentTitle" href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/documents/edit-document?slug=<?= $slugPrefix.$document->slug ?>" title="Edit"> |
|
| 13 | 13 | <i class="fa fa-file-text-o"></i> |
| 14 | 14 | <small class="state <?= strtolower($document->state) ?>"> |
| 15 | 15 | <i class="fa <?= $document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small> |
@@ -32,23 +32,23 @@ discard block |
||
| 32 | 32 | <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
| 33 | 33 | <? renderAction('Publish', |
| 34 | 34 | 'publish', |
| 35 | - $request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 35 | + $request::$subfolders.$cmsPrefix.'/documents/publish-document?slug='.$slugPrefix.$document->slug, |
|
| 36 | 36 | 'check'); ?> |
| 37 | 37 | <? endif ?> |
| 38 | 38 | <? if ($document->state == 'published') : ?> |
| 39 | 39 | <? renderAction('Unpublish', |
| 40 | 40 | 'unpublish', |
| 41 | - $request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
|
| 41 | + $request::$subfolders.$cmsPrefix.'/documents/unpublish-document?slug='.$slugPrefix.$document->slug, |
|
| 42 | 42 | 'times'); ?> |
| 43 | 43 | <? endif ?> |
| 44 | 44 | <? renderAction('Edit', |
| 45 | 45 | '', |
| 46 | - $request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
|
| 46 | + $request::$subfolders.$cmsPrefix.'/documents/edit-document?slug='.$slugPrefix.$document->slug, |
|
| 47 | 47 | 'pencil'); ?> |
| 48 | 48 | <? if ($document->state == 'unpublished') : ?> |
| 49 | 49 | <? renderAction('Delete', |
| 50 | 50 | 'error', |
| 51 | - $request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
|
| 51 | + $request::$subfolders.$cmsPrefix.'/documents/delete-document?slug='.$slugPrefix.$document->slug, |
|
| 52 | 52 | 'trash', |
| 53 | 53 | 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
| 54 | 54 | <? endif ?> |
@@ -4,9 +4,9 @@ |
||
| 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"> |
@@ -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 ?> |
@@ -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"> |