@@ -1,7 +1,8 @@ discard block  | 
                                                    ||
| 1 | 1 | <form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?= isset($formId) ? '#' . $formId : '' ?>">  | 
                                                        
| 2 | 2 | <?php if (!isset($hideTitleAndState)) : ?>  | 
                                                        
| 3 | 3 | <input type="hidden" name="path" value="<?= $request::$get['path'] ?>"/>  | 
                                                        
| 4 | - <?php else : ?>  | 
                                                        |
| 4 | +    <?php else { | 
                                                        |
| 5 | + : ?>  | 
                                                        |
| 5 | 6 | <input type="hidden" name="formId" value="<?= $formId ?>"/>  | 
                                                        
| 6 | 7 | <a name="<?= $formId ?>"></a>  | 
                                                        
| 7 | 8 | <?php endif ?>  | 
                                                        
@@ -17,15 +18,19 @@ discard block  | 
                                                    ||
| 17 | 18 | <input required="required" value="<?=isset($document) ? $document->title : '' ?>"<?= isset($document, $document->title) && !empty($document->title) ? ' readonly="readonly"' : '' ?> type="text" id="title" name="title" placeholder="Title" />  | 
                                                        
| 18 | 19 | </div>  | 
                                                        
| 19 | 20 | <?php endif ?>  | 
                                                        
| 20 | - <?php $fieldPrefix='fields';?>  | 
                                                        |
| 21 | + <?php $fieldPrefix='fields';  | 
                                                        |
| 22 | +}  | 
                                                        |
| 23 | +?>  | 
                                                        |
| 21 | 24 | <?php foreach ($documentType->fields as $field) : ?>  | 
                                                        
| 22 | 25 | <div class="form-element">  | 
                                                        
| 23 | 26 | <label for="<?=$field->slug?>"><?=$field->title?></label>  | 
                                                        
| 24 | 27 | <?php if (isset($document)) :  | 
                                                        
| 25 | 28 | $fieldSlug = $field->slug;  | 
                                                        
| 26 | 29 | $value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';  | 
                                                        
| 27 | - else :  | 
                                                        |
| 30 | +					else { | 
                                                        |
| 31 | + :  | 
                                                        |
| 28 | 32 | $value = '';  | 
                                                        
| 33 | + }  | 
                                                        |
| 29 | 34 | endif ?>  | 
                                                        
| 30 | 35 | <?php if ($field->multiple == true && $field->type != 'Rich Text') : ?>  | 
                                                        
| 31 | 36 | <ul class="grid-wrapper sortable">  | 
                                                        
@@ -135,8 +140,11 @@ discard block  | 
                                                    ||
| 135 | 140 | </ul>  | 
                                                        
| 136 | 141 | <a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>  | 
                                                        
| 137 | 142 | <?php $static_brick_nr += 1?>  | 
                                                        
| 138 | - <?php else : ?>  | 
                                                        |
| 139 | - <?php $fieldPrefix='bricks[' . $brick->slug . '][fields]';?>  | 
                                                        |
| 143 | +				<?php else { | 
                                                        |
| 144 | + : ?>  | 
                                                        |
| 145 | + <?php $fieldPrefix='bricks[' . $brick->slug . '][fields]';  | 
                                                        |
| 146 | +}  | 
                                                        |
| 147 | +?>  | 
                                                        |
| 140 | 148 | <input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />  | 
                                                        
| 141 | 149 | <?php foreach ($brick->structure->fields as $field) : ?>  | 
                                                        
| 142 | 150 | <div class="form-element">  | 
                                                        
@@ -145,8 +153,10 @@ discard block  | 
                                                    ||
| 145 | 153 | $brickSlug = $brick->slug;  | 
                                                        
| 146 | 154 | $fieldSlug = $field->slug;  | 
                                                        
| 147 | 155 | $value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';  | 
                                                        
| 148 | - else :  | 
                                                        |
| 156 | +						else { | 
                                                        |
| 157 | + :  | 
                                                        |
| 149 | 158 | $value = '';  | 
                                                        
| 159 | + }  | 
                                                        |
| 150 | 160 | endif ?>  | 
                                                        
| 151 | 161 | <?php if ($field->multiple == true && $field->type != 'Rich Text') : ?>  | 
                                                        
| 152 | 162 | <ul class="grid-wrapper sortable">  | 
                                                        
@@ -260,7 +270,8 @@ discard block  | 
                                                    ||
| 260 | 270 | </ul>  | 
                                                        
| 261 | 271 | </div>  | 
                                                        
| 262 | 272 | <?php endif ?>  | 
                                                        
| 263 | - <?php else : ?>  | 
                                                        |
| 273 | +		<?php else { | 
                                                        |
| 274 | + : ?>  | 
                                                        |
| 264 | 275 | <div class="form-element">  | 
                                                        
| 265 | 276 | <label for="documentType">Document Type</label>  | 
                                                        
| 266 | 277 | <select id="documentType" name="documentType">  | 
                                                        
@@ -277,6 +288,8 @@ discard block  | 
                                                    ||
| 277 | 288 | <input class="btn" type="submit" name="btn_save_and_publish" value="Save and publish"/>  | 
                                                        
| 278 | 289 | <?php else : ?>  | 
                                                        
| 279 | 290 | <input class="btn" type="submit" value="Create"/>  | 
                                                        
| 280 | - <?php endif; ?>  | 
                                                        |
| 291 | + <?php endif;  | 
                                                        |
| 292 | +}  | 
                                                        |
| 293 | +?>  | 
                                                        |
| 281 | 294 | </div>  | 
                                                        
| 282 | 295 | </form>  | 
                                                        
| 283 | 296 | \ No newline at end of file  | 
                                                        
@@ -55,7 +55,7 @@  | 
                                                    ||
| 55 | 55 | */  | 
                                                        
| 56 | 56 | public function __toString()  | 
                                                        
| 57 | 57 |      { | 
                                                        
| 58 | - return (string)print_r(self::$instance, true);  | 
                                                        |
| 58 | + return (string) print_r(self::$instance, true);  | 
                                                        |
| 59 | 59 | }  | 
                                                        
| 60 | 60 | |
| 61 | 61 | /**  | 
                                                        
@@ -35,7 +35,7 @@  | 
                                                    ||
| 35 | 35 | */  | 
                                                        
| 36 | 36 | public function __toString()  | 
                                                        
| 37 | 37 |      { | 
                                                        
| 38 | - return (string)$this->filteredString;  | 
                                                        |
| 38 | + return (string) $this->filteredString;  | 
                                                        |
| 39 | 39 | }  | 
                                                        
| 40 | 40 | |
| 41 | 41 | /**  | 
                                                        
@@ -43,7 +43,7 @@  | 
                                                    ||
| 43 | 43 |      { | 
                                                        
| 44 | 44 |          if (!isset($this->set->{$imageVariant})) { | 
                                                        
| 45 | 45 |              throw new \Exception('Image variant `' . $imageVariant . '` does not exist. Existing variants are ' . implode(', ', | 
                                                        
| 46 | - array_keys((array)$this->set)));  | 
                                                        |
| 46 | + array_keys((array) $this->set)));  | 
                                                        |
| 47 | 47 | }  | 
                                                        
| 48 | 48 |          return Request::$subfolders . $this->imagePath . '/' . $this->set->{$imageVariant}; | 
                                                        
| 49 | 49 | }  | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem)  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | - $this->parameters = (array)$matchedSitemapItem->parameters;  | 
                                                        |
| 27 | + $this->parameters = (array) $matchedSitemapItem->parameters;  | 
                                                        |
| 28 | 28 |          $selfParameters = $this->getParametersForNameSpace('self'); | 
                                                        
| 29 | 29 | $this->parameters = array_merge($this->parameters, $selfParameters);  | 
                                                        
| 30 | 30 | parent::__construct($template, $request, $this->parameters, $matchedSitemapItem);  | 
                                                        
@@ -39,7 +39,7 @@ discard block  | 
                                                    ||
| 39 | 39 | */  | 
                                                        
| 40 | 40 | public function __construct($template, Request $request, $parameters, $matchedSitemapItem)  | 
                                                        
| 41 | 41 |      { | 
                                                        
| 42 | - $this->parameters = (array)$parameters;  | 
                                                        |
| 42 | + $this->parameters = (array) $parameters;  | 
                                                        |
| 43 | 43 | $this->checkParameters();  | 
                                                        
| 44 | 44 | |
| 45 | 45 | $lang = substr(isset($_SERVER[self::HTTP_ACCEPT_LANGUAGE]) ? $_SERVER[self::HTTP_ACCEPT_LANGUAGE] : self::$DEFAULT_LANGUAGE,  | 
                                                        
@@ -78,7 +78,7 @@ discard block  | 
                                                    ||
| 78 | 78 | unset($this->parameters[self::PARAMETER_LANGUAGE_PARAMETER_NAME]);  | 
                                                        
| 79 | 79 | }  | 
                                                        
| 80 | 80 |          if (isset($this->parameters[self::PARAMETER_FORCE_REDIRECT])) { | 
                                                        
| 81 | - $this->forceRedirect = (bool)$this->parameters[self::PARAMETER_FORCE_REDIRECT];  | 
                                                        |
| 81 | + $this->forceRedirect = (bool) $this->parameters[self::PARAMETER_FORCE_REDIRECT];  | 
                                                        |
| 82 | 82 | unset($this->parameters[self::PARAMETER_FORCE_REDIRECT]);  | 
                                                        
| 83 | 83 | }  | 
                                                        
| 84 | 84 | }  | 
                                                        
@@ -98,7 +98,7 @@  | 
                                                    ||
| 98 | 98 | $cacheExists = $this->cache !== false;  | 
                                                        
| 99 | 99 | $cacheExpired = false;  | 
                                                        
| 100 | 100 |              if ($cacheExists) { | 
                                                        
| 101 | - $cacheCreationStamp = (int)$this->cache->creationStamp;  | 
                                                        |
| 101 | + $cacheCreationStamp = (int) $this->cache->creationStamp;  | 
                                                        |
| 102 | 102 | $currentTime = time();  | 
                                                        
| 103 | 103 | $cacheAge = $currentTime - $cacheCreationStamp;  | 
                                                        
| 104 | 104 | $maxAgeInterval = new \DateInterval($this->maxAge);  | 
                                                        
@@ -47,7 +47,7 @@  | 
                                                    ||
| 47 | 47 |              if (preg_match('/\.(?:js|ico|txt|gif|jpg|jpeg|png|bmp|css|html|htm|php|pdf|exe|eot|svg|ttf|woff|ogg|mp3|xml|map|scss)$/', | 
                                                        
| 48 | 48 |                  $_SERVER['REQUEST_URI'])) { | 
                                                        
| 49 | 49 |                  if (file_exists($dir . $_SERVER["REQUEST_URI"])) { | 
                                                        
| 50 | - return true; // serve the requested resource as-is.  | 
                                                        |
| 50 | + return true; // serve the requested resource as-is.  | 
                                                        |
| 51 | 51 | }  | 
                                                        
| 52 | 52 | }  | 
                                                        
| 53 | 53 | }  | 
                                                        
@@ -24,7 +24,8 @@ discard block  | 
                                                    ||
| 24 | 24 | Search index is no longer in sync with documents.  | 
                                                        
| 25 | 25 | <a href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/search/update-index?returnUrl=<?= urlencode($request::$subfolders . $cmsPrefix . '/documents') ?>" title="Update Index">Update Index</a>  | 
                                                        
| 26 | 26 | </div>  | 
                                                        
| 27 | - <?php else : ?>  | 
                                                        |
| 27 | +      <?php else { | 
                                                        |
| 28 | + : ?>  | 
                                                        |
| 28 | 29 | <div class="message valid">  | 
                                                        
| 29 | 30 | <i class="fa fa-check"></i>  | 
                                                        
| 30 | 31 | Search index is in sync with documents.  | 
                                                        
@@ -56,7 +57,9 @@ discard block  | 
                                                    ||
| 56 | 57 | <?php foreach ($documents as $document) : ?>  | 
                                                        
| 57 | 58 | <li class="grid-container">  | 
                                                        
| 58 | 59 | <?php if ($document->type == 'document') : ?>  | 
                                                        
| 59 | - <?php renderDocument($document, $cmsPrefix, '', $request); ?>  | 
                                                        |
| 60 | + <?php renderDocument($document, $cmsPrefix, '', $request);  | 
                                                        |
| 61 | +}  | 
                                                        |
| 62 | +?>  | 
                                                        |
| 60 | 63 | <?php elseif ($document->type == 'folder') : ?>  | 
                                                        
| 61 | 64 | <?php renderFolder($document, $cmsPrefix, '', true, $request); ?>  | 
                                                        
| 62 | 65 | <?php endif ?>  |