@@ -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; |
@@ -61,12 +61,15 @@ |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 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"; |
|
| 64 | + if( (!$unit && $size >= 1<<30) || $unit == "GB") { |
|
| 65 | + return number_format($size/(1<<30),2)."GB"; |
|
| 66 | + } |
|
| 67 | + if( (!$unit && $size >= 1<<20) || $unit == "MB") { |
|
| 68 | + return number_format($size/(1<<20),2)."MB"; |
|
| 69 | + } |
|
| 70 | + if( (!$unit && $size >= 1<<10) || $unit == "KB") { |
|
| 71 | + return number_format($size/(1<<10),2)."KB"; |
|
| 72 | + } |
|
| 70 | 73 | return number_format($size)." bytes"; |
| 71 | 74 | } |
| 72 | 75 | |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | * @param array $replace |
| 117 | 117 | * @param string $delimiter |
| 118 | 118 | * |
| 119 | - * @return mixed|string |
|
| 119 | + * @return string |
|
| 120 | 120 | */ |
| 121 | 121 | function slugify($str, $replace=array(), $delimiter='-') { |
| 122 | 122 | if( !empty($replace) ) { |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | return '0 seconds'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $a = array( 365 * 24 * 60 * 60 => 'year', |
|
| 41 | + $a = array(365 * 24 * 60 * 60 => 'year', |
|
| 42 | 42 | 30 * 24 * 60 * 60 => 'month', |
| 43 | 43 | 24 * 60 * 60 => 'day', |
| 44 | 44 | 60 * 60 => 'hour', |
| 45 | 45 | 60 => 'minute', |
| 46 | 46 | 1 => 'second' |
| 47 | 47 | ); |
| 48 | - $a_plural = array( 'year' => 'years', |
|
| 48 | + $a_plural = array('year' => 'years', |
|
| 49 | 49 | 'month' => 'months', |
| 50 | 50 | 'day' => 'days', |
| 51 | 51 | 'hour' => 'hours', |
@@ -59,19 +59,19 @@ discard block |
||
| 59 | 59 | if ($d >= 1) |
| 60 | 60 | { |
| 61 | 61 | $r = round($d); |
| 62 | - return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; |
|
| 62 | + return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago'; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | return 0; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | -function humanFileSize($size,$unit="") { |
|
| 69 | - if( (!$unit && $size >= 1<<30) || $unit == "GB") |
|
| 70 | - return number_format($size/(1<<30),2)."GB"; |
|
| 71 | - if( (!$unit && $size >= 1<<20) || $unit == "MB") |
|
| 72 | - return number_format($size/(1<<20),2)."MB"; |
|
| 73 | - if( (!$unit && $size >= 1<<10) || $unit == "KB") |
|
| 74 | - return number_format($size/(1<<10),2)."KB"; |
|
| 68 | +function humanFileSize($size, $unit = "") { |
|
| 69 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
| 70 | + return number_format($size / (1 << 30), 2)."GB"; |
|
| 71 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
| 72 | + return number_format($size / (1 << 20), 2)."MB"; |
|
| 73 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
| 74 | + return number_format($size / (1 << 10), 2)."KB"; |
|
| 75 | 75 | return number_format($size)." bytes"; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | * |
| 119 | 119 | * @return mixed|string |
| 120 | 120 | */ |
| 121 | -function slugify($str, $replace=array(), $delimiter='-') { |
|
| 122 | - if( !empty($replace) ) { |
|
| 123 | - $str = str_replace((array)$replace, ' ', $str); |
|
| 121 | +function slugify($str, $replace = array(), $delimiter = '-') { |
|
| 122 | + if (!empty($replace)) { |
|
| 123 | + $str = str_replace((array) $replace, ' ', $str); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $debug_backtrace = current(debug_backtrace()); |
| 145 | 145 | if (PHP_SAPI == 'cli') { |
| 146 | - echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n"; |
|
| 146 | + echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n"; |
|
| 147 | 147 | foreach (func_get_args() as $data) { |
| 148 | 148 | var_dump($data); |
| 149 | 149 | } |
| 150 | 150 | } else { |
| 151 | 151 | ob_clean(); |
| 152 | - echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>"; |
|
| 152 | + echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>"; |
|
| 153 | 153 | echo '<pre>'; |
| 154 | 154 | foreach (func_get_args() as $data) { |
| 155 | 155 | echo "<code>"; |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | function utf8Convert($array) |
| 192 | 192 | { |
| 193 | - array_walk_recursive($array, function(&$item, $key){ |
|
| 194 | - if(!mb_detect_encoding($item, 'utf-8', true)){ |
|
| 193 | + array_walk_recursive($array, function(&$item, $key) { |
|
| 194 | + if (!mb_detect_encoding($item, 'utf-8', true)) { |
|
| 195 | 195 | $item = utf8_encode($item); |
| 196 | 196 | } |
| 197 | 197 | }); |
@@ -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 | |
@@ -6,12 +6,12 @@ discard block |
||
| 6 | 6 | } |
| 7 | 7 | ?> |
| 8 | 8 | <div class="rte"> |
| 9 | - <div id="summernote_<?=str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug?>_rte_<?=$summernoteInstances?>" class="summernote"><?=isset($value) ? $value : '' ?></div> |
|
| 9 | + <div id="summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug?>_rte_<?=$summernoteInstances?>" class="summernote"><?=isset($value) ? $value : '' ?></div> |
|
| 10 | 10 | </div> |
| 11 | 11 | <textarea style="display:none;" id="summernote_<?=$field->slug?>_container_<?=$summernoteInstances?>" name="<?=$fieldPrefix?>[<?=$field->slug?>][]"></textarea> |
| 12 | 12 | <script> |
| 13 | 13 | $(document).ready(function () { |
| 14 | - $('#summernote_<?=str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug?>_rte_<?=$summernoteInstances?>').summernote({ |
|
| 14 | + $('#summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug?>_rte_<?=$summernoteInstances?>').summernote({ |
|
| 15 | 15 | height: 300, |
| 16 | 16 | toolbar: [ |
| 17 | 17 | //[groupname, [button list]] |
@@ -29,4 +29,4 @@ discard block |
||
| 29 | 29 | if (!isset($GLOBALS['rteList'])) { |
| 30 | 30 | $GLOBALS['rteList'] = array(); |
| 31 | 31 | } |
| 32 | -$GLOBALS['rteList'][] = 'summernote_' . str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug . '_rte_' . $summernoteInstances ?> |
|
| 32 | +$GLOBALS['rteList'][] = 'summernote_'.str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug.'_rte_'.$summernoteInstances ?> |
|
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @param array $parameters |
| 42 | 42 | * @param $matchedSitemapItem |
| 43 | 43 | */ |
| 44 | - public function __construct($template='', Request $request, $parameters=array(), $matchedSitemapItem) |
|
| 44 | + public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem) |
|
| 45 | 45 | { |
| 46 | 46 | $this->template = $template; |
| 47 | 47 | $this->request = $request; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @throws \Exception |
| 69 | 69 | */ |
| 70 | - public function render($application=null) |
|
| 70 | + public function render($application = null) |
|
| 71 | 71 | { |
| 72 | 72 | $this->renderedContent = $this->renderTemplate($this->template, true, $application); |
| 73 | 73 | } |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | * @return string |
| 94 | 94 | * @throws \Exception |
| 95 | 95 | */ |
| 96 | - public function renderTemplate($template='', $obClean = true, $application=null) |
|
| 96 | + public function renderTemplate($template = '', $obClean = true, $application = null) |
|
| 97 | 97 | { |
| 98 | - $templatePath = __DIR__ . '/../../templates/' . $template . '.php'; |
|
| 98 | + $templatePath = __DIR__.'/../../templates/'.$template.'.php'; |
|
| 99 | 99 | if (realpath($templatePath) !== false) { |
| 100 | 100 | if ($obClean) { |
| 101 | 101 | ob_clean(); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | return ob_get_contents(); |
| 113 | 113 | } else { |
| 114 | 114 | if ($template !== null) { // If template is null, its a application component, which doesnt have a template |
| 115 | - throw new \Exception('Couldnt find template ' . $templatePath); |
|
| 115 | + throw new \Exception('Couldnt find template '.$templatePath); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @return string |
| 128 | 128 | * @throws \Exception |
| 129 | 129 | */ |
| 130 | - public function includeTemplate($template='', $parameters = array()) |
|
| 130 | + public function includeTemplate($template = '', $parameters = array()) |
|
| 131 | 131 | { |
| 132 | 132 | if (is_array($parameters)) { |
| 133 | 133 | foreach ($parameters as $name => $value) { |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | /** |
| 106 | 106 | * Detect if the language is switched manually |
| 107 | 107 | * |
| 108 | - * @param $request |
|
| 108 | + * @param Request $request |
|
| 109 | 109 | */ |
| 110 | 110 | private function checkLanguageSwitch($request) |
| 111 | 111 | { |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | |
| 97 | 97 | if ($this->forceRedirect === true) { |
| 98 | 98 | if (substr($request::$relativeUri, 0, 2) !== $lang && $lang !== $this->defaultLanguage) { // if default language detected, no redirect |
| 99 | - header('Location: ' . $request::$subfolders . $lang . '/' . $request::$relativeUri); |
|
| 99 | + header('Location: '.$request::$subfolders.$lang.'/'.$request::$relativeUri); |
|
| 100 | 100 | exit; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -7,118 +7,118 @@ |
||
| 7 | 7 | |
| 8 | 8 | class LanguageComponent implements Component |
| 9 | 9 | { |
| 10 | - protected $request; |
|
| 11 | - protected $parameters; |
|
| 12 | - |
|
| 13 | - protected $defaultLanguage = 'en'; |
|
| 14 | - protected $acceptedLanguages = null; |
|
| 15 | - protected $languageParameterName = 'language'; |
|
| 16 | - protected $forceRedirect = false; |
|
| 17 | - protected $sessionValues; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Component constructor. |
|
| 21 | - * |
|
| 22 | - * @param $template |
|
| 23 | - * @param Request $request |
|
| 24 | - * @param $parameters |
|
| 25 | - * @param $matchedSitemapItem |
|
| 26 | - */ |
|
| 27 | - public function __construct($template, Request $request, $parameters, $matchedSitemapItem) |
|
| 28 | - { |
|
| 29 | - $this->parameters = (array) $parameters; |
|
| 30 | - $this->checkParameters(); |
|
| 31 | - |
|
| 32 | - $lang = substr(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : $this->defaultLanguage, 0, 2); |
|
| 33 | - $_SESSION['LanguageComponent']['detectedLanguage'] = $lang; |
|
| 34 | - |
|
| 35 | - $this->checkLanguageSwitch($request); |
|
| 36 | - |
|
| 37 | - if (!isset($_SESSION['LanguageComponent'][$this->languageParameterName])) { |
|
| 38 | - $this->detectLanguage($lang, $request); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $this->parameters[$this->languageParameterName] = $_SESSION['LanguageComponent'][$this->languageParameterName]; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Checks to see if any parameters are given from the configuration in the CMS |
|
| 46 | - */ |
|
| 47 | - private function checkParameters() |
|
| 48 | - { |
|
| 49 | - if (isset($this->parameters['defaultLanguage'])) { |
|
| 50 | - $this->defaultLanguage = $this->parameters['defaultLanguage']; |
|
| 51 | - unset($this->parameters['defaultLanguage']); |
|
| 52 | - } |
|
| 53 | - if (isset($this->parameters['acceptedLanguages'])) { |
|
| 54 | - $this->acceptedLanguages = explode(',', $this->parameters['acceptedLanguages']); |
|
| 55 | - unset($this->parameters['acceptedLanguages']); |
|
| 56 | - } |
|
| 57 | - if (isset($this->parameters['languageParameterName'])) { |
|
| 58 | - $this->languageParameterName = $this->parameters['languageParameterName']; |
|
| 59 | - unset($this->parameters['languageParameterName']); |
|
| 60 | - } |
|
| 61 | - if (isset($this->parameters['forceRedirect'])) { |
|
| 62 | - $this->forceRedirect = (bool) $this->parameters['forceRedirect']; |
|
| 63 | - unset($this->parameters['forceRedirect']); |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @return array |
|
| 69 | - */ |
|
| 70 | - public function getParameters() |
|
| 71 | - { |
|
| 72 | - return $this->parameters; |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * Check if the found language is allowed and |
|
| 78 | - * if an action is to be taken. |
|
| 79 | - * |
|
| 80 | - * @param $lang |
|
| 81 | - * @param $request |
|
| 82 | - */ |
|
| 83 | - private function detectLanguage($lang, $request) |
|
| 84 | - { |
|
| 85 | - $_SESSION['LanguageComponent'][$this->languageParameterName] = $this->defaultLanguage; |
|
| 86 | - |
|
| 87 | - if ($this->acceptedLanguages === null) { |
|
| 88 | - $_SESSION['LanguageComponent'][$this->languageParameterName] = $lang; |
|
| 89 | - } else if (in_array($lang, $this->acceptedLanguages)) { |
|
| 90 | - $_SESSION['LanguageComponent'][$this->languageParameterName] = $lang; |
|
| 91 | - } else { |
|
| 92 | - $lang = $this->defaultLanguage; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - $this->sessionValues = $_SESSION['LanguageComponent']; |
|
| 96 | - |
|
| 97 | - if ($this->forceRedirect === true) { |
|
| 98 | - if (substr($request::$relativeUri, 0, 2) !== $lang && $lang !== $this->defaultLanguage) { // if default language detected, no redirect |
|
| 99 | - header('Location: ' . $request::$subfolders . $lang . '/' . $request::$relativeUri); |
|
| 100 | - exit; |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * Detect if the language is switched manually |
|
| 107 | - * |
|
| 108 | - * @param $request |
|
| 109 | - */ |
|
| 110 | - private function checkLanguageSwitch($request) |
|
| 111 | - { |
|
| 112 | - if (isset($request::$get['langSwitch'])) { |
|
| 113 | - $this->forceRedirect = true; |
|
| 114 | - $this->detectLanguage($request::$get['langSwitch'], $request); |
|
| 115 | - } |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /* |
|
| 10 | + protected $request; |
|
| 11 | + protected $parameters; |
|
| 12 | + |
|
| 13 | + protected $defaultLanguage = 'en'; |
|
| 14 | + protected $acceptedLanguages = null; |
|
| 15 | + protected $languageParameterName = 'language'; |
|
| 16 | + protected $forceRedirect = false; |
|
| 17 | + protected $sessionValues; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Component constructor. |
|
| 21 | + * |
|
| 22 | + * @param $template |
|
| 23 | + * @param Request $request |
|
| 24 | + * @param $parameters |
|
| 25 | + * @param $matchedSitemapItem |
|
| 26 | + */ |
|
| 27 | + public function __construct($template, Request $request, $parameters, $matchedSitemapItem) |
|
| 28 | + { |
|
| 29 | + $this->parameters = (array) $parameters; |
|
| 30 | + $this->checkParameters(); |
|
| 31 | + |
|
| 32 | + $lang = substr(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : $this->defaultLanguage, 0, 2); |
|
| 33 | + $_SESSION['LanguageComponent']['detectedLanguage'] = $lang; |
|
| 34 | + |
|
| 35 | + $this->checkLanguageSwitch($request); |
|
| 36 | + |
|
| 37 | + if (!isset($_SESSION['LanguageComponent'][$this->languageParameterName])) { |
|
| 38 | + $this->detectLanguage($lang, $request); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $this->parameters[$this->languageParameterName] = $_SESSION['LanguageComponent'][$this->languageParameterName]; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Checks to see if any parameters are given from the configuration in the CMS |
|
| 46 | + */ |
|
| 47 | + private function checkParameters() |
|
| 48 | + { |
|
| 49 | + if (isset($this->parameters['defaultLanguage'])) { |
|
| 50 | + $this->defaultLanguage = $this->parameters['defaultLanguage']; |
|
| 51 | + unset($this->parameters['defaultLanguage']); |
|
| 52 | + } |
|
| 53 | + if (isset($this->parameters['acceptedLanguages'])) { |
|
| 54 | + $this->acceptedLanguages = explode(',', $this->parameters['acceptedLanguages']); |
|
| 55 | + unset($this->parameters['acceptedLanguages']); |
|
| 56 | + } |
|
| 57 | + if (isset($this->parameters['languageParameterName'])) { |
|
| 58 | + $this->languageParameterName = $this->parameters['languageParameterName']; |
|
| 59 | + unset($this->parameters['languageParameterName']); |
|
| 60 | + } |
|
| 61 | + if (isset($this->parameters['forceRedirect'])) { |
|
| 62 | + $this->forceRedirect = (bool) $this->parameters['forceRedirect']; |
|
| 63 | + unset($this->parameters['forceRedirect']); |
|
| 64 | + } |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @return array |
|
| 69 | + */ |
|
| 70 | + public function getParameters() |
|
| 71 | + { |
|
| 72 | + return $this->parameters; |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * Check if the found language is allowed and |
|
| 78 | + * if an action is to be taken. |
|
| 79 | + * |
|
| 80 | + * @param $lang |
|
| 81 | + * @param $request |
|
| 82 | + */ |
|
| 83 | + private function detectLanguage($lang, $request) |
|
| 84 | + { |
|
| 85 | + $_SESSION['LanguageComponent'][$this->languageParameterName] = $this->defaultLanguage; |
|
| 86 | + |
|
| 87 | + if ($this->acceptedLanguages === null) { |
|
| 88 | + $_SESSION['LanguageComponent'][$this->languageParameterName] = $lang; |
|
| 89 | + } else if (in_array($lang, $this->acceptedLanguages)) { |
|
| 90 | + $_SESSION['LanguageComponent'][$this->languageParameterName] = $lang; |
|
| 91 | + } else { |
|
| 92 | + $lang = $this->defaultLanguage; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + $this->sessionValues = $_SESSION['LanguageComponent']; |
|
| 96 | + |
|
| 97 | + if ($this->forceRedirect === true) { |
|
| 98 | + if (substr($request::$relativeUri, 0, 2) !== $lang && $lang !== $this->defaultLanguage) { // if default language detected, no redirect |
|
| 99 | + header('Location: ' . $request::$subfolders . $lang . '/' . $request::$relativeUri); |
|
| 100 | + exit; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * Detect if the language is switched manually |
|
| 107 | + * |
|
| 108 | + * @param $request |
|
| 109 | + */ |
|
| 110 | + private function checkLanguageSwitch($request) |
|
| 111 | + { |
|
| 112 | + if (isset($request::$get['langSwitch'])) { |
|
| 113 | + $this->forceRedirect = true; |
|
| 114 | + $this->detectLanguage($request::$get['langSwitch'], $request); |
|
| 115 | + } |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + /* |
|
| 119 | 119 | * These functions are required by the interface, but not for the functionality |
| 120 | 120 | */ |
| 121 | - public function run(Storage $storage) {} |
|
| 122 | - public function render() {} |
|
| 123 | - public function get() {} |
|
| 121 | + public function run(Storage $storage) {} |
|
| 122 | + public function render() {} |
|
| 123 | + public function get() {} |
|
| 124 | 124 | } |
| 125 | 125 | \ No newline at end of file |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (isset($this->parameters['document'])) { |
| 84 | 84 | $this->runByDocumentParameter(); |
| 85 | 85 | } else { |
| 86 | - throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title); |
|
| 86 | + throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title); |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | $relativeDocumentUri = current($this->matchedSitemapItem->matches[1]); |
| 101 | 101 | if (isset($this->parameters['folder'])) { |
| 102 | 102 | if (substr($this->parameters['folder'], -1) !== '/') { |
| 103 | - $this->parameters['folder'] = $this->parameters['folder'] . '/'; |
|
| 103 | + $this->parameters['folder'] = $this->parameters['folder'].'/'; |
|
| 104 | 104 | } |
| 105 | - $relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri; |
|
| 105 | + $relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $document = $this->storage->getDocumentBySlug($relativeDocumentUri); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var null |
| 21 | - */ |
|
| 21 | + */ |
|
| 22 | 22 | protected $subTemplate = null; |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | /** |
| 140 | 140 | * @param $remoteAddress |
| 141 | 141 | * @throws \Exception |
| 142 | - */ |
|
| 142 | + */ |
|
| 143 | 143 | private function checkWhiteList($remoteAddress) |
| 144 | 144 | { |
| 145 | 145 | if (isset($this->parameters['whitelistIps'])) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * @param $remoteAddress |
| 156 | 156 | * @throws \Exception |
| 157 | - */ |
|
| 157 | + */ |
|
| 158 | 158 | private function checkBlackList($remoteAddress) |
| 159 | 159 | { |
| 160 | 160 | if (isset($this->parameters['blacklistIps'])) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | /** |
| 170 | 170 | * @param $request |
| 171 | 171 | * @return mixed|string |
| 172 | - */ |
|
| 172 | + */ |
|
| 173 | 173 | private function getRelativeCmsUri($request) |
| 174 | 174 | { |
| 175 | 175 | // TODO Use regex match parameter instead of calculating relative uri |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * @param $request |
| 186 | 186 | * @param $relativeCmsUri |
| 187 | - */ |
|
| 187 | + */ |
|
| 188 | 188 | private function documentsRouting($request, $relativeCmsUri) |
| 189 | 189 | { |
| 190 | 190 | if ($relativeCmsUri == '/documents') { |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | /** |
| 200 | 200 | * @param $request |
| 201 | 201 | * @param $relativeCmsUri |
| 202 | - */ |
|
| 202 | + */ |
|
| 203 | 203 | private function sitemapRouting($request, $relativeCmsUri) |
| 204 | 204 | { |
| 205 | 205 | if ($relativeCmsUri == '/sitemap') { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | /** |
| 238 | 238 | * @param $request |
| 239 | 239 | * @param $relativeCmsUri |
| 240 | - */ |
|
| 240 | + */ |
|
| 241 | 241 | private function imagesRouting($request, $relativeCmsUri) |
| 242 | 242 | { |
| 243 | 243 | if ($relativeCmsUri == '/images') { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * @param $relativeCmsUri |
| 272 | - */ |
|
| 272 | + */ |
|
| 273 | 273 | private function apiRouting($relativeCmsUri) |
| 274 | 274 | { |
| 275 | 275 | if ($relativeCmsUri == '/images.json') { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | /** |
| 288 | 288 | * @param $request |
| 289 | 289 | * @param $relativeCmsUri |
| 290 | - */ |
|
| 290 | + */ |
|
| 291 | 291 | private function filesRouting($request, $relativeCmsUri) |
| 292 | 292 | { |
| 293 | 293 | if ($relativeCmsUri == '/files') { |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | /** |
| 315 | 315 | * @param $slug |
| 316 | - */ |
|
| 316 | + */ |
|
| 317 | 317 | private function downloadFile($slug) |
| 318 | 318 | { |
| 319 | 319 | $file = $this->storage->getFileByName($slug); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | /** |
| 339 | 339 | * @param $request |
| 340 | 340 | * @param $relativeCmsUri |
| 341 | - */ |
|
| 341 | + */ |
|
| 342 | 342 | private function configurationRouting($request, $relativeCmsUri) |
| 343 | 343 | { |
| 344 | 344 | if ($relativeCmsUri == '/configuration') { |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | * @param $request |
| 358 | 358 | * @param $relativeCmsUri |
| 359 | 359 | * @throws \Exception |
| 360 | - */ |
|
| 360 | + */ |
|
| 361 | 361 | private function documentRouting($request, $relativeCmsUri) |
| 362 | 362 | { |
| 363 | 363 | if ($relativeCmsUri == '/documents/new-document' && isset($request::$get['path'])) { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | /** |
| 413 | 413 | * @param $request |
| 414 | 414 | * @param $relativeCmsUri |
| 415 | - */ |
|
| 415 | + */ |
|
| 416 | 416 | private function folderRouting($request, $relativeCmsUri) |
| 417 | 417 | { |
| 418 | 418 | if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get['path'])) { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | /** |
| 454 | 454 | * @param $request |
| 455 | 455 | * @param $relativeCmsUri |
| 456 | - */ |
|
| 456 | + */ |
|
| 457 | 457 | private function usersRouting($request, $relativeCmsUri) |
| 458 | 458 | { |
| 459 | 459 | if ($relativeCmsUri == '/configuration/users') { |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | /** |
| 488 | 488 | * @param $request |
| 489 | 489 | * @param $relativeCmsUri |
| 490 | - */ |
|
| 490 | + */ |
|
| 491 | 491 | private function documentTypesRouting($request, $relativeCmsUri) |
| 492 | 492 | { |
| 493 | 493 | if ($relativeCmsUri == '/configuration/document-types') { |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | /** |
| 527 | 527 | * @param $request |
| 528 | 528 | * @param $relativeCmsUri |
| 529 | - */ |
|
| 529 | + */ |
|
| 530 | 530 | private function bricksRouting($request, $relativeCmsUri) |
| 531 | 531 | { |
| 532 | 532 | if ($relativeCmsUri == '/configuration/bricks') { |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | /** |
| 566 | 566 | * @param $request |
| 567 | 567 | * @param $relativeCmsUri |
| 568 | - */ |
|
| 568 | + */ |
|
| 569 | 569 | private function imageSetRouting($request, $relativeCmsUri) |
| 570 | 570 | { |
| 571 | 571 | if ($relativeCmsUri == '/configuration/image-set') { |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | /** |
| 601 | 601 | * @param $request |
| 602 | 602 | * @param $relativeCmsUri |
| 603 | - */ |
|
| 603 | + */ |
|
| 604 | 604 | private function applicationComponentRouting($request, $relativeCmsUri) |
| 605 | 605 | { |
| 606 | 606 | if ($relativeCmsUri == '/configuration/application-components') { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $whitelistIps = explode(',', $this->parameters['whitelistIps']); |
| 149 | 149 | $whitelistIps = array_map("trim", $whitelistIps); |
| 150 | 150 | if (!in_array($remoteAddress, $whitelistIps)) { |
| 151 | - throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
| 151 | + throw new \Exception('Ip address '.$remoteAddress.' is not on whitelist'); |
|
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $blacklistIps = explode(',', $this->parameters['blacklistIps']); |
| 164 | 164 | $blacklistIps = array_map("trim", $blacklistIps); |
| 165 | 165 | if (in_array($remoteAddress, $blacklistIps)) { |
| 166 | - throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
| 166 | + throw new \Exception('Ip address '.$remoteAddress.' is on blacklist'); |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $this->parameters['mainNavClass'] = 'sitemap'; |
| 217 | 217 | if (isset($request::$post['title'], $request::$post['template'], $request::$post['component'])) { |
| 218 | 218 | $this->storage->addSitemapItem($request::$post); |
| 219 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 219 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 220 | 220 | exit; |
| 221 | 221 | } |
| 222 | 222 | } elseif ($relativeCmsUri == '/sitemap/edit' && isset($request::$get['slug'])) { |
@@ -225,13 +225,13 @@ discard block |
||
| 225 | 225 | $sitemapItem = $this->storage->getSitemapItemBySlug($request::$get['slug']); |
| 226 | 226 | if (isset($request::$post['title'], $request::$post['template'], $request::$post['component'])) { |
| 227 | 227 | $this->storage->saveSitemapItem($request::$get['slug'], $request::$post); |
| 228 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 228 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 229 | 229 | exit; |
| 230 | 230 | } |
| 231 | 231 | $this->parameters['sitemapItem'] = $sitemapItem; |
| 232 | 232 | } elseif ($relativeCmsUri == '/sitemap/delete' && isset($request::$get['slug'])) { |
| 233 | 233 | $this->storage->deleteSitemapItemBySlug($request::$get['slug']); |
| 234 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/sitemap'); |
|
| 234 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/sitemap'); |
|
| 235 | 235 | exit; |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -255,12 +255,12 @@ discard block |
||
| 255 | 255 | $this->parameters['mainNavClass'] = 'images'; |
| 256 | 256 | if (isset($_FILES['file'])) { |
| 257 | 257 | $this->storage->addImage($_FILES['file']); |
| 258 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/images'); |
|
| 258 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/images'); |
|
| 259 | 259 | exit; |
| 260 | 260 | } |
| 261 | 261 | } elseif ($relativeCmsUri == '/images/delete' && isset($request::$get['file'])) { |
| 262 | 262 | $this->storage->deleteImageByName($request::$get['file']); |
| 263 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/images'); |
|
| 263 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/images'); |
|
| 264 | 264 | exit; |
| 265 | 265 | } elseif ($relativeCmsUri == '/images/show' && isset($request::$get['file'])) { |
| 266 | 266 | $this->subTemplate = 'cms/images/show'; |
@@ -301,14 +301,14 @@ discard block |
||
| 301 | 301 | $this->parameters['mainNavClass'] = 'files'; |
| 302 | 302 | if (isset($_FILES['file'])) { |
| 303 | 303 | $this->storage->addFile($_FILES['file']); |
| 304 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/files'); |
|
| 304 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/files'); |
|
| 305 | 305 | exit; |
| 306 | 306 | } |
| 307 | 307 | } elseif ($relativeCmsUri == '/files/get' && isset($request::$get['file'])) { |
| 308 | 308 | $this->downloadFile($request::$get['file']); |
| 309 | 309 | } elseif ($relativeCmsUri == '/files/delete' && isset($request::$get['file'])) { |
| 310 | 310 | $this->storage->deleteFileByName($request::$get['file']); |
| 311 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/files'); |
|
| 311 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/files'); |
|
| 312 | 312 | exit; |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -319,21 +319,21 @@ discard block |
||
| 319 | 319 | private function downloadFile($slug) |
| 320 | 320 | { |
| 321 | 321 | $file = $this->storage->getFileByName($slug); |
| 322 | - $path = realpath(__DIR__ . '/../../www/files/'); |
|
| 323 | - $quoted = sprintf('"%s"', addcslashes(basename($path . '/' . $file->file), '"\\')); |
|
| 324 | - $size = filesize($path . '/' . $file->file); |
|
| 322 | + $path = realpath(__DIR__.'/../../www/files/'); |
|
| 323 | + $quoted = sprintf('"%s"', addcslashes(basename($path.'/'.$file->file), '"\\')); |
|
| 324 | + $size = filesize($path.'/'.$file->file); |
|
| 325 | 325 | |
| 326 | 326 | header('Content-Description: File Transfer'); |
| 327 | - header('Content-Type: ' . $file->type); |
|
| 328 | - header('Content-Disposition: attachment; filename=' . $quoted); |
|
| 327 | + header('Content-Type: '.$file->type); |
|
| 328 | + header('Content-Disposition: attachment; filename='.$quoted); |
|
| 329 | 329 | header('Content-Transfer-Encoding: binary'); |
| 330 | 330 | header('Connection: Keep-Alive'); |
| 331 | 331 | header('Expires: 0'); |
| 332 | 332 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 333 | 333 | header('Pragma: public'); |
| 334 | - header('Content-Length: ' . $size); |
|
| 334 | + header('Content-Length: '.$size); |
|
| 335 | 335 | |
| 336 | - readfile($path . '/' . $file->file); |
|
| 336 | + readfile($path.'/'.$file->file); |
|
| 337 | 337 | exit; |
| 338 | 338 | } |
| 339 | 339 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | if (isset($request::$get['documentType'])) { |
| 370 | 370 | if (isset($request::$post['title'], $request::$get['documentType'], $request::$get['path'])) { |
| 371 | 371 | $this->storage->addDocument($request::$post); |
| 372 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 372 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 373 | 373 | exit; |
| 374 | 374 | } |
| 375 | 375 | $this->parameters['documentType'] = $this->storage->getDocumentTypeBySlug($request::$get['documentType'], true); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $this->parameters['smallestImage'] = $this->storage->getSmallestImageSet()->slug; |
| 384 | 384 | if (isset($request::$post['title'], $request::$get['slug'])) { |
| 385 | 385 | $this->storage->saveDocument($request::$post); |
| 386 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 386 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 387 | 387 | exit; |
| 388 | 388 | } |
| 389 | 389 | $this->parameters['document'] = $this->storage->getDocumentBySlug($request::$get['slug']); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | die(json_encode($result)); |
| 407 | 407 | } else if ($relativeCmsUri == '/documents/delete-document' && isset($request::$get['slug'])) { |
| 408 | 408 | $this->storage->deleteDocumentBySlug($request::$get['slug']); |
| 409 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 409 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 410 | 410 | exit; |
| 411 | 411 | } |
| 412 | 412 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $this->parameters['mainNavClass'] = 'documents'; |
| 423 | 423 | if (isset($request::$post['title'], $request::$post['path'])) { |
| 424 | 424 | $this->storage->addDocumentFolder($request::$post); |
| 425 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 425 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 426 | 426 | exit; |
| 427 | 427 | } |
| 428 | 428 | } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get['slug'])) { |
@@ -435,11 +435,11 @@ discard block |
||
| 435 | 435 | array_pop($path); |
| 436 | 436 | $path = implode('/', $path); |
| 437 | 437 | |
| 438 | - $request::$get['path'] = '/' . $path; |
|
| 438 | + $request::$get['path'] = '/'.$path; |
|
| 439 | 439 | |
| 440 | 440 | if (isset($request::$post['title'], $request::$post['content'])) { |
| 441 | 441 | $this->storage->saveDocumentFolder($request::$post); |
| 442 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 442 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 443 | 443 | exit; |
| 444 | 444 | } |
| 445 | 445 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $this->parameters['folder'] = $folder; |
| 448 | 448 | } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get['slug'])) { |
| 449 | 449 | $this->storage->deleteDocumentFolderBySlug($request::$get['slug']); |
| 450 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/documents'); |
|
| 450 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/documents'); |
|
| 451 | 451 | exit; |
| 452 | 452 | } |
| 453 | 453 | } |
@@ -467,12 +467,12 @@ discard block |
||
| 467 | 467 | $this->parameters['mainNavClass'] = 'configuration'; |
| 468 | 468 | if (isset($_POST['username'])) { |
| 469 | 469 | $this->storage->addUser($request::$post); |
| 470 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 470 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 471 | 471 | exit; |
| 472 | 472 | } |
| 473 | 473 | } elseif ($relativeCmsUri == '/configuration/users/delete' && isset($request::$get['slug'])) { |
| 474 | 474 | $this->storage->deleteUserBySlug($request::$get['slug']); |
| 475 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 475 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 476 | 476 | exit; |
| 477 | 477 | } elseif ($relativeCmsUri == '/configuration/users/edit' && isset($request::$get['slug'])) { |
| 478 | 478 | $this->subTemplate = 'cms/configuration/users-form'; |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | $this->parameters['user'] = $this->storage->getUserBySlug($request::$get['slug']); |
| 481 | 481 | if (isset($_POST['username'])) { |
| 482 | 482 | $this->storage->saveUser($request::$get['slug'], $request::$post); |
| 483 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/users'); |
|
| 483 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/users'); |
|
| 484 | 484 | exit; |
| 485 | 485 | } |
| 486 | 486 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $bricks = $this->storage->getBricks(); |
| 503 | 503 | if (isset($request::$post['title'])) { |
| 504 | 504 | $this->storage->addDocumentType($request::$post); |
| 505 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 505 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 506 | 506 | exit; |
| 507 | 507 | } |
| 508 | 508 | $this->parameters['bricks'] = $bricks; |
@@ -513,14 +513,14 @@ discard block |
||
| 513 | 513 | $bricks = $this->storage->getBricks(); |
| 514 | 514 | if (isset($request::$post['title'])) { |
| 515 | 515 | $this->storage->saveDocumentType($request::$get['slug'], $request::$post); |
| 516 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 516 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 517 | 517 | exit; |
| 518 | 518 | } |
| 519 | 519 | $this->parameters['documentType'] = $documentType; |
| 520 | 520 | $this->parameters['bricks'] = $bricks; |
| 521 | 521 | } elseif ($relativeCmsUri == '/configuration/document-types/delete' && isset($request::$get['slug'])) { |
| 522 | 522 | $this->storage->deleteDocumentTypeBySlug($request::$get['slug']); |
| 523 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/document-types'); |
|
| 523 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/document-types'); |
|
| 524 | 524 | exit; |
| 525 | 525 | } |
| 526 | 526 | } |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $this->parameters['mainNavClass'] = 'configuration'; |
| 541 | 541 | if (isset($request::$post['title'])) { |
| 542 | 542 | $this->storage->addBrick($request::$post); |
| 543 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 543 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 544 | 544 | exit; |
| 545 | 545 | } |
| 546 | 546 | } elseif ($relativeCmsUri == '/configuration/bricks/edit' && isset($request::$get['slug'])) { |
@@ -549,13 +549,13 @@ discard block |
||
| 549 | 549 | $brick = $this->storage->getBrickBySlug($request::$get['slug']); |
| 550 | 550 | if (isset($request::$post['title'])) { |
| 551 | 551 | $this->storage->saveBrick($request::$get['slug'], $request::$post); |
| 552 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 552 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 553 | 553 | exit; |
| 554 | 554 | } |
| 555 | 555 | $this->parameters['brick'] = $brick; |
| 556 | 556 | } elseif ($relativeCmsUri == '/configuration/bricks/delete' && isset($request::$get['slug'])) { |
| 557 | 557 | $this->storage->deleteBrickBySlug($request::$get['slug']); |
| 558 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/bricks'); |
|
| 558 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/bricks'); |
|
| 559 | 559 | exit; |
| 560 | 560 | } elseif ($relativeCmsUri == '/configuration/image-set') { |
| 561 | 561 | $this->subTemplate = 'cms/configuration/image-set'; |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $imageSet = $this->storage->getImageSetBySlug($request::$get['slug']); |
| 581 | 581 | if (isset($request::$post['title'])) { |
| 582 | 582 | $this->storage->saveImageSet($request::$get['slug'], $request::$post); |
| 583 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 583 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 584 | 584 | exit; |
| 585 | 585 | } |
| 586 | 586 | $this->parameters['imageSet'] = $imageSet; |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | $this->parameters['mainNavClass'] = 'configuration'; |
| 590 | 590 | if (isset($request::$post['title'])) { |
| 591 | 591 | $this->storage->addImageSet($request::$post); |
| 592 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 592 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 593 | 593 | exit; |
| 594 | 594 | } |
| 595 | 595 | } elseif ($relativeCmsUri == '/configuration/image-set/delete' && isset($request::$get['slug'])) { |
| 596 | 596 | $this->storage->deleteImageSetBySlug($request::$get['slug']); |
| 597 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/image-set'); |
|
| 597 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/image-set'); |
|
| 598 | 598 | exit; |
| 599 | 599 | } |
| 600 | 600 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | $this->parameters['mainNavClass'] = 'configuration'; |
| 615 | 615 | if (isset($request::$post['title'])) { |
| 616 | 616 | $this->storage->addApplicationComponent($request::$post); |
| 617 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/application-components'); |
|
| 617 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/application-components'); |
|
| 618 | 618 | exit; |
| 619 | 619 | } |
| 620 | 620 | } elseif ($relativeCmsUri == '/configuration/application-components/edit' && isset($request::$get['slug'])) { |
@@ -623,13 +623,13 @@ discard block |
||
| 623 | 623 | $applicationComponent = $this->storage->getApplicationComponentBySlug($request::$get['slug']); |
| 624 | 624 | if (isset($request::$post['title'])) { |
| 625 | 625 | $this->storage->saveApplicationComponent($request::$get['slug'], $request::$post); |
| 626 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/application-components'); |
|
| 626 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/application-components'); |
|
| 627 | 627 | exit; |
| 628 | 628 | } |
| 629 | 629 | $this->parameters['applicationComponent'] = $applicationComponent; |
| 630 | 630 | } elseif ($relativeCmsUri == '/configuration/application-components/delete' && isset($request::$get['slug'])) { |
| 631 | 631 | $this->storage->deleteApplicationComponentBySlug($request::$get['slug']); |
| 632 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix'] . '/configuration/application-components'); |
|
| 632 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix'].'/configuration/application-components'); |
|
| 633 | 633 | exit; |
| 634 | 634 | } |
| 635 | 635 | } |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | if ($relativeCmsUri == '/log-off') { |
| 640 | 640 | $_SESSION['cloudcontrol'] = null; |
| 641 | 641 | unset($_SESSION['cloudcontrol']); |
| 642 | - header('Location: ' . $request::$subfolders . $this->parameters['cmsPrefix']); |
|
| 642 | + header('Location: '.$request::$subfolders.$this->parameters['cmsPrefix']); |
|
| 643 | 643 | exit; |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script> |
| 4 | 4 | <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"> |
| 5 | 5 | <script>var smallestImage = '<?=$smallestImage?>';</script> |
| 6 | -<?$copyable=''?> |
|
| 6 | +<?$copyable = ''?> |
|
| 7 | 7 | <section class="documents"> |
| 8 | 8 | <h2><i class="fa fa-file-text-o"></i> Documents</h2> |
| 9 | 9 | <nav class="actions"> |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | </div> |
| 24 | 24 | </li> |
| 25 | 25 | </ul> |
| 26 | - <?include('document-form-form.php');?> |
|
| 26 | + <?include('document-form-form.php'); ?> |
|
| 27 | 27 | </section> |
| 28 | 28 | |
| 29 | 29 | <script> |