@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | if (in_array($name, $this->fileBasedSubsets)) { |
107 | 107 | return $this->$name; |
108 | 108 | } else { |
109 | - throw new \Exception('Trying to get undefined property from Repository: ' . $name); |
|
109 | + throw new \Exception('Trying to get undefined property from Repository: '.$name); |
|
110 | 110 | } |
111 | 111 | } else { |
112 | 112 | if (in_array($name, $this->fileBasedSubsets)) { |
113 | 113 | return $this->loadSubset($name); |
114 | 114 | } else { |
115 | - throw new \Exception('Trying to get undefined property from Repository: ' . $name); |
|
115 | + throw new \Exception('Trying to get undefined property from Repository: '.$name); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | { |
128 | 128 | if (in_array($name, $this->fileBasedSubsets)) { |
129 | 129 | $this->$name = $value; |
130 | - $changes = $name . 'Changes'; |
|
130 | + $changes = $name.'Changes'; |
|
131 | 131 | $this->$changes = true; |
132 | 132 | } else { |
133 | - throw new \Exception('Trying to persist unknown subset in repository: ' . $name . ' <br /><pre>' . print_r($value, true) . '</pre>'); |
|
133 | + throw new \Exception('Trying to persist unknown subset in repository: '.$name.' <br /><pre>'.print_r($value, true).'</pre>'); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function save() |
141 | 141 | { |
142 | - array_map(function ($value) { |
|
142 | + array_map(function($value) { |
|
143 | 143 | $this->saveSubset($value); |
144 | 144 | }, $this->fileBasedSubsets); |
145 | 145 | } |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | */ |
151 | 151 | protected function saveSubset($subset) |
152 | 152 | { |
153 | - $changes = $subset . 'Changes'; |
|
153 | + $changes = $subset.'Changes'; |
|
154 | 154 | if ($this->$changes === true) { |
155 | 155 | $json = json_encode($this->$subset, JSON_PRETTY_PRINT); |
156 | - $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; |
|
156 | + $subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json'; |
|
157 | 157 | file_put_contents($subsetStoragePath, $json); |
158 | 158 | |
159 | 159 | $this->$changes = false; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | protected function loadSubset($subset) |
169 | 169 | { |
170 | - $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json'; |
|
170 | + $subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json'; |
|
171 | 171 | $json = file_get_contents($subsetStoragePath); |
172 | 172 | $json = json_decode($json); |
173 | 173 | $this->$subset = $json; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public function getContentDbHandle() |
216 | 216 | { |
217 | 217 | if ($this->contentDbHandle === null) { |
218 | - $this->contentDbHandle = new \PDO('sqlite:' . $this->storagePath . DIRECTORY_SEPARATOR . 'content.db'); |
|
218 | + $this->contentDbHandle = new \PDO('sqlite:'.$this->storagePath.DIRECTORY_SEPARATOR.'content.db'); |
|
219 | 219 | } |
220 | 220 | return $this->contentDbHandle; |
221 | 221 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | public function getDocuments($state = 'published') |
232 | 232 | { |
233 | 233 | if (!in_array($state, Document::$DOCUMENT_STATES)) { |
234 | - throw new \Exception('Unsupported document state: ' . $state); |
|
234 | + throw new \Exception('Unsupported document state: '.$state); |
|
235 | 235 | } |
236 | 236 | return $this->getDocumentsByPath('/', $state); |
237 | 237 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | public function getDocumentsWithState($folderPath = '/') |
240 | 240 | { |
241 | 241 | $db = $this->getContentDbHandle(); |
242 | - $folderPathWithWildcard = $folderPath . '%'; |
|
242 | + $folderPathWithWildcard = $folderPath.'%'; |
|
243 | 243 | |
244 | 244 | $ifRootIndex = 1; |
245 | 245 | if ($folderPath == '/') { |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | FROM documents_unpublished |
255 | 255 | LEFT JOIN documents_published |
256 | 256 | ON documents_published.path = documents_unpublished.path |
257 | - WHERE documents_unpublished.`path` LIKE ' . $db->quote($folderPathWithWildcard) . ' |
|
258 | - AND substr(documents_unpublished.`path`, ' . (strlen($folderPath) + $ifRootIndex + 1) . ') NOT LIKE "%/%" |
|
259 | - AND length(documents_unpublished.`path`) > ' . (strlen($folderPath) + $ifRootIndex) . ' |
|
260 | - AND documents_unpublished.path != ' . $db->quote($folderPath) . ' |
|
257 | + WHERE documents_unpublished.`path` LIKE ' . $db->quote($folderPathWithWildcard).' |
|
258 | + AND substr(documents_unpublished.`path`, ' . (strlen($folderPath) + $ifRootIndex + 1).') NOT LIKE "%/%" |
|
259 | + AND length(documents_unpublished.`path`) > ' . (strlen($folderPath) + $ifRootIndex).' |
|
260 | + AND documents_unpublished.path != ' . $db->quote($folderPath).' |
|
261 | 261 | ORDER BY documents_unpublished.`type` DESC, documents_unpublished.`path` ASC |
262 | 262 | '; |
263 | 263 | $stmt = $this->getDbStatement($sql); |
@@ -284,16 +284,16 @@ discard block |
||
284 | 284 | public function getDocumentsByPath($folderPath, $state = 'published') |
285 | 285 | { |
286 | 286 | if (!in_array($state, Document::$DOCUMENT_STATES)) { |
287 | - throw new \Exception('Unsupported document state: ' . $state); |
|
287 | + throw new \Exception('Unsupported document state: '.$state); |
|
288 | 288 | } |
289 | 289 | $db = $this->getContentDbHandle(); |
290 | - $folderPathWithWildcard = $folderPath . '%'; |
|
290 | + $folderPathWithWildcard = $folderPath.'%'; |
|
291 | 291 | |
292 | 292 | $sql = 'SELECT * |
293 | - FROM documents_' . $state . ' |
|
294 | - WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard) . ' |
|
295 | - AND substr(`path`, ' . (strlen($folderPath) + 1) . ') NOT LIKE "%/%" |
|
296 | - AND path != ' . $db->quote($folderPath) . ' |
|
293 | + FROM documents_' . $state.' |
|
294 | + WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard).' |
|
295 | + AND substr(`path`, ' . (strlen($folderPath) + 1).') NOT LIKE "%/%" |
|
296 | + AND path != ' . $db->quote($folderPath).' |
|
297 | 297 | ORDER BY `type` DESC, `path` ASC'; |
298 | 298 | $stmt = $this->getDbStatement($sql); |
299 | 299 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | if ($containerPath === '/') { |
321 | 321 | return $this->getRootFolder(); |
322 | 322 | } |
323 | - if (substr($containerPath, -1) === '/'){ |
|
323 | + if (substr($containerPath, -1) === '/') { |
|
324 | 324 | $containerPath = substr($containerPath, 0, -1); |
325 | 325 | } |
326 | 326 | $containerFolder = $this->getDocumentByPath($containerPath, 'unpublished'); |
@@ -337,13 +337,13 @@ discard block |
||
337 | 337 | public function getDocumentByPath($path, $state = 'published') |
338 | 338 | { |
339 | 339 | if (!in_array($state, Document::$DOCUMENT_STATES)) { |
340 | - throw new \Exception('Unsupported document state: ' . $state); |
|
340 | + throw new \Exception('Unsupported document state: '.$state); |
|
341 | 341 | } |
342 | 342 | $db = $this->getContentDbHandle(); |
343 | 343 | $document = $this->fetchDocument(' |
344 | 344 | SELECT * |
345 | - FROM documents_' . $state . ' |
|
346 | - WHERE path = ' . $db->quote($path) . ' |
|
345 | + FROM documents_' . $state.' |
|
346 | + WHERE path = ' . $db->quote($path).' |
|
347 | 347 | '); |
348 | 348 | if ($document instanceof Document && $document->type === 'folder') { |
349 | 349 | $document->dbHandle = $db; |
@@ -363,16 +363,16 @@ discard block |
||
363 | 363 | public function getTotalDocumentCount($state = 'published') |
364 | 364 | { |
365 | 365 | if (!in_array($state, Document::$DOCUMENT_STATES)) { |
366 | - throw new \Exception('Unsupported document state: ' . $state); |
|
366 | + throw new \Exception('Unsupported document state: '.$state); |
|
367 | 367 | } |
368 | 368 | $db = $this->getContentDbHandle(); |
369 | 369 | $stmt = $db->query(' |
370 | 370 | SELECT count(*) |
371 | - FROM documents_' . $state . ' |
|
371 | + FROM documents_' . $state.' |
|
372 | 372 | WHERE `type` != "folder" |
373 | 373 | '); |
374 | 374 | $result = $stmt->fetch(\PDO::FETCH_ASSOC); |
375 | - if (!is_array($result )) { |
|
375 | + if (!is_array($result)) { |
|
376 | 376 | return 0; |
377 | 377 | } |
378 | 378 | return intval(current($result)); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | if ($stmt === false || !$stmt->execute()) { |
392 | 392 | $errorInfo = $db->errorInfo(); |
393 | 393 | $errorMsg = $errorInfo[2]; |
394 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
394 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
395 | 395 | } |
396 | 396 | return $result; |
397 | 397 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $sql = ' |
402 | 402 | INSERT OR REPLACE INTO documents_published |
403 | 403 | (`id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`publicationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`) |
404 | - SELECT `id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,"published" as state,`lastModificationDate`,`creationDate`,' . time() . ' as publicationDate, `lastModifiedBy`,`fields`,`bricks`,`dynamicBricks` |
|
404 | + SELECT `id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,"published" as state,`lastModificationDate`,`creationDate`,' . time().' as publicationDate, `lastModifiedBy`,`fields`,`bricks`,`dynamicBricks` |
|
405 | 405 | FROM documents_unpublished |
406 | 406 | WHERE `path` = :path |
407 | 407 | '; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | if ($stmt === false) { |
415 | 415 | $errorInfo = $db->errorInfo(); |
416 | 416 | $errorMsg = $errorInfo[2]; |
417 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
417 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
418 | 418 | } |
419 | 419 | $stmt->bindValue(':path', $path); |
420 | 420 | $stmt->execute(); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | if ($stmt === false) { |
482 | 482 | $errorInfo = $db->errorInfo(); |
483 | 483 | $errorMsg = $errorInfo[2]; |
484 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
484 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
485 | 485 | } |
486 | 486 | return $stmt; |
487 | 487 | } |
@@ -511,25 +511,25 @@ discard block |
||
511 | 511 | public function saveDocument($documentObject, $state = 'published') |
512 | 512 | { |
513 | 513 | if (!in_array($state, Document::$DOCUMENT_STATES)) { |
514 | - throw new \Exception('Unsupported document state: ' . $state); |
|
514 | + throw new \Exception('Unsupported document state: '.$state); |
|
515 | 515 | } |
516 | 516 | $db = $this->getContentDbHandle(); |
517 | 517 | $stmt = $this->getDbStatement(' |
518 | - INSERT OR REPLACE INTO documents_' . $state . ' (`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`) |
|
518 | + INSERT OR REPLACE INTO documents_' . $state.' (`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`) |
|
519 | 519 | VALUES( |
520 | - ' . $db->quote($documentObject->path) . ', |
|
521 | - ' . $db->quote($documentObject->title) . ', |
|
522 | - ' . $db->quote($documentObject->slug) . ', |
|
523 | - ' . $db->quote($documentObject->type) . ', |
|
524 | - ' . $db->quote($documentObject->documentType) . ', |
|
525 | - ' . $db->quote($documentObject->documentTypeSlug) . ', |
|
526 | - ' . $db->quote($documentObject->state) . ', |
|
527 | - ' . $db->quote($documentObject->lastModificationDate) . ', |
|
528 | - ' . $db->quote($documentObject->creationDate) . ', |
|
529 | - ' . $db->quote($documentObject->lastModifiedBy) . ', |
|
530 | - ' . $db->quote(json_encode($documentObject->fields)) . ', |
|
531 | - ' . $db->quote(json_encode($documentObject->bricks)) . ', |
|
532 | - ' . $db->quote(json_encode($documentObject->dynamicBricks)) . ' |
|
520 | + ' . $db->quote($documentObject->path).', |
|
521 | + ' . $db->quote($documentObject->title).', |
|
522 | + ' . $db->quote($documentObject->slug).', |
|
523 | + ' . $db->quote($documentObject->type).', |
|
524 | + ' . $db->quote($documentObject->documentType).', |
|
525 | + ' . $db->quote($documentObject->documentTypeSlug).', |
|
526 | + ' . $db->quote($documentObject->state).', |
|
527 | + ' . $db->quote($documentObject->lastModificationDate).', |
|
528 | + ' . $db->quote($documentObject->creationDate).', |
|
529 | + ' . $db->quote($documentObject->lastModifiedBy).', |
|
530 | + ' . $db->quote(json_encode($documentObject->fields)).', |
|
531 | + ' . $db->quote(json_encode($documentObject->bricks)).', |
|
532 | + ' . $db->quote(json_encode($documentObject->dynamicBricks)).' |
|
533 | 533 | ) |
534 | 534 | '); |
535 | 535 | $result = $stmt->execute(); |
@@ -553,16 +553,16 @@ discard block |
||
553 | 553 | if ($documentToDelete->type == 'document') { |
554 | 554 | $stmt = $this->getDbStatement(' |
555 | 555 | DELETE FROM documents_unpublished |
556 | - WHERE path = ' . $db->quote($path) . ' |
|
556 | + WHERE path = ' . $db->quote($path).' |
|
557 | 557 | '); |
558 | 558 | $stmt->execute(); |
559 | 559 | } elseif ($documentToDelete->type == 'folder') { |
560 | - $folderPathWithWildcard = $path . '%'; |
|
560 | + $folderPathWithWildcard = $path.'%'; |
|
561 | 561 | $stmt = $this->getDbStatement(' |
562 | 562 | DELETE FROM documents_unpublished |
563 | - WHERE (path LIKE ' . $db->quote($folderPathWithWildcard) . ' |
|
564 | - AND substr(`path`, ' . (strlen($path) + 1) . ', 1) = "/") |
|
565 | - OR path = ' . $db->quote($path) . ' |
|
563 | + WHERE (path LIKE ' . $db->quote($folderPathWithWildcard).' |
|
564 | + AND substr(`path`, ' . (strlen($path) + 1).', 1) = "/") |
|
565 | + OR path = ' . $db->quote($path).' |
|
566 | 566 | '); |
567 | 567 | $stmt->execute(); |
568 | 568 | } |
@@ -4,9 +4,9 @@ discard block |
||
4 | 4 | </div> |
5 | 5 | <label><?=$brick->title?></label> |
6 | 6 | <?if ($static == true) { |
7 | - $fieldPrefix = 'bricks[' . $myBrickSlug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . '][fields]'; |
|
7 | + $fieldPrefix = 'bricks['.$myBrickSlug.']['.str_replace('.', '', str_replace(' ', '', microtime())).'][fields]'; |
|
8 | 8 | } else { |
9 | - $fieldPrefix = 'dynamicBricks[' . $brick->slug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . ']'; |
|
9 | + $fieldPrefix = 'dynamicBricks['.$brick->slug.']['.str_replace('.', '', str_replace(' ', '', microtime())).']'; |
|
10 | 10 | }?> |
11 | 11 | <? foreach ($brick->fields as $field) : ?> |
12 | 12 | <div class="form-element"> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
32 | 32 | <div class="form-element"> |
33 | 33 | <? endif ?> |
34 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
34 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
35 | 35 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
36 | 36 | |
37 | 37 | </div> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | <li class="grid-container"> |
54 | 54 | <div class="grid-box-10"> |
55 | 55 | <div class="grid-inner form-element"> |
56 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
56 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | <div class="grid-box-2"> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | </div> |
64 | 64 | </div> |
65 | 65 | </li> |
66 | - <?$value='';?> |
|
66 | + <?$value = ''; ?> |
|
67 | 67 | <? endforeach ?> |
68 | 68 | <? endif ?> |
69 | 69 | </ul> |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | <a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a> |
81 | 81 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
82 | 82 | <div class="form-element"> |
83 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
83 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
84 | 84 | </div> |
85 | 85 | </li> |
86 | - <?$value='';?> |
|
86 | + <?$value = ''; ?> |
|
87 | 87 | <? endforeach ?> |
88 | 88 | <? endif ?> |
89 | 89 | </div> |
@@ -92,5 +92,5 @@ discard block |
||
92 | 92 | <a class="btn js-addrtemultiple">+</a> |
93 | 93 | <? endif ?> |
94 | 94 | </div> |
95 | - <?$value='';?> |
|
95 | + <?$value = ''; ?> |
|
96 | 96 | <? endforeach ?> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#' . $formId : '' ?>"> |
|
1 | +<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#'.$formId : '' ?>"> |
|
2 | 2 | <? if (!isset($hideTitleAndState)) : ?> |
3 | 3 | <input type="hidden" name="path" value="<?=$request::$get['path']?>" /> |
4 | 4 | <? else : ?> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" /> |
18 | 18 | </div> |
19 | 19 | <? endif ?> |
20 | - <?$fieldPrefix='fields';?> |
|
20 | + <?$fieldPrefix = 'fields'; ?> |
|
21 | 21 | <? foreach ($documentType->fields as $field) : ?> |
22 | 22 | <div class="form-element"> |
23 | 23 | <label for="<?=$field->slug?>"><?=$field->title?></label> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
42 | 42 | <div class="form-element"> |
43 | 43 | <? endif ?> |
44 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
44 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
45 | 45 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
46 | 46 | |
47 | 47 | </div> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | <li class="grid-container"> |
64 | 64 | <div class="grid-box-10"> |
65 | 65 | <div class="grid-inner form-element"> |
66 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
66 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
67 | 67 | </div> |
68 | 68 | </div> |
69 | 69 | <div class="grid-box-2"> |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | </div> |
74 | 74 | </div> |
75 | 75 | </li> |
76 | - <?$value='';?> |
|
76 | + <?$value = ''; ?> |
|
77 | 77 | <? endforeach ?> |
78 | 78 | <? endif ?> |
79 | 79 | </ul> |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | <a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a> |
91 | 91 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
92 | 92 | <div class="form-element"> |
93 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
93 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
94 | 94 | </div> |
95 | 95 | </li> |
96 | - <?$value='';?> |
|
96 | + <?$value = ''; ?> |
|
97 | 97 | <? endforeach ?> |
98 | 98 | <? endif ?> |
99 | 99 | </div> |
@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | <a class="btn js-addrtemultiple">+</a> |
103 | 103 | <? endif ?> |
104 | 104 | </div> |
105 | - <?$value='';?> |
|
105 | + <?$value = ''; ?> |
|
106 | 106 | <? endforeach ?> |
107 | 107 | <hr /> |
108 | - <? $static_brick_nr = 0;?> |
|
108 | + <? $static_brick_nr = 0; ?> |
|
109 | 109 | <? foreach ($documentType->bricks as $brick) : ?> |
110 | 110 | <div class="brick"> |
111 | 111 | <label><?=$brick->title?></label> |
112 | 112 | <? if ($brick->multiple == 'true') : ?> |
113 | 113 | <input type="hidden" value="<?=$brick->brickSlug?>"/> |
114 | 114 | <input type="hidden" value="<?=$brick->slug?>"/> |
115 | - <?$myBrickSlug=$brick->slug;?> |
|
115 | + <?$myBrickSlug = $brick->slug; ?> |
|
116 | 116 | <ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable"> |
117 | 117 | <? if (isset($document)) : ?> |
118 | 118 | <? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?> |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <li class="brick form-element"> |
127 | 127 | |
128 | 128 | <?$static = true; ?> |
129 | - <?include(__DIR__ . '/brick.php')?> |
|
129 | + <?include(__DIR__.'/brick.php')?> |
|
130 | 130 | </li> |
131 | 131 | <? endif ?> |
132 | 132 | <? endforeach ?> |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | <a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a> |
137 | 137 | <?$static_brick_nr += 1?> |
138 | 138 | <? else : ?> |
139 | - <?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?> |
|
139 | + <?$fieldPrefix = 'bricks['.$brick->slug.'][fields]'; ?> |
|
140 | 140 | <input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" /> |
141 | 141 | <? foreach ($brick->structure->fields as $field) : ?> |
142 | 142 | <div class="form-element"> |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
163 | 163 | <div class="form-element"> |
164 | 164 | <? endif ?> |
165 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
165 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
166 | 166 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
167 | 167 | |
168 | 168 | </div> |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | <li class="grid-container"> |
186 | 186 | <div class="grid-box-10"> |
187 | 187 | <div class="grid-inner form-element"> |
188 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
188 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
189 | 189 | </div> |
190 | 190 | </div> |
191 | 191 | <div class="grid-box-2"> |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | </div> |
196 | 196 | </div> |
197 | 197 | </li> |
198 | - <?$value='';?> |
|
198 | + <?$value = ''; ?> |
|
199 | 199 | <? endforeach ?> |
200 | 200 | <? endif ?> |
201 | 201 | </ul> |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | <a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a> |
214 | 214 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
215 | 215 | <div class="form-element"> |
216 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
216 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
217 | 217 | </div> |
218 | 218 | </li> |
219 | - <?$value='';?> |
|
219 | + <?$value = ''; ?> |
|
220 | 220 | <? endforeach ?> |
221 | 221 | <? endif ?> |
222 | 222 | </div> |
@@ -225,12 +225,12 @@ discard block |
||
225 | 225 | <a class="btn js-addrtemultiple">+</a> |
226 | 226 | <? endif ?> |
227 | 227 | </div> |
228 | - <?$value='';?> |
|
228 | + <?$value = ''; ?> |
|
229 | 229 | <? endforeach ?> |
230 | 230 | <? endif ?> |
231 | 231 | </div> |
232 | 232 | <hr /> |
233 | - <? endforeach;?> |
|
233 | + <? endforeach; ?> |
|
234 | 234 | |
235 | 235 | |
236 | 236 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | <li class="brick form-element"> |
254 | 254 | <label><?=$brick->title?></label> |
255 | 255 | <?$static = false; ?> |
256 | - <?include(__DIR__ . '/brick.php')?> |
|
256 | + <?include(__DIR__.'/brick.php')?> |
|
257 | 257 | </li> |
258 | 258 | <? endforeach ?> |
259 | 259 | <? endif ?> |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | * @param string $slugPrefix |
6 | 6 | * @param bool $root |
7 | 7 | */ |
8 | -function renderFolder($document, $cmsPrefix, $slugPrefix ='', $root = false) {?> |
|
8 | +function renderFolder($document, $cmsPrefix, $slugPrefix = '', $root = false) {?> |
|
9 | 9 | <div class="grid-box-8"> |
10 | 10 | <h3> |
11 | - <a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix . $document->slug?>" title="Open"> |
|
11 | + <a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix.$document->slug?>" title="Open"> |
|
12 | 12 | <i class="fa fa-folder-o "></i> <?=$document->title?> |
13 | 13 | </a> |
14 | 14 | </h3> |
@@ -16,21 +16,21 @@ discard block |
||
16 | 16 | <div class="documentActions grid-box-4"> |
17 | 17 | <?renderAction('Edit', |
18 | 18 | '', |
19 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-folder?slug=' . $slugPrefix . $document->slug, |
|
20 | - 'pencil');?> |
|
19 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-folder?slug='.$slugPrefix.$document->slug, |
|
20 | + 'pencil'); ?> |
|
21 | 21 | <?renderAction('Delete', |
22 | 22 | 'error', |
23 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-folder?slug=' . $slugPrefix . $document->slug, |
|
23 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-folder?slug='.$slugPrefix.$document->slug, |
|
24 | 24 | 'trash', |
25 | - 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
25 | + 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
26 | 26 | </div> |
27 | 27 | <ul class="documents grid-wrapper nested<?=$root ? ' root' : '' ?>"> |
28 | 28 | <? foreach ($document->content as $subDocument) : ?> |
29 | 29 | <li class="grid-container"> |
30 | 30 | <? if ($subDocument->type == 'document') : ?> |
31 | - <?renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?> |
|
31 | + <?renderDocument($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?> |
|
32 | 32 | <? elseif ($subDocument->type == 'folder') : ?> |
33 | - <?renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?> |
|
33 | + <?renderFolder($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?> |
|
34 | 34 | <? endif ?> |
35 | 35 | </li> |
36 | 36 | <? endforeach ?> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | function renderDocument($document, $cmsPrefix, $slugPrefix = '') {?> |
8 | 8 | <div class="grid-box-10"> |
9 | 9 | <h3> |
10 | - <a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit"> |
|
10 | + <a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix.$document->slug?>" title="Edit"> |
|
11 | 11 | <i class="fa fa-file-text-o"></i> |
12 | 12 | <small class="state <?=strtolower($document->state)?>"><i class="fa <?=$document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small> |
13 | 13 | <?=$document->title?> |
@@ -28,25 +28,25 @@ discard block |
||
28 | 28 | <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
29 | 29 | <?renderAction('Publish', |
30 | 30 | 'publish', |
31 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
32 | - 'check');?> |
|
31 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/publish-document?slug='.$slugPrefix.$document->slug, |
|
32 | + 'check'); ?> |
|
33 | 33 | <? endif ?> |
34 | 34 | <? if ($document->state == 'published') : ?> |
35 | 35 | <?renderAction('Unpublish', |
36 | 36 | 'unpublish', |
37 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
|
38 | - 'times');?> |
|
37 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/unpublish-document?slug='.$slugPrefix.$document->slug, |
|
38 | + 'times'); ?> |
|
39 | 39 | <? endif ?> |
40 | 40 | <?renderAction('Edit', |
41 | 41 | '', |
42 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
|
43 | - 'pencil');?> |
|
42 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-document?slug='.$slugPrefix.$document->slug, |
|
43 | + 'pencil'); ?> |
|
44 | 44 | <? if ($document->state == 'unpublished') : ?> |
45 | 45 | <?renderAction('Delete', |
46 | 46 | 'error', |
47 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
|
47 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-document?slug='.$slugPrefix.$document->slug, |
|
48 | 48 | 'trash', |
49 | - 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
49 | + 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
50 | 50 | <? endif ?> |
51 | 51 | </div> |
52 | 52 | <?}?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
43 | 43 | $this->documentNewRoute($request, $cmsComponent); |
44 | - } elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){ |
|
44 | + } elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
45 | 45 | switch ($relativeCmsUri) { |
46 | 46 | case '/documents/edit-document': $this->editDocumentRoute($request, $cmsComponent); break; |
47 | 47 | case '/documents/get-brick': $this->getBrickRoute($request, $cmsComponent); break; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if (isset($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE])) { |
96 | 96 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], $request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
97 | 97 | $cmsComponent->storage->getDocuments()->addDocument($request::$post); |
98 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
98 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
99 | 99 | exit; |
100 | 100 | } |
101 | 101 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], true)); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } else { |
104 | 104 | $documentTypes = $cmsComponent->storage->getDocumentTypes()->getDocumentTypes(); |
105 | 105 | if (count($documentTypes) < 1) { |
106 | - throw new \Exception('No Document Types defined yet. <a href="' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types/new">Please do so first.</a>'); |
|
106 | + throw new \Exception('No Document Types defined yet. <a href="'.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types/new">Please do so first.</a>'); |
|
107 | 107 | } |
108 | 108 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPES, $documentTypes); |
109 | 109 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug); |
121 | 121 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
122 | 122 | $cmsComponent->storage->getDocuments()->saveDocument($request::$post); |
123 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
123 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
124 | 124 | exit; |
125 | 125 | } |
126 | 126 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT, $cmsComponent->storage->getDocuments()->getDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG], 'unpublished')); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | private function deleteDocumentRoute($request, $cmsComponent) |
158 | 158 | { |
159 | 159 | $cmsComponent->storage->getDocuments()->deleteDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
160 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
160 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
161 | 161 | exit; |
162 | 162 | } |
163 | 163 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
172 | 172 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::GET_PARAMETER_PATH])) { |
173 | 173 | $cmsComponent->storage->addDocumentFolder($request::$post); |
174 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
174 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
175 | 175 | exit; |
176 | 176 | } |
177 | 177 | } |
@@ -190,11 +190,11 @@ discard block |
||
190 | 190 | array_pop($path); |
191 | 191 | $path = implode('/', $path); |
192 | 192 | |
193 | - $request::$get[CmsComponent::GET_PARAMETER_PATH] = '/' . $path; |
|
193 | + $request::$get[CmsComponent::GET_PARAMETER_PATH] = '/'.$path; |
|
194 | 194 | |
195 | 195 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post['content'])) { |
196 | 196 | $cmsComponent->storage->saveDocumentFolder($request::$post); |
197 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
197 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
198 | 198 | exit; |
199 | 199 | } |
200 | 200 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | private function deleteFolderRoute($request, $cmsComponent) |
210 | 210 | { |
211 | 211 | $cmsComponent->storage->deleteDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
212 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
212 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
213 | 213 | exit; |
214 | 214 | } |
215 | 215 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | private function publishDocumentRoute($request, $cmsComponent) |
221 | 221 | { |
222 | 222 | $cmsComponent->storage->publishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
223 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
223 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
224 | 224 | exit; |
225 | 225 | } |
226 | 226 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | private function unpublishDocumentRoute($request, $cmsComponent) |
232 | 232 | { |
233 | 233 | $cmsComponent->storage->unpublishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
234 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
234 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
235 | 235 | exit; |
236 | 236 | } |
237 | 237 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
249 | 249 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
250 | 250 | $cmsComponent->storage->getValuelists()->addValuelist($request::$post); |
251 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists'); |
|
251 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists'); |
|
252 | 252 | exit; |
253 | 253 | } |
254 | 254 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
262 | 262 | $cmsComponent->storage->getValuelists()->saveValuelist($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
263 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists'); |
|
263 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists'); |
|
264 | 264 | exit; |
265 | 265 | } |
266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | private function deleteValuelistRoute($request, $cmsComponent) |
272 | 272 | { |
273 | 273 | $cmsComponent->storage->getValuelists()->deleteValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
274 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists'); |
|
274 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists'); |
|
275 | 275 | exit; |
276 | 276 | } |
277 | 277 | } |
278 | 278 | \ No newline at end of file |