@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class DocumentRouting implements CmsRouting |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * DocumentRouting constructor. |
|
| 17 | - * @param $request |
|
| 18 | - * @param $relativeCmsUri |
|
| 19 | - * @param CmsComponent $cmsComponent |
|
| 20 | - */ |
|
| 21 | - public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 22 | - { |
|
| 23 | - if ($relativeCmsUri == '/documents') { |
|
| 24 | - $cmsComponent->subTemplate = 'cms/documents'; |
|
| 25 | - $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()->getDocumentsWithState()); |
|
| 26 | - $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
|
| 27 | - } |
|
| 28 | - $this->documentRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 29 | - $this->folderRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @param $request |
|
| 35 | - * @param $relativeCmsUri |
|
| 36 | - * @param CmsComponent $cmsComponent |
|
| 37 | - * @throws \Exception |
|
| 38 | - */ |
|
| 39 | - private function documentRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 40 | - { |
|
| 15 | + /** |
|
| 16 | + * DocumentRouting constructor. |
|
| 17 | + * @param $request |
|
| 18 | + * @param $relativeCmsUri |
|
| 19 | + * @param CmsComponent $cmsComponent |
|
| 20 | + */ |
|
| 21 | + public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
| 22 | + { |
|
| 23 | + if ($relativeCmsUri == '/documents') { |
|
| 24 | + $cmsComponent->subTemplate = 'cms/documents'; |
|
| 25 | + $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()->getDocumentsWithState()); |
|
| 26 | + $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
|
| 27 | + } |
|
| 28 | + $this->documentRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 29 | + $this->folderRouting($request, $relativeCmsUri, $cmsComponent); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @param $request |
|
| 35 | + * @param $relativeCmsUri |
|
| 36 | + * @param CmsComponent $cmsComponent |
|
| 37 | + * @throws \Exception |
|
| 38 | + */ |
|
| 39 | + private function documentRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 40 | + { |
|
| 41 | 41 | if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
| 42 | 42 | $this->documentNewRoute($request, $cmsComponent); |
| 43 | 43 | } elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){ |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | case '/documents/unpublish-document': $this->unpublishDocumentRoute($request, $cmsComponent); break; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - } |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @param $request |
|
| 56 | - * @param $relativeCmsUri |
|
| 57 | - * @param CmsComponent $cmsComponent |
|
| 58 | - */ |
|
| 59 | - private function folderRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 60 | - { |
|
| 61 | - if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @param $request |
|
| 56 | + * @param $relativeCmsUri |
|
| 57 | + * @param CmsComponent $cmsComponent |
|
| 58 | + */ |
|
| 59 | + private function folderRouting($request, $relativeCmsUri, $cmsComponent) |
|
| 60 | + { |
|
| 61 | + if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
|
| 62 | 62 | $this->newFolderRoute($request, $cmsComponent); |
| 63 | - } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 63 | + } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 64 | 64 | $this->editFolderRoute($request, $cmsComponent); |
| 65 | - } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 65 | + } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
|
| 66 | 66 | $this->deleteFolderRoute($request, $cmsComponent); |
| 67 | - } |
|
| 68 | - } |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * @param $request |
@@ -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 | <?}?> |