@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <? include('documents/function.renderAction.php'); ?> |
| 2 | 2 | <? include('documents/function.renderDocument.php'); ?> |
| 3 | 3 | <? include('documents/function.renderFolder.php'); ?> |
| 4 | -<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders . $cmsPrefix?>/documents?path=/');};</script> |
|
| 4 | +<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders.$cmsPrefix?>/documents?path=/');};</script> |
|
| 5 | 5 | <section class="documents"> |
| 6 | 6 | <h2><i class="fa fa-file-text-o"></i> Documents</h2> |
| 7 | 7 | <nav class="actions"> |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | <? foreach ($documents as $document) : ?> |
| 28 | 28 | <li class="grid-container"> |
| 29 | 29 | <? if ($document->type == 'document') : ?> |
| 30 | - <?renderDocument($document, $cmsPrefix);?> |
|
| 30 | + <?renderDocument($document, $cmsPrefix); ?> |
|
| 31 | 31 | <? elseif ($document->type == 'folder') : ?> |
| 32 | - <?renderFolder($document, $cmsPrefix, '', true);?> |
|
| 32 | + <?renderFolder($document, $cmsPrefix, '', true); ?> |
|
| 33 | 33 | <? endif ?> |
| 34 | 34 | </li> |
| 35 | 35 | <? endforeach ?> |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | <div class="documentActions grid-box-2"> |
| 22 | 22 | <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
| 23 | 23 | <?renderAction('Publish', |
| 24 | - 'publish', |
|
| 25 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 26 | - 'check');?> |
|
| 24 | + 'publish', |
|
| 25 | + \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 26 | + 'check');?> |
|
| 27 | 27 | <? endif ?> |
| 28 | 28 | <? if ($document->state == 'published') : ?> |
| 29 | 29 | <?renderAction('Unpublish', |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'error', |
| 41 | 41 | \library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
| 42 | 42 | 'trash', |
| 43 | - 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
| 43 | + 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
| 44 | 44 | <? endif ?> |
| 45 | 45 | </div> |
| 46 | 46 | <?}?> |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <? function renderDocument($document, $cmsPrefix, $slugPrefix = '') {?> |
| 2 | 2 | <div class="grid-box-10"> |
| 3 | 3 | <h3> |
| 4 | - <a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit"> |
|
| 4 | + <a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix.$document->slug?>" title="Edit"> |
|
| 5 | 5 | <i class="fa fa-file-text-o"></i> |
| 6 | 6 | <small class="state <?=strtolower($document->state)?>"><i class="fa <?=$document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small> |
| 7 | 7 | <?=$document->title?> |
@@ -22,25 +22,25 @@ discard block |
||
| 22 | 22 | <? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?> |
| 23 | 23 | <?renderAction('Publish', |
| 24 | 24 | 'publish', |
| 25 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug, |
|
| 26 | - 'check');?> |
|
| 25 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/publish-document?slug='.$slugPrefix.$document->slug, |
|
| 26 | + 'check'); ?> |
|
| 27 | 27 | <? endif ?> |
| 28 | 28 | <? if ($document->state == 'published') : ?> |
| 29 | 29 | <?renderAction('Unpublish', |
| 30 | 30 | 'unpublish', |
| 31 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug, |
|
| 32 | - 'times');?> |
|
| 31 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/unpublish-document?slug='.$slugPrefix.$document->slug, |
|
| 32 | + 'times'); ?> |
|
| 33 | 33 | <? endif ?> |
| 34 | 34 | <?renderAction('Edit', |
| 35 | 35 | '', |
| 36 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug, |
|
| 37 | - 'pencil');?> |
|
| 36 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-document?slug='.$slugPrefix.$document->slug, |
|
| 37 | + 'pencil'); ?> |
|
| 38 | 38 | <? if ($document->state == 'unpublished') : ?> |
| 39 | 39 | <?renderAction('Delete', |
| 40 | 40 | 'error', |
| 41 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug, |
|
| 41 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-document?slug='.$slugPrefix.$document->slug, |
|
| 42 | 42 | 'trash', |
| 43 | - 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
| 43 | + 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
| 44 | 44 | <? endif ?> |
| 45 | 45 | </div> |
| 46 | 46 | <?}?> |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | -<? function renderFolder($document, $cmsPrefix, $slugPrefix ='', $root = false) {?> |
|
| 1 | +<? function renderFolder($document, $cmsPrefix, $slugPrefix = '', $root = false) {?> |
|
| 2 | 2 | <div class="grid-box-8"> |
| 3 | 3 | <h3> |
| 4 | - <a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix . $document->slug?>" title="Open"> |
|
| 4 | + <a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix.$document->slug?>" title="Open"> |
|
| 5 | 5 | <i class="fa fa-folder-o "></i> <?=$document->title?> |
| 6 | 6 | </a> |
| 7 | 7 | </h3> |
@@ -9,21 +9,21 @@ discard block |
||
| 9 | 9 | <div class="documentActions grid-box-4"> |
| 10 | 10 | <?renderAction('Edit', |
| 11 | 11 | '', |
| 12 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-folder?slug=' . $slugPrefix . $document->slug, |
|
| 13 | - 'pencil');?> |
|
| 12 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-folder?slug='.$slugPrefix.$document->slug, |
|
| 13 | + 'pencil'); ?> |
|
| 14 | 14 | <?renderAction('Delete', |
| 15 | 15 | 'error', |
| 16 | - \library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-folder?slug=' . $slugPrefix . $document->slug, |
|
| 16 | + \library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-folder?slug='.$slugPrefix.$document->slug, |
|
| 17 | 17 | 'trash', |
| 18 | - 'return confirm(\'Are you sure you want to delete this document?\');');?> |
|
| 18 | + 'return confirm(\'Are you sure you want to delete this document?\');'); ?> |
|
| 19 | 19 | </div> |
| 20 | 20 | <ul class="documents grid-wrapper nested<?=$root ? ' root' : '' ?>"> |
| 21 | 21 | <? foreach ($document->content as $subDocument) : ?> |
| 22 | 22 | <li class="grid-container"> |
| 23 | 23 | <? if ($subDocument->type == 'document') : ?> |
| 24 | - <?renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?> |
|
| 24 | + <?renderDocument($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?> |
|
| 25 | 25 | <? elseif ($subDocument->type == 'folder') : ?> |
| 26 | - <?renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?> |
|
| 26 | + <?renderFolder($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?> |
|
| 27 | 27 | <? endif ?> |
| 28 | 28 | </li> |
| 29 | 29 | <? endforeach ?> |
@@ -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 | } |