@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | spl_autoload_extensions('.php'); |
| 3 | 3 | spl_autoload_register("autoloader"); |
| 4 | 4 | |
| 5 | -$rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 5 | +$rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)).'/../../').'/'); |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * The function to be registered as the default autoload functino |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | global $rootPath; |
| 35 | - $file = $rootPath . str_replace('\\', '/', $class) . ".php"; |
|
| 35 | + $file = $rootPath.str_replace('\\', '/', $class).".php"; |
|
| 36 | 36 | $debug_backtrace = debug_backtrace(); |
| 37 | 37 | |
| 38 | 38 | if (file_exists($file)) { |
| 39 | 39 | require_once($file); |
| 40 | 40 | if ($throwException) { |
| 41 | 41 | if (class_exists($class, false) == false && interface_exists($class, false) == false) { |
| 42 | - throw new \Exception('Could not load class "' . $class . '" in file ' . $file); |
|
| 42 | + throw new \Exception('Could not load class "'.$class.'" in file '.$file); |
|
| 43 | 43 | } else { |
| 44 | 44 | return true; |
| 45 | 45 | } |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | } else { |
| 49 | 49 | if (isset($debug_backtrace[2]) && isset($debug_backtrace[2]['file']) && isset($debug_backtrace[2]['line'])) { |
| 50 | 50 | if ($throwException) { |
| 51 | - errorHandler(0, 'Could not load class \'' . $class . '\' in file ' . $rootPath . $file, $debug_backtrace[2]['file'], $debug_backtrace[2]['line']); |
|
| 51 | + errorHandler(0, 'Could not load class \''.$class.'\' in file '.$rootPath.$file, $debug_backtrace[2]['file'], $debug_backtrace[2]['line']); |
|
| 52 | 52 | } else { |
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | 55 | } else { |
| 56 | 56 | if ($throwException) { |
| 57 | - throw new \Exception('Could not load class "' . $class . '" in file ' . $file . "\n" . 'Called from unknown origin.'); |
|
| 57 | + throw new \Exception('Could not load class "'.$class.'" in file '.$file."\n".'Called from unknown origin.'); |
|
| 58 | 58 | } else { |
| 59 | 59 | return false; |
| 60 | 60 | } |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | return '0 seconds'; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $a = array( 365 * 24 * 60 * 60 => 'year', |
|
| 37 | + $a = array(365 * 24 * 60 * 60 => 'year', |
|
| 38 | 38 | 30 * 24 * 60 * 60 => 'month', |
| 39 | 39 | 24 * 60 * 60 => 'day', |
| 40 | 40 | 60 * 60 => 'hour', |
| 41 | 41 | 60 => 'minute', |
| 42 | 42 | 1 => 'second' |
| 43 | 43 | ); |
| 44 | - $a_plural = array( 'year' => 'years', |
|
| 44 | + $a_plural = array('year' => 'years', |
|
| 45 | 45 | 'month' => 'months', |
| 46 | 46 | 'day' => 'days', |
| 47 | 47 | 'hour' => 'hours', |
@@ -55,18 +55,18 @@ discard block |
||
| 55 | 55 | if ($d >= 1) |
| 56 | 56 | { |
| 57 | 57 | $r = round($d); |
| 58 | - return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; |
|
| 58 | + return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago'; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | -function humanFileSize($size,$unit="") { |
|
| 64 | - if( (!$unit && $size >= 1<<30) || $unit == "GB") |
|
| 65 | - return number_format($size/(1<<30),2)."GB"; |
|
| 66 | - if( (!$unit && $size >= 1<<20) || $unit == "MB") |
|
| 67 | - return number_format($size/(1<<20),2)."MB"; |
|
| 68 | - if( (!$unit && $size >= 1<<10) || $unit == "KB") |
|
| 69 | - return number_format($size/(1<<10),2)."KB"; |
|
| 63 | +function humanFileSize($size, $unit = "") { |
|
| 64 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
| 65 | + return number_format($size / (1 << 30), 2)."GB"; |
|
| 66 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
| 67 | + return number_format($size / (1 << 20), 2)."MB"; |
|
| 68 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
| 69 | + return number_format($size / (1 << 10), 2)."KB"; |
|
| 70 | 70 | return number_format($size)." bytes"; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @return mixed|string |
| 115 | 115 | */ |
| 116 | -function slugify($str, $replace=array(), $delimiter='-') { |
|
| 117 | - if( !empty($replace) ) { |
|
| 118 | - $str = str_replace((array)$replace, ' ', $str); |
|
| 116 | +function slugify($str, $replace = array(), $delimiter = '-') { |
|
| 117 | + if (!empty($replace)) { |
|
| 118 | + $str = str_replace((array) $replace, ' ', $str); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -136,13 +136,13 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $debug_backtrace = current(debug_backtrace()); |
| 138 | 138 | if (PHP_SAPI == 'cli') { |
| 139 | - echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n"; |
|
| 139 | + echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n"; |
|
| 140 | 140 | foreach (func_get_args() as $data) { |
| 141 | 141 | var_dump($data); |
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | 144 | ob_clean(); |
| 145 | - echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>"; |
|
| 145 | + echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>"; |
|
| 146 | 146 | echo '<pre>'; |
| 147 | 147 | foreach (func_get_args() as $data) { |
| 148 | 148 | echo "<code>"; |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @param $e |
| 11 | 11 | */ |
| 12 | -function exceptionHandler ($e) { |
|
| 13 | - renderError($e->getMessage(),$e->getFile(),$e->getLine(),$e->getCode(),$e->getTrace()); |
|
| 12 | +function exceptionHandler($e) { |
|
| 13 | + renderError($e->getMessage(), $e->getFile(), $e->getLine(), $e->getCode(), $e->getTrace()); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | * @param $errfile |
| 22 | 22 | * @param $errline |
| 23 | 23 | */ |
| 24 | -function errorHandler ($errno, $errstr, $errfile, $errline) { |
|
| 25 | - renderError($errstr,$errfile,$errline,$errno,debug_backtrace()); |
|
| 24 | +function errorHandler($errno, $errstr, $errfile, $errline) { |
|
| 25 | + renderError($errstr, $errfile, $errline, $errno, debug_backtrace()); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * When an error occurs that kills the process, still try |
| 30 | 30 | * to show it using a shutdownHandler. |
| 31 | 31 | */ |
| 32 | -function shutdownHandler () { |
|
| 32 | +function shutdownHandler() { |
|
| 33 | 33 | $error = error_get_last(); |
| 34 | 34 | if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
| 35 | - errorHandler($error['type'],$error['message'],$error['file'],$error['line']); |
|
| 35 | + errorHandler($error['type'], $error['message'], $error['file'], $error['line']); |
|
| 36 | 36 | }elseif ($error['type'] == 1) { |
| 37 | 37 | dump($error); |
| 38 | 38 | } |
@@ -50,28 +50,28 @@ discard block |
||
| 50 | 50 | $errstr = ''; |
| 51 | 51 | switch ($jsonErrorNr) { |
| 52 | 52 | case JSON_ERROR_NONE: |
| 53 | - $errstr .= ' - No errors' . PHP_EOL; |
|
| 53 | + $errstr .= ' - No errors'.PHP_EOL; |
|
| 54 | 54 | break; |
| 55 | 55 | case JSON_ERROR_DEPTH: |
| 56 | - $errstr .= ' - Maximum stack depth exceeded' . PHP_EOL; |
|
| 56 | + $errstr .= ' - Maximum stack depth exceeded'.PHP_EOL; |
|
| 57 | 57 | break; |
| 58 | 58 | case JSON_ERROR_STATE_MISMATCH: |
| 59 | - $errstr .= ' - Underflow or the modes mismatch' . PHP_EOL; |
|
| 59 | + $errstr .= ' - Underflow or the modes mismatch'.PHP_EOL; |
|
| 60 | 60 | break; |
| 61 | 61 | case JSON_ERROR_CTRL_CHAR: |
| 62 | - $errstr .= ' - Unexpected control character found' . PHP_EOL; |
|
| 62 | + $errstr .= ' - Unexpected control character found'.PHP_EOL; |
|
| 63 | 63 | break; |
| 64 | 64 | case JSON_ERROR_SYNTAX: |
| 65 | - $errstr .= ' - Syntax error, malformed JSON' . PHP_EOL; |
|
| 65 | + $errstr .= ' - Syntax error, malformed JSON'.PHP_EOL; |
|
| 66 | 66 | break; |
| 67 | 67 | case JSON_ERROR_UTF8: |
| 68 | - $errstr .= ' - Malformed UTF-8 characters, possibly incorrectly encoded' . PHP_EOL; |
|
| 68 | + $errstr .= ' - Malformed UTF-8 characters, possibly incorrectly encoded'.PHP_EOL; |
|
| 69 | 69 | break; |
| 70 | 70 | default: |
| 71 | - $errstr = ' - Unknown error' . PHP_EOL; |
|
| 71 | + $errstr = ' - Unknown error'.PHP_EOL; |
|
| 72 | 72 | break; |
| 73 | 73 | } |
| 74 | - errorHandler ($jsonErrorNr, $errstr, $file, $line); |
|
| 74 | + errorHandler($jsonErrorNr, $errstr, $file, $line); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | * @param array $trace |
| 85 | 85 | * @param string $httpHeader |
| 86 | 86 | */ |
| 87 | -function renderError ($message='', $file='', $line='', $code=0, $trace=array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') { |
|
| 87 | +function renderError($message = '', $file = '', $line = '', $code = 0, $trace = array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') { |
|
| 88 | 88 | $file_lines = file_exists($file) ? file($file) : array(); |
| 89 | 89 | $range = ($line - 15) < 0 ? range(1, 30) : range($line - 15, $line + 15); |
| 90 | 90 | $lines = array(); |
| 91 | 91 | |
| 92 | 92 | foreach ($range as $line_number) { |
| 93 | - if(isset($file_lines[$line_number-1])) { |
|
| 94 | - $lines[$line_number] = $file_lines[$line_number-1]; |
|
| 93 | + if (isset($file_lines[$line_number - 1])) { |
|
| 94 | + $lines[$line_number] = $file_lines[$line_number - 1]; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | if (ob_get_contents()) ob_end_clean(); |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | 'trace' => $trace, |
| 105 | 105 | 'httpHeader' => $httpHeader, |
| 106 | 106 | ); |
| 107 | - if (file_exists(realpath(__DIR__) . '/errorview.php')) { |
|
| 108 | - include(realpath(__DIR__) . '/errorview.php'); |
|
| 107 | + if (file_exists(realpath(__DIR__).'/errorview.php')) { |
|
| 108 | + include(realpath(__DIR__).'/errorview.php'); |
|
| 109 | 109 | } else { |
| 110 | 110 | header('Content-type: application/json'); |
| 111 | 111 | die(json_encode($error)); |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | { |
| 48 | 48 | global $rootPath; |
| 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::$requestUri = $_SERVER['REQUEST_URI']; |
| 52 | 52 | self::$queryString = $_SERVER['QUERY_STRING']; |
| 53 | - self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
| 53 | + self::$relativeUri = str_replace('?'.self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
| 54 | 54 | self::$requestParameters = explode('/', self::$relativeUri); |
| 55 | 55 | |
| 56 | 56 | self::$get = $_GET; |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | private function config() |
| 67 | 67 | { |
| 68 | - $configPath = __DIR__ . '/../../config.json'; |
|
| 68 | + $configPath = __DIR__.'/../../config.json'; |
|
| 69 | 69 | if (realpath($configPath) !== false) { |
| 70 | 70 | $json = file_get_contents($configPath); |
| 71 | 71 | $this->config = json_decode($json); |
| 72 | 72 | } else { |
| 73 | - throw new \Exception('Couldn\'t find config file in path ' . $configPath); |
|
| 73 | + throw new \Exception('Couldn\'t find config file in path '.$configPath); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | private function sitemapMatching($request) |
| 94 | 94 | { |
| 95 | 95 | $sitemap = $this->storage->getSitemap(); |
| 96 | - $relativeUri = '/' . $request::$relativeUri; |
|
| 96 | + $relativeUri = '/'.$request::$relativeUri; |
|
| 97 | 97 | |
| 98 | 98 | foreach ($sitemap as $sitemapItem) { |
| 99 | 99 | if ($sitemapItem->regex) { |
@@ -153,17 +153,17 @@ discard block |
||
| 153 | 153 | * @return mixed |
| 154 | 154 | * @throws \Exception |
| 155 | 155 | */ |
| 156 | - private function getComponentObject($class='', $template='', $parameters=array(), $matchedSitemapItem) |
|
| 156 | + private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem) |
|
| 157 | 157 | { |
| 158 | - $libraryComponentName = '\\library\\components\\' . $class; |
|
| 159 | - $userComponentName = '\\components\\' . $class; |
|
| 158 | + $libraryComponentName = '\\library\\components\\'.$class; |
|
| 159 | + $userComponentName = '\\components\\'.$class; |
|
| 160 | 160 | |
| 161 | 161 | if (\autoLoad($libraryComponentName, false)) { |
| 162 | 162 | $component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
| 163 | 163 | } elseif (\autoLoad($userComponentName, false)) { |
| 164 | 164 | $component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
| 165 | 165 | } else { |
| 166 | - throw new \Exception('Could not load component ' . $class); |
|
| 166 | + throw new \Exception('Could not load component '.$class); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | if (!$component instanceof Component) { |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | $imageContent = file_get_contents($imageContainer); |
| 33 | 33 | $this->_imageResource = imagecreatefromstring($imageContent); |
| 34 | 34 | } |
| 35 | - } elseif(is_string($imageContainer)) { |
|
| 35 | + } elseif (is_string($imageContainer)) { |
|
| 36 | 36 | $this->_imageResource = imagecreatefromstring($imageContainer); |
| 37 | 37 | } else { |
| 38 | - throw new \Exception('Could not create image resource, accepted inputs are: "resource of type (gd)", path_to_image and "string". <br /><pre>' . var_export($imageContainer, true) . '</pre>'); |
|
| 38 | + throw new \Exception('Could not create image resource, accepted inputs are: "resource of type (gd)", path_to_image and "string". <br /><pre>'.var_export($imageContainer, true).'</pre>'); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | if ($mimeTypeConstantValue == IMAGETYPE_GIF) { |
| 57 | 57 | return imagegif($imageResource, $path); |
| 58 | - } elseif ($mimeTypeConstantValue == IMAGETYPE_JPEG) { |
|
| 58 | + } elseif ($mimeTypeConstantValue == IMAGETYPE_JPEG) { |
|
| 59 | 59 | return imagejpeg($imageResource, $path, $quality); |
| 60 | 60 | } elseif ($mimeTypeConstantValue == IMAGETYPE_PNG) { |
| 61 | - return imagepng($imageResource, $path, (intval($quality / 10) -1)); |
|
| 61 | + return imagepng($imageResource, $path, (intval($quality / 10) - 1)); |
|
| 62 | 62 | } |
| 63 | 63 | else { |
| 64 | 64 | throw new \Exception('Not a valid mimetypeconstant given see function documentation'); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if (function_exists('exif_imagetype')) { |
| 80 | 80 | $exif = exif_imagetype($imagePath); |
| 81 | 81 | } else { |
| 82 | - if ((list($width, $height, $type, $attr) = getimagesize($imagePath)) !== false ) { |
|
| 82 | + if ((list($width, $height, $type, $attr) = getimagesize($imagePath)) !== false) { |
|
| 83 | 83 | $exif = $type; |
| 84 | 84 | } else { |
| 85 | 85 | $exif = false; |
@@ -99,86 +99,86 @@ discard block |
||
| 99 | 99 | public function CreateImageFromBmp($p_sFile) |
| 100 | 100 | { |
| 101 | 101 | // Load the image into a string |
| 102 | - $file = fopen($p_sFile,"rb"); |
|
| 103 | - $read = fread($file,10); |
|
| 104 | - while(!feof($file)&&($read<>"")) |
|
| 105 | - $read .= fread($file,1024); |
|
| 102 | + $file = fopen($p_sFile, "rb"); |
|
| 103 | + $read = fread($file, 10); |
|
| 104 | + while (!feof($file) && ($read <> "")) |
|
| 105 | + $read .= fread($file, 1024); |
|
| 106 | 106 | |
| 107 | - $temp = unpack("H*",$read); |
|
| 108 | - $hex = $temp[1]; |
|
| 109 | - $header = substr($hex,0,108); |
|
| 110 | - $width=null; |
|
| 111 | - $height=null; |
|
| 107 | + $temp = unpack("H*", $read); |
|
| 108 | + $hex = $temp[1]; |
|
| 109 | + $header = substr($hex, 0, 108); |
|
| 110 | + $width = null; |
|
| 111 | + $height = null; |
|
| 112 | 112 | |
| 113 | 113 | // Process the header |
| 114 | 114 | // Structure: http://www.fastgraph.com/help/bmp_header_format.html |
| 115 | - if (substr($header,0,4)=="424d") |
|
| 115 | + if (substr($header, 0, 4) == "424d") |
|
| 116 | 116 | { |
| 117 | 117 | // Cut it in parts of 2 bytes |
| 118 | - $header_parts = str_split($header,2); |
|
| 118 | + $header_parts = str_split($header, 2); |
|
| 119 | 119 | |
| 120 | 120 | // Get the width 4 bytes |
| 121 | - $width = hexdec($header_parts[19].$header_parts[18]); |
|
| 121 | + $width = hexdec($header_parts[19].$header_parts[18]); |
|
| 122 | 122 | |
| 123 | 123 | // Get the height 4 bytes |
| 124 | - $height = hexdec($header_parts[23].$header_parts[22]); |
|
| 124 | + $height = hexdec($header_parts[23].$header_parts[22]); |
|
| 125 | 125 | |
| 126 | 126 | // Unset the header params |
| 127 | 127 | unset($header_parts); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // Define starting X and Y |
| 131 | - $x = 0; |
|
| 132 | - $y = 1; |
|
| 131 | + $x = 0; |
|
| 132 | + $y = 1; |
|
| 133 | 133 | |
| 134 | 134 | // Create newimage |
| 135 | - $image = imagecreatetruecolor($width,$height); |
|
| 135 | + $image = imagecreatetruecolor($width, $height); |
|
| 136 | 136 | |
| 137 | 137 | // Grab the body from the image |
| 138 | - $body = substr($hex,108); |
|
| 138 | + $body = substr($hex, 108); |
|
| 139 | 139 | |
| 140 | 140 | // Calculate if padding at the end-line is needed |
| 141 | 141 | // Divided by two to keep overview. |
| 142 | 142 | // 1 byte = 2 HEX-chars |
| 143 | - $body_size = (strlen($body)/2); |
|
| 144 | - $header_size = ($width*$height); |
|
| 143 | + $body_size = (strlen($body) / 2); |
|
| 144 | + $header_size = ($width * $height); |
|
| 145 | 145 | |
| 146 | 146 | // Use end-line padding? Only when needed |
| 147 | - $usePadding = ($body_size>($header_size*3)+4); |
|
| 147 | + $usePadding = ($body_size > ($header_size * 3) + 4); |
|
| 148 | 148 | |
| 149 | 149 | // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption |
| 150 | 150 | // Calculate the next DWORD-position in the body |
| 151 | - for ($i=0;$i<$body_size;$i+=3) |
|
| 151 | + for ($i = 0; $i < $body_size; $i += 3) |
|
| 152 | 152 | { |
| 153 | 153 | // Calculate line-ending and padding |
| 154 | - if ($x>=$width) |
|
| 154 | + if ($x >= $width) |
|
| 155 | 155 | { |
| 156 | 156 | // If padding needed, ignore image-padding |
| 157 | 157 | // Shift i to the ending of the current 32-bit-block |
| 158 | 158 | if ($usePadding) |
| 159 | - $i += $width%4; |
|
| 159 | + $i += $width % 4; |
|
| 160 | 160 | |
| 161 | 161 | // Reset horizontal position |
| 162 | - $x = 0; |
|
| 162 | + $x = 0; |
|
| 163 | 163 | |
| 164 | 164 | // Raise the height-position (bottom-up) |
| 165 | 165 | $y++; |
| 166 | 166 | |
| 167 | 167 | // Reached the image-height? Break the for-loop |
| 168 | - if ($y>$height) |
|
| 168 | + if ($y > $height) |
|
| 169 | 169 | break; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // Calculation of the RGB-pixel (defined as BGR in image-data) |
| 173 | 173 | // Define $i_pos as absolute position in the body |
| 174 | - $i_pos = $i*2; |
|
| 175 | - $r = hexdec($body[$i_pos+4].$body[$i_pos+5]); |
|
| 176 | - $g = hexdec($body[$i_pos+2].$body[$i_pos+3]); |
|
| 177 | - $b = hexdec($body[$i_pos].$body[$i_pos+1]); |
|
| 174 | + $i_pos = $i * 2; |
|
| 175 | + $r = hexdec($body[$i_pos + 4].$body[$i_pos + 5]); |
|
| 176 | + $g = hexdec($body[$i_pos + 2].$body[$i_pos + 3]); |
|
| 177 | + $b = hexdec($body[$i_pos].$body[$i_pos + 1]); |
|
| 178 | 178 | |
| 179 | 179 | // Calculate and draw the pixel |
| 180 | - $color = imagecolorallocate($image,$r,$g,$b); |
|
| 181 | - imagesetpixel($image,$x,$height-$y,$color); |
|
| 180 | + $color = imagecolorallocate($image, $r, $g, $b); |
|
| 181 | + imagesetpixel($image, $x, $height - $y, $color); |
|
| 182 | 182 | |
| 183 | 183 | // Raise the horizontal position |
| 184 | 184 | $x++; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | return $returnFileNames; |
| 49 | 49 | } else { |
| 50 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 50 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | * @return string |
| 59 | 59 | * @throws \Exception |
| 60 | 60 | */ |
| 61 | - public function resize($imagePath='', $width='',$height='') |
|
| 61 | + public function resize($imagePath = '', $width = '', $height = '') |
|
| 62 | 62 | { |
| 63 | - $modifier = '-r' . $width . 'x' . $height; |
|
| 63 | + $modifier = '-r'.$width.'x'.$height; |
|
| 64 | 64 | $destination = $this->modifyName($imagePath, $modifier); |
| 65 | 65 | if (file_exists($imagePath)) { |
| 66 | 66 | $image = new Image(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80); |
| 75 | 75 | return basename($destination); |
| 76 | 76 | } else { |
| 77 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 77 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | * @return string |
| 86 | 86 | * @throws \Exception |
| 87 | 87 | */ |
| 88 | - public function smartcrop($imagePath='', $width='',$height='') |
|
| 88 | + public function smartcrop($imagePath = '', $width = '', $height = '') |
|
| 89 | 89 | { |
| 90 | - $modifier = '-s' . $width . 'x' . $height; |
|
| 90 | + $modifier = '-s'.$width.'x'.$height; |
|
| 91 | 91 | $destination = $this->modifyName($imagePath, $modifier); |
| 92 | 92 | if (file_exists($imagePath)) { |
| 93 | 93 | $image = new Image(); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80); |
| 102 | 102 | return basename($destination); |
| 103 | 103 | } else { |
| 104 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 104 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | * @return string |
| 113 | 113 | * @throws \Exception |
| 114 | 114 | */ |
| 115 | - public function boxcrop($imagePath='', $width='',$height='') |
|
| 115 | + public function boxcrop($imagePath = '', $width = '', $height = '') |
|
| 116 | 116 | { |
| 117 | - $modifier = '-b' . $width . 'x' . $height; |
|
| 117 | + $modifier = '-b'.$width.'x'.$height; |
|
| 118 | 118 | $destination = $this->modifyName($imagePath, $modifier); |
| 119 | 119 | if (file_exists($imagePath)) { |
| 120 | 120 | $image = new Image(); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80); |
| 129 | 129 | return basename($destination); |
| 130 | 130 | } else { |
| 131 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 131 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @return string |
| 140 | 140 | */ |
| 141 | - private function modifyName($imagePath, $modifier='') |
|
| 141 | + private function modifyName($imagePath, $modifier = '') |
|
| 142 | 142 | { |
| 143 | 143 | $filename = basename($imagePath); |
| 144 | 144 | $path = dirname($imagePath); |
@@ -148,25 +148,25 @@ discard block |
||
| 148 | 148 | array_pop($fileParts); |
| 149 | 149 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 150 | 150 | $fileNameWithoutExtension = slugify($fileNameWithoutExtension); |
| 151 | - $filename = $fileNameWithoutExtension . $modifier . '.' . $extension; |
|
| 151 | + $filename = $fileNameWithoutExtension.$modifier.'.'.$extension; |
|
| 152 | 152 | } else { |
| 153 | 153 | $filename = slugify($filename); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if (file_exists($path . '/' . $filename)) { |
|
| 156 | + if (file_exists($path.'/'.$filename)) { |
|
| 157 | 157 | $fileParts = explode('.', $filename); |
| 158 | 158 | if (count($fileParts) > 1) { |
| 159 | 159 | $extension = end($fileParts); |
| 160 | 160 | array_pop($fileParts); |
| 161 | 161 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 162 | 162 | $fileNameWithoutExtension .= '-copy'; |
| 163 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
| 163 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
| 164 | 164 | } else { |
| 165 | 165 | $filename .= '-copy'; |
| 166 | 166 | } |
| 167 | - return $this->modifyName($path . '/' . $filename); |
|
| 167 | + return $this->modifyName($path.'/'.$filename); |
|
| 168 | 168 | } |
| 169 | - return $path . '/' . $filename; |
|
| 169 | + return $path.'/'.$filename; |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | private function config() |
| 35 | 35 | { |
| 36 | - $storagePath = __DIR__ . $this->storagePath; |
|
| 36 | + $storagePath = __DIR__.$this->storagePath; |
|
| 37 | 37 | if (realpath($storagePath) !== false) { |
| 38 | 38 | $jsonString = file_get_contents($storagePath); |
| 39 | 39 | $this->repository = json_decode($jsonString); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function getDocumentBySlug($slug) |
| 191 | 191 | { |
| 192 | - $documentContainer = $this->getDocumentContainerByPath('/' . $slug); |
|
| 192 | + $documentContainer = $this->getDocumentContainerByPath('/'.$slug); |
|
| 193 | 193 | $indices = $documentContainer['indices']; |
| 194 | 194 | |
| 195 | 195 | $folder = $this->repository->documents; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | // Check for duplicates |
| 227 | 227 | foreach ($this->repository->documents as $index => $document) { |
| 228 | 228 | if (end($indices) !== $index && $document->slug == $documentFolderObject->slug && $document->type == 'document') { |
| 229 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 229 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | $this->repository->documents[end($indices)] = $documentFolderObject; |
@@ -234,10 +234,10 @@ discard block |
||
| 234 | 234 | // Check for duplicates |
| 235 | 235 | foreach ($previousFolder->content as $index => $document) { |
| 236 | 236 | if (end($indices) !== $index && $document->slug == $documentFolderObject->slug && $document->type == 'document') { |
| 237 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 237 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | - $previousFolder->content[end($indices)] = $documentFolderObject ; |
|
| 240 | + $previousFolder->content[end($indices)] = $documentFolderObject; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | $this->save(); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | foreach ($this->repository->documents as $document) { |
| 252 | 252 | if ($document->slug == $documentFolderObject->slug && $document->type == 'document') { |
| 253 | 253 | // TODO make it so it doesnt throw an exception, but instead shows a warning |
| 254 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 254 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | $this->repository->documents[] = $documentFolderObject; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | foreach ($containerFolder->content as $document) { |
| 274 | 274 | if ($document->slug == $documentFolderObject->slug && $document->type == 'document') { |
| 275 | 275 | // TODO make it so it doesnt throw an exception, but instead shows a warning |
| 276 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 276 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | foreach ($this->repository->documents as $document) { |
| 357 | 357 | if ($document->slug == $documentFolderObject->slug && $document->type == 'folder') { |
| 358 | 358 | // TODO make it so it doesnt throw an exception, but instead shows a warning |
| 359 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 359 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | $this->repository->documents[] = $documentFolderObject; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | foreach ($containerFolder->content as $document) { |
| 378 | 378 | if ($document->slug == $documentFolderObject->slug && $document->type == 'folder') { |
| 379 | 379 | // TODO make it so it doesnt throw an exception, but instead shows a warning |
| 380 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 380 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | $folder->content[] = $documentFolderObject; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function getDocumentFolderBySlug($slug) |
| 431 | 431 | { |
| 432 | - $documentContainer = $this->getDocumentContainerByPath('/' . $slug); |
|
| 432 | + $documentContainer = $this->getDocumentContainerByPath('/'.$slug); |
|
| 433 | 433 | $indices = $documentContainer['indices']; |
| 434 | 434 | |
| 435 | 435 | $folder = $this->repository->documents; |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | // Check for duplicates |
| 474 | 474 | foreach ($this->repository->documents as $index => $document) { |
| 475 | 475 | if (end($indices) !== $index && $document->slug == $documentFolderObject->slug && $document->type == 'folder') { |
| 476 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 476 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | $this->repository->documents[end($indices)] = $documentFolderObject; |
@@ -481,10 +481,10 @@ discard block |
||
| 481 | 481 | // Check for duplicates |
| 482 | 482 | foreach ($previousFolder->content as $index => $document) { |
| 483 | 483 | if (end($indices) !== $index && $document->slug == $documentFolderObject->slug && $document->type == 'folder') { |
| 484 | - throw new \Exception('Duplicate slug: ' . $document->slug . ' in folder ' . $postValues['path']); |
|
| 484 | + throw new \Exception('Duplicate slug: '.$document->slug.' in folder '.$postValues['path']); |
|
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | - $previousFolder->content[end($indices)] = $documentFolderObject ; |
|
| 487 | + $previousFolder->content[end($indices)] = $documentFolderObject; |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | $this->save(); |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if ($matched === true) { |
| 537 | 537 | $noMatches += 1; |
| 538 | 538 | } else { |
| 539 | - throw new \Exception('Unknown folder "' . $slug . '" in path: ' . $path); |
|
| 539 | + throw new \Exception('Unknown folder "'.$slug.'" in path: '.$path); |
|
| 540 | 540 | } |
| 541 | 541 | $i += 1; |
| 542 | 542 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | 'previousDocument' => $previousDocument |
| 549 | 549 | ); |
| 550 | 550 | } else { |
| 551 | - throw new \Exception('Invalid path: ' . $path); |
|
| 551 | + throw new \Exception('Invalid path: '.$path); |
|
| 552 | 552 | } |
| 553 | 553 | } |
| 554 | 554 | |
@@ -732,13 +732,13 @@ discard block |
||
| 732 | 732 | |
| 733 | 733 | public function addImage($postValues) |
| 734 | 734 | { |
| 735 | - $destinationPath = realpath(__DIR__ . '/../../www/images/'); |
|
| 735 | + $destinationPath = realpath(__DIR__.'/../../www/images/'); |
|
| 736 | 736 | |
| 737 | 737 | $filename = $this->validateFilename($postValues['name'], $destinationPath); |
| 738 | - $destination = $destinationPath . '/' . $filename; |
|
| 738 | + $destination = $destinationPath.'/'.$filename; |
|
| 739 | 739 | |
| 740 | 740 | if ($postValues['error'] != '0') { |
| 741 | - throw new \Exception('Error uploading file. Error code: ' . $postValues['error']); |
|
| 741 | + throw new \Exception('Error uploading file. Error code: '.$postValues['error']); |
|
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | if (move_uploaded_file($postValues['tmp_name'], $destination)) { |
@@ -760,14 +760,14 @@ discard block |
||
| 760 | 760 | |
| 761 | 761 | public function deleteImageByName($filename) |
| 762 | 762 | { |
| 763 | - $destinationPath = realpath(__DIR__ . '/../../www/images/'); |
|
| 763 | + $destinationPath = realpath(__DIR__.'/../../www/images/'); |
|
| 764 | 764 | |
| 765 | 765 | $images = $this->getImages(); |
| 766 | 766 | |
| 767 | 767 | foreach ($images as $key => $image) { |
| 768 | 768 | if ($image->file == $filename) { |
| 769 | 769 | foreach ($image->set as $imageSetFilename) { |
| 770 | - $destination = $destinationPath . '/' . $imageSetFilename; |
|
| 770 | + $destination = $destinationPath.'/'.$imageSetFilename; |
|
| 771 | 771 | if (file_exists($destination)) { |
| 772 | 772 | unlink($destination); |
| 773 | 773 | } else { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | */ |
| 805 | 805 | public function getFiles() |
| 806 | 806 | { |
| 807 | - $files = $this->repository->files; |
|
| 807 | + $files = $this->repository->files; |
|
| 808 | 808 | usort($files, array($this, 'compareFiles')); |
| 809 | 809 | return $files; |
| 810 | 810 | } |
@@ -816,13 +816,13 @@ discard block |
||
| 816 | 816 | |
| 817 | 817 | public function addFile($postValues) |
| 818 | 818 | { |
| 819 | - $destinationPath = realpath(__DIR__ . '/../../www/files/'); |
|
| 819 | + $destinationPath = realpath(__DIR__.'/../../www/files/'); |
|
| 820 | 820 | |
| 821 | 821 | $filename = $this->validateFilename($postValues['name'], $destinationPath); |
| 822 | - $destination = $destinationPath . '/' . $filename; |
|
| 822 | + $destination = $destinationPath.'/'.$filename; |
|
| 823 | 823 | |
| 824 | 824 | if ($postValues['error'] != '0') { |
| 825 | - throw new \Exception('Error uploading file. Error code: ' . $postValues['error']); |
|
| 825 | + throw new \Exception('Error uploading file. Error code: '.$postValues['error']); |
|
| 826 | 826 | } |
| 827 | 827 | |
| 828 | 828 | if (move_uploaded_file($postValues['tmp_name'], $destination)) { |
@@ -846,23 +846,23 @@ discard block |
||
| 846 | 846 | array_pop($fileParts); |
| 847 | 847 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 848 | 848 | $fileNameWithoutExtension = slugify($fileNameWithoutExtension); |
| 849 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
| 849 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
| 850 | 850 | } else { |
| 851 | 851 | $filename = slugify($filename); |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | - if (file_exists($path . '/' . $filename)) { |
|
| 854 | + if (file_exists($path.'/'.$filename)) { |
|
| 855 | 855 | $fileParts = explode('.', $filename); |
| 856 | 856 | if (count($fileParts) > 1) { |
| 857 | 857 | $extension = end($fileParts); |
| 858 | 858 | array_pop($fileParts); |
| 859 | 859 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 860 | 860 | $fileNameWithoutExtension .= '-copy'; |
| 861 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
| 861 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
| 862 | 862 | } else { |
| 863 | 863 | $filename .= '-copy'; |
| 864 | 864 | } |
| 865 | - return $this->validateFilename($filename,$path); |
|
| 865 | + return $this->validateFilename($filename, $path); |
|
| 866 | 866 | } |
| 867 | 867 | return $filename; |
| 868 | 868 | } |
@@ -879,8 +879,8 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | public function deleteFileByName($filename) |
| 881 | 881 | { |
| 882 | - $destinationPath = realpath(__DIR__ . '/../../www/files/'); |
|
| 883 | - $destination = $destinationPath . '/' . $filename; |
|
| 882 | + $destinationPath = realpath(__DIR__.'/../../www/files/'); |
|
| 883 | + $destination = $destinationPath.'/'.$filename; |
|
| 884 | 884 | |
| 885 | 885 | if (file_exists($destination)) { |
| 886 | 886 | $files = $this->getFiles(); |
@@ -1173,11 +1173,11 @@ discard block |
||
| 1173 | 1173 | * @throws \Exception |
| 1174 | 1174 | */ |
| 1175 | 1175 | private function save() { |
| 1176 | - $storagePath = __DIR__ . $this->storagePath; |
|
| 1176 | + $storagePath = __DIR__.$this->storagePath; |
|
| 1177 | 1177 | if (realpath($storagePath) !== false) { |
| 1178 | 1178 | file_put_contents($storagePath, json_encode($this->repository)); |
| 1179 | 1179 | } else { |
| 1180 | - throw new \Exception('Couldnt find storagePath ' . $storagePath); |
|
| 1180 | + throw new \Exception('Couldnt find storagePath '.$storagePath); |
|
| 1181 | 1181 | } |
| 1182 | 1182 | } |
| 1183 | 1183 | |
@@ -3,9 +3,9 @@ discard block |
||
| 3 | 3 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
| 4 | 4 | </div> |
| 5 | 5 | <?if ($static == true) { |
| 6 | - $fieldPrefix = 'bricks[' . $myBrickSlug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . '][fields]'; |
|
| 6 | + $fieldPrefix = 'bricks['.$myBrickSlug.']['.str_replace('.', '', str_replace(' ', '', microtime())).'][fields]'; |
|
| 7 | 7 | } else { |
| 8 | - $fieldPrefix = 'dynamicBricks[' . $brick->slug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . ']'; |
|
| 8 | + $fieldPrefix = 'dynamicBricks['.$brick->slug.']['.str_replace('.', '', str_replace(' ', '', microtime())).']'; |
|
| 9 | 9 | }?> |
| 10 | 10 | <? foreach ($brick->fields as $field) : ?> |
| 11 | 11 | <div class="form-element"> |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
| 31 | 31 | <div class="form-element"> |
| 32 | 32 | <? endif ?> |
| 33 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
| 33 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
| 34 | 34 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
| 35 | 35 | |
| 36 | 36 | </div> |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | <li class="grid-container"> |
| 53 | 53 | <div class="grid-box-10"> |
| 54 | 54 | <div class="grid-inner form-element"> |
| 55 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
| 55 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
| 56 | 56 | </div> |
| 57 | 57 | </div> |
| 58 | 58 | <div class="grid-box-2"> |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | </div> |
| 63 | 63 | </div> |
| 64 | 64 | </li> |
| 65 | - <?$value='';?> |
|
| 65 | + <?$value = ''; ?> |
|
| 66 | 66 | <? endforeach ?> |
| 67 | 67 | <? endif ?> |
| 68 | 68 | </ul> |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | <a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a> |
| 80 | 80 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
| 81 | 81 | <div class="form-element"> |
| 82 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
| 82 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
| 83 | 83 | </div> |
| 84 | 84 | </li> |
| 85 | - <?$value='';?> |
|
| 85 | + <?$value = ''; ?> |
|
| 86 | 86 | <? endforeach ?> |
| 87 | 87 | <? endif ?> |
| 88 | 88 | </div> |
@@ -91,5 +91,5 @@ discard block |
||
| 91 | 91 | <a class="btn js-addrtemultiple">+</a> |
| 92 | 92 | <? endif ?> |
| 93 | 93 | </div> |
| 94 | - <?$value='';?> |
|
| 94 | + <?$value = ''; ?> |
|
| 95 | 95 | <? endforeach ?> |