diff --git a/CHANGELOG.md b/CHANGELOG.md index 741bff1..a65d5c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.0.0] - 16.09.2021 +### Added +- ILIAS 7 Support +### Removed +- ILIAS 5.4 is no longer supported + +### BREAKING CHANGES +- ILIAS 5.4 is no longer supported + ## [3.0.0] - 04.02.2021 ### Added - Link action for ILIAS object diff --git a/README.md b/README.md index 74b14b1..ba4cf2e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Learnplaces 2 is a ground up rewritten drop in replacement of the old learnplaces plugin. ## Requirements -* Version: ILIAS 5.4 or 6 -* PHP 7.0 - 7.4 +* Version: ILIAS 6 or 7 +* PHP 7.2 - 7.4 ### Compatibility Table |Plugin Version | ILIAS Versions | PHP Versions | @@ -12,6 +12,7 @@ the old learnplaces plugin. | v1.X | 5.2 - 5.3 | 7.0 | | v2.X | 5.3 - 5.4 | 7.0 - 7.2 | | v3.X | 5.4 - 6 | 7.0 - 7.4 | +| v4.X | 6 - 7 | 7.2 - 7.4 | ## Installation @@ -105,10 +106,10 @@ This project is licensed under the GNU GPLv3 License - see the LICENSE.md file f ## Contact -studer + raimann ag -Farbweg 9 +fluxlabs AG +Scheunenstrasse 19 3400 Burgdorf Switzerland -[info@studer-raimann.ch](mailto:info@studer-raimann.ch) - \ No newline at end of file +[connect@fluxlabs.ch](mailto:connect@fluxlabs.ch) + \ No newline at end of file diff --git a/classes/class.ilObjLearnplacesGUI.php b/classes/class.ilObjLearnplacesGUI.php index fdd16b7..e59e795 100644 --- a/classes/class.ilObjLearnplacesGUI.php +++ b/classes/class.ilObjLearnplacesGUI.php @@ -195,7 +195,7 @@ protected function performCommand(string $command) { * */ protected function setSubtabs() { - if (ilObjUdfEditorAccess::hasWriteAccess()) { + if ($this->accessGuard->hasWritePermission()) { $this->learnplaceTabs->addSubTab(self::SUBTAB_CONTENT, $this->lng->txt(self::SUBTAB_CONTENT), $this->ctrl->getLinkTarget($this)); if($this->accessGuard->hasWritePermission() && !$this->hasMap()) diff --git a/classes/gui/block/AccordionBlock/AccordionBlockEditFormView.php b/classes/gui/block/AccordionBlock/AccordionBlockEditFormView.php index d7046bd..2fbd67c 100644 --- a/classes/gui/block/AccordionBlock/AccordionBlockEditFormView.php +++ b/classes/gui/block/AccordionBlock/AccordionBlockEditFormView.php @@ -37,7 +37,7 @@ protected function hasBlockSpecificParts(): bool { /** * @inheritDoc */ - protected function initBlockSpecificForm() { + protected function initBlockSpecificForm(): void { $title = new ilTextInputGUI($this->plugin->txt('accordion_block_title'), self::POST_TITLE); $title->setMaxLength(256); $title->setRequired(true); diff --git a/classes/gui/block/AccordionBlock/AccordionBlockPresentationView.php b/classes/gui/block/AccordionBlock/AccordionBlockPresentationView.php index 4e3fd53..7c50751 100644 --- a/classes/gui/block/AccordionBlock/AccordionBlockPresentationView.php +++ b/classes/gui/block/AccordionBlock/AccordionBlockPresentationView.php @@ -69,7 +69,7 @@ public function __construct(ilLearnplacesPlugin $plugin, ilCtrl $controlFlow, Co $this->template = new ilTemplate('./Customizing/global/plugins/Services/Repository/RepositoryObject/Learnplaces/templates/default/block/tpl.accordion.html', true, true); } - private function initView() { + private function initView(): void { $this->contentView->setBlocks($this->model->getBlocks()); $this->contentView->setAccordionId($this->model->getId()); $this->contentView->setReadonly($this->isReadonly()); @@ -80,14 +80,14 @@ private function initView() { $this->template->setVariable('EXPANDED', $this->model->isExpand() ? 'in' : ''); } - public function setModel(AccordionBlockModel $model) { + public function setModel(AccordionBlockModel $model): void { $this->model = $model; } /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The accordion block view requires a model to render its content.'); diff --git a/classes/gui/block/AccordionBlock/class.xsrlAccordionBlockGUI.php b/classes/gui/block/AccordionBlock/class.xsrlAccordionBlockGUI.php index 78a62b0..39b4886 100644 --- a/classes/gui/block/AccordionBlock/class.xsrlAccordionBlockGUI.php +++ b/classes/gui/block/AccordionBlock/class.xsrlAccordionBlockGUI.php @@ -97,7 +97,7 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL } - public function executeCommand() + public function executeCommand(): bool { if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { @@ -131,7 +131,7 @@ public function executeCommand() return false; } - private function add() + private function add(): void { $this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM); @@ -144,7 +144,7 @@ private function add() $this->template->setContent($form->getHTML()); } - private function create() + private function create(): void { $form = new AccordionBlockEditFormView(new AccordionBlockModel()); try { @@ -179,7 +179,7 @@ private function create() } } - private function edit() + private function edit(): void { $block = $this->accordionService->find($this->getBlockId()); $form = new AccordionBlockEditFormView($block); @@ -187,7 +187,7 @@ private function edit() $this->template->setContent($form->getHTML()); } - private function update() + private function update(): void { $form = new AccordionBlockEditFormView(new AccordionBlockModel()); try { @@ -212,7 +212,7 @@ private function update() } } - private function delete() + private function delete(): void { $queries = $this->request->getQueryParams(); $blockId = intval($queries[self::BLOCK_ID_QUERY_KEY]); @@ -223,7 +223,7 @@ private function delete() $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } - private function confirm() + private function confirm(): void { $queries = $this->request->getQueryParams(); @@ -241,7 +241,7 @@ private function confirm() $this->template->setContent($confirm->getHTML()); } - private function cancel() + private function cancel(): void { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } @@ -252,7 +252,7 @@ private function getBlockId(): int return intval($queries[self::BLOCK_ID_QUERY_KEY]); } - private function regenerateSequence() + private function regenerateSequence(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); $this->learnplaceService->store($learnplace); diff --git a/classes/gui/block/IliasLinkBlock/IliasLinkBlockPresentationView.php b/classes/gui/block/IliasLinkBlock/IliasLinkBlockPresentationView.php index e888801..e42ef43 100644 --- a/classes/gui/block/IliasLinkBlock/IliasLinkBlockPresentationView.php +++ b/classes/gui/block/IliasLinkBlock/IliasLinkBlockPresentationView.php @@ -64,7 +64,7 @@ public function __construct(ilLearnplacesPlugin $plugin, ilCtrl $controlFlow) { $this->template = new ilTemplate('./Customizing/global/plugins/Services/Repository/RepositoryObject/Learnplaces/templates/default/block/tpl.ilias_link.html', true, true); } - private function initView() { + private function initView(): void { $objectId = ilObject::_lookupObjectId($this->model->getRefId()); @@ -73,7 +73,7 @@ private function initView() { $this->template->setVariable('DESCRIPTION', ilObject::_lookupDescription($objectId)); } - public function setModel(ILIASLinkBlockModel $model) { + public function setModel(ILIASLinkBlockModel $model): void { $this->model = $model; $this->initView(); } @@ -82,7 +82,7 @@ public function setModel(ILIASLinkBlockModel $model) { /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The picture block view requires a model to render its content.'); diff --git a/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockEditFormViewGUI.php b/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockEditFormViewGUI.php index ef1d7c7..1ba2f0e 100644 --- a/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockEditFormViewGUI.php +++ b/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockEditFormViewGUI.php @@ -31,7 +31,7 @@ protected function hasBlockSpecificParts(): bool { /** * @inheritDoc */ - protected function initBlockSpecificForm() { + protected function initBlockSpecificForm(): void { $link = new ilLinkInputGUI($this->plugin->txt('ilias_link_block_select_target'), self::POST_REFID); $link->setInternalLinkFilterTypes(['RepositoryItem']); $link->setRequired(true); @@ -64,11 +64,12 @@ protected function getFormActionUrl(): string { /** * @inheritDoc */ - protected function getObject() { + protected function getObject(): void { //raw value looks like "xsrl|74" $rawValue = $this->getInput(self::POST_REFID); $delimiter = '|'; - $lastElement = end(explode($delimiter, $rawValue)); + $values = explode($delimiter, $rawValue); + $lastElement = end($values); $this->block->setRefId(intval($lastElement)); } diff --git a/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockGUI.php b/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockGUI.php index 7f91c8e..6d957c6 100644 --- a/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockGUI.php +++ b/classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockGUI.php @@ -109,12 +109,9 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL } - public function executeCommand() + public function executeCommand(): bool { $next_class = $this->controlFlow->getNextClass(); - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); @@ -147,7 +144,7 @@ public function executeCommand() return false; } - private function add() + private function add(): void { $this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM); $this->controlFlow->saveParameter($this, PlusView::ACCORDION_QUERY_PARAM); @@ -162,7 +159,7 @@ private function add() $this->template->setContent($form->getHTML()); } - private function create() + private function create(): void { $form = new xsrlIliasLinkBlockEditFormViewGUI(new ILIASLinkBlockModel()); try { @@ -209,7 +206,7 @@ private function create() } } - private function edit() + private function edit(): void { $blockId = $this->getBlockId(); $block = $this->iliasLinkService->find($blockId); @@ -218,7 +215,7 @@ private function edit() $this->template->setContent($form->getHTML()); } - private function update() + private function update(): void { $form = new xsrlIliasLinkBlockEditFormViewGUI(new ILIASLinkBlockModel()); try { @@ -242,7 +239,7 @@ private function update() } } - private function delete() + private function delete(): void { $queries = $this->request->getQueryParams(); $blockId = intval($queries[self::BLOCK_ID_QUERY_KEY]); @@ -254,7 +251,7 @@ private function delete() $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } - private function confirm() + private function confirm(): void { $queries = $this->request->getQueryParams(); $confirm = new ilConfirmationGUI(); @@ -271,7 +268,7 @@ private function confirm() $this->template->setContent($confirm->getHTML()); } - private function cancel() + private function cancel(): void { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } @@ -282,7 +279,7 @@ private function getBlockId(): int return intval($queries[self::BLOCK_ID_QUERY_KEY]); } - private function regenerateSequence() + private function regenerateSequence(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); $this->learnplaceService->store($learnplace); diff --git a/classes/gui/block/MapBlock/MapBlockPresentationView.php b/classes/gui/block/MapBlock/MapBlockPresentationView.php index 1e51fbf..2f381fb 100644 --- a/classes/gui/block/MapBlock/MapBlockPresentationView.php +++ b/classes/gui/block/MapBlock/MapBlockPresentationView.php @@ -110,7 +110,7 @@ public function setModels(MapBlockModel $model, LocationModel $location, Configu /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The picture block view requires a model to render its content.'); diff --git a/classes/gui/block/MapBlock/class.xsrlMapBlockGUI.php b/classes/gui/block/MapBlock/class.xsrlMapBlockGUI.php index 90c5d3b..919c786 100644 --- a/classes/gui/block/MapBlock/class.xsrlMapBlockGUI.php +++ b/classes/gui/block/MapBlock/class.xsrlMapBlockGUI.php @@ -96,11 +96,8 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL } - public function executeCommand() { + public function executeCommand(): bool { - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); @@ -140,7 +137,7 @@ public function executeCommand() { return false; } - private function index() { + private function index(): void { try { /** @@ -161,7 +158,7 @@ private function index() { } } - private function add() { + private function add(): void { $this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM); $config = $this->configService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); @@ -173,7 +170,7 @@ private function add() { $this->template->setContent($form->getHTML()); } - private function create() { + private function create(): void { $form = new MapBlockEditFormView(new MapBlockModel()); try { $queries = $this->request->getQueryParams(); @@ -205,7 +202,7 @@ private function create() { } } - private function edit() { + private function edit(): void { $blockId = $this->getBlockId(); $block = $this->mapBlockService->find($blockId); $form = new MapBlockEditFormView($block); @@ -213,7 +210,7 @@ private function edit() { $this->template->setContent($form->getHTML()); } - private function update() { + private function update(): void { $form = new MapBlockEditFormView(new MapBlockModel()); try { @@ -236,7 +233,7 @@ private function update() { } } - private function delete() { + private function delete(): void { $blockId = $this->getBlockId(); $this->redirectInvalidRequests($blockId); $this->mapBlockService->delete($blockId); @@ -244,7 +241,7 @@ private function delete() { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } - private function confirm() { + private function confirm(): void { $queries = $this->request->getQueryParams(); $confirm = new ilConfirmationGUI(); $confirm->setHeaderText($this->plugin->txt('confirm_delete_header')); @@ -260,7 +257,7 @@ private function confirm() { $this->template->setContent($confirm->getHTML()); } - private function cancel() { + private function cancel(): void { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } diff --git a/classes/gui/block/PictureBlock/PictureBlockPresentationView.php b/classes/gui/block/PictureBlock/PictureBlockPresentationView.php index 25bc528..0576346 100644 --- a/classes/gui/block/PictureBlock/PictureBlockPresentationView.php +++ b/classes/gui/block/PictureBlock/PictureBlockPresentationView.php @@ -62,7 +62,7 @@ public function __construct(ilLearnplacesPlugin $plugin, ilCtrl $controlFlow) { $this->template = new ilTemplate('./Customizing/global/plugins/Services/Repository/RepositoryObject/Learnplaces/templates/default/block/tpl.picture.html', true, true); } - private function initView() { + private function initView(): void { $this->template->setVariable('TITLE', $this->model->getTitle()); if(!is_null($this->model->getPicture())) $this->template->setVariable('PICTURE_PATH', $this->model->getPicture()->getOriginalPath()); @@ -70,7 +70,7 @@ private function initView() { $this->template->setVariable('DESCRIPTION', $this->model->getDescription()); } - public function setModel(PictureBlockModel $model) { + public function setModel(PictureBlockModel $model): void { $this->model = $model; $this->initView(); } @@ -79,7 +79,7 @@ public function setModel(PictureBlockModel $model) { /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The picture block view requires a model to render its content.'); diff --git a/classes/gui/block/PictureBlock/class.xsrlPictureBlockGUI.php b/classes/gui/block/PictureBlock/class.xsrlPictureBlockGUI.php index 1f5cf35..b2e85d6 100644 --- a/classes/gui/block/PictureBlock/class.xsrlPictureBlockGUI.php +++ b/classes/gui/block/PictureBlock/class.xsrlPictureBlockGUI.php @@ -114,10 +114,6 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL public function executeCommand() { - - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); diff --git a/classes/gui/block/PictureUploadBlock/PictureUploadBlockPresentationView.php b/classes/gui/block/PictureUploadBlock/PictureUploadBlockPresentationView.php index 16995b2..f3f9a4a 100644 --- a/classes/gui/block/PictureUploadBlock/PictureUploadBlockPresentationView.php +++ b/classes/gui/block/PictureUploadBlock/PictureUploadBlockPresentationView.php @@ -63,11 +63,11 @@ public function __construct(ilLearnplacesPlugin $plugin, ilCtrl $controlFlow) { } - private function initView() { + private function initView(): void { $this->template->setVariable('CONTENT', $this->plugin->txt('picture_upload_block_content')); } - public function setModel(PictureUploadBlockModel $model) { + public function setModel(PictureUploadBlockModel $model): void { $this->model = $model; } @@ -75,7 +75,7 @@ public function setModel(PictureUploadBlockModel $model) { /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The picture upload block view requires a model to render its content.'); diff --git a/classes/gui/block/PictureUploadBlock/class.xsrlPictureUploadBlockGUI.php b/classes/gui/block/PictureUploadBlock/class.xsrlPictureUploadBlockGUI.php index 64459fd..6c30927 100644 --- a/classes/gui/block/PictureUploadBlock/class.xsrlPictureUploadBlockGUI.php +++ b/classes/gui/block/PictureUploadBlock/class.xsrlPictureUploadBlockGUI.php @@ -108,10 +108,6 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL public function executeCommand() { - - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); diff --git a/classes/gui/block/Renderable.php b/classes/gui/block/Renderable.php index 7271b9a..2435bba 100644 --- a/classes/gui/block/Renderable.php +++ b/classes/gui/block/Renderable.php @@ -16,7 +16,7 @@ interface Renderable { * * @return string */ - public function getHtml(); + public function getHtml(): string; /** @@ -26,5 +26,5 @@ public function getHtml(); * * @return void */ - public function setReadonly(bool $readonly); + public function setReadonly(bool $readonly): void; } \ No newline at end of file diff --git a/classes/gui/block/RichTextBlock/RichTextBlockEditFormView.php b/classes/gui/block/RichTextBlock/RichTextBlockEditFormView.php index e39a6e8..c12806b 100644 --- a/classes/gui/block/RichTextBlock/RichTextBlockEditFormView.php +++ b/classes/gui/block/RichTextBlock/RichTextBlockEditFormView.php @@ -31,11 +31,10 @@ protected function hasBlockSpecificParts(): bool { return true; } - /** * @inheritDoc */ - protected function initBlockSpecificForm() { + protected function initBlockSpecificForm(): void { $textArea = new ilTextareaInputGUI($this->plugin->txt('rich_text_block_content'), self::POST_CONTENT); $textArea->setRequired(true); $textArea->setUseRte(true); @@ -106,7 +105,7 @@ protected function getFormActionUrl(): string { /** * @inheritDoc */ - protected function getObject() { + protected function getObject(): void { $this->block->setContent($this->getInput(self::POST_CONTENT)); } } \ No newline at end of file diff --git a/classes/gui/block/RichTextBlock/RichTextBlockPresentationView.php b/classes/gui/block/RichTextBlock/RichTextBlockPresentationView.php index 891d586..cafc2f1 100644 --- a/classes/gui/block/RichTextBlock/RichTextBlockPresentationView.php +++ b/classes/gui/block/RichTextBlock/RichTextBlockPresentationView.php @@ -74,7 +74,7 @@ public function setModel(RichTextBlockModel $model) { /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The rich text block view requires a model to render its content.'); diff --git a/classes/gui/block/RichTextBlock/class.xsrlRichTextBlockGUI.php b/classes/gui/block/RichTextBlock/class.xsrlRichTextBlockGUI.php index 56df8f5..62af13f 100644 --- a/classes/gui/block/RichTextBlock/class.xsrlRichTextBlockGUI.php +++ b/classes/gui/block/RichTextBlock/class.xsrlRichTextBlockGUI.php @@ -106,12 +106,8 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL } - public function executeCommand() + public function executeCommand(): bool { - - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); @@ -140,7 +136,7 @@ public function executeCommand() return false; } - private function add() + private function add(): void { $this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM); $this->controlFlow->saveParameter($this, PlusView::ACCORDION_QUERY_PARAM); @@ -154,7 +150,7 @@ private function add() $this->template->setContent($form->getHTML()); } - private function create() + private function create(): void { $form = new RichTextBlockEditFormView(new RichTextBlockModel()); @@ -204,7 +200,7 @@ private function create() } } - private function edit() + private function edit(): void { $block = $this->richTextBlockService->find($this->getBlockId()); $form = new RichTextBlockEditFormView($block); @@ -212,7 +208,7 @@ private function edit() $this->template->setContent($form->getHTML()); } - private function update() + private function update(): void { $form = new RichTextBlockEditFormView(new RichTextBlockModel()); @@ -237,7 +233,7 @@ private function update() } - private function delete() + private function delete(): void { $queries = $this->request->getQueryParams(); $blockId = intval($queries[self::BLOCK_ID_QUERY_KEY]); @@ -248,7 +244,7 @@ private function delete() $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } - private function confirm() + private function confirm(): void { $queries = $this->request->getQueryParams(); @@ -266,7 +262,7 @@ private function confirm() $this->template->setContent($confirm->getHTML()); } - private function cancel() + private function cancel(): void { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } @@ -277,7 +273,7 @@ private function getBlockId(): int return intval($queries[self::BLOCK_ID_QUERY_KEY]); } - private function regenerateSequence() + private function regenerateSequence(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); $this->learnplaceService->store($learnplace); diff --git a/classes/gui/block/VideoBlock/VideoBlockPresentationView.php b/classes/gui/block/VideoBlock/VideoBlockPresentationView.php index ee2a097..03132f9 100644 --- a/classes/gui/block/VideoBlock/VideoBlockPresentationView.php +++ b/classes/gui/block/VideoBlock/VideoBlockPresentationView.php @@ -74,7 +74,7 @@ public function setModel(VideoBlockModel $model) { /** * @inheritDoc */ - public function getHtml() { + public function getHtml(): string { if(is_null($this->model)) throw new LogicException('The video block view requires a model to render its content.'); diff --git a/classes/gui/block/VideoBlock/class.xsrlVideoBlockGUI.php b/classes/gui/block/VideoBlock/class.xsrlVideoBlockGUI.php index cfc0b73..ba34e29 100644 --- a/classes/gui/block/VideoBlock/class.xsrlVideoBlockGUI.php +++ b/classes/gui/block/VideoBlock/class.xsrlVideoBlockGUI.php @@ -117,10 +117,6 @@ public function __construct(ilTabsGUI $tabs, $template, ilCtrl $controlFlow, ilL public function executeCommand() { - - if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { - $this->template->getStandardTemplate(); - } $cmd = $this->controlFlow->getCmd(CommonControllerAction::CMD_INDEX); $this->tabs->activateTab(self::TAB_ID); @@ -149,7 +145,7 @@ public function executeCommand() return false; } - private function add() + private function add(): void { $this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM); $this->controlFlow->saveParameter($this, PlusView::ACCORDION_QUERY_PARAM); @@ -163,7 +159,7 @@ private function add() $this->template->setContent($form->getHTML()); } - private function create() + private function create(): void { $form = new VideoBlockEditFormView(new VideoBlockModel()); try { @@ -221,7 +217,7 @@ private function create() } } - private function edit() + private function edit(): void { $blockId = $this->getBlockId(); $block = $this->videoBlockService->find($blockId); @@ -230,7 +226,7 @@ private function edit() $this->template->setContent($form->getHTML()); } - private function update() + private function update(): void { $tempBlock = new VideoBlockModel(); $tempBlock->setId(PHP_INT_MAX); @@ -282,7 +278,7 @@ private function update() } } - private function delete() + private function delete(): void { $queries = $this->request->getQueryParams(); $blockId = intval($queries[self::BLOCK_ID_QUERY_KEY]); @@ -293,7 +289,7 @@ private function delete() $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } - private function confirm() + private function confirm(): void { $queries = $this->request->getQueryParams(); @@ -311,7 +307,7 @@ private function confirm() $this->template->setContent($confirm->getHTML()); } - private function cancel() + private function cancel(): void { $this->controlFlow->redirectByClass(xsrlContentGUI::class, CommonControllerAction::CMD_INDEX); } @@ -322,7 +318,7 @@ private function getBlockId(): int return intval($queries[self::BLOCK_ID_QUERY_KEY]); } - private function regenerateSequence() + private function regenerateSequence(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); $this->learnplaceService->store($learnplace); diff --git a/classes/gui/block/util/ReadOnlyViewAware.php b/classes/gui/block/util/ReadOnlyViewAware.php index ea05311..42c8aec 100644 --- a/classes/gui/block/util/ReadOnlyViewAware.php +++ b/classes/gui/block/util/ReadOnlyViewAware.php @@ -29,11 +29,9 @@ public function isReadonly(): bool { /** * @param bool $readonly * - * @return ReadOnlyViewAware + * @return void */ - public function setReadonly(bool $readonly): self { + public function setReadonly(bool $readonly): void { $this->readonly = $readonly; - - return $this; } } \ No newline at end of file diff --git a/classes/gui/class.xsrlContentGUI.php b/classes/gui/class.xsrlContentGUI.php index f4ab542..7090d7c 100644 --- a/classes/gui/class.xsrlContentGUI.php +++ b/classes/gui/class.xsrlContentGUI.php @@ -143,7 +143,7 @@ public function __construct( } - public function executeCommand() { + public function executeCommand(): bool { if (version_compare(ILIAS_VERSION_NUMERIC, "6.0", "<")) { $this->template->getStandardTemplate(); @@ -192,7 +192,7 @@ public function executeCommand() { } //actions - private function index() { + private function index(): void { $toolbar = new ilToolbarGUI(); $saveSequenceButton = ilSubmitButton::getInstance(); @@ -224,7 +224,7 @@ private function index() { $this->template->setContent($template->get()); } - private function add() { + private function add(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); foreach ($learnplace->getBlocks() as $block) { if($block instanceof MapBlockModel) { @@ -238,7 +238,7 @@ private function add() { $this->template->setContent($this->blockAddGUI->getHTML()); } - private function create() { + private function create(): void { $blockAdd = $this->blockAddGUI; if($blockAdd->checkInput()) { $input = intval($blockAdd->getInput(BlockAddFormGUI::POST_BLOCK_TYPES, true)); @@ -255,11 +255,11 @@ private function create() { $this->controlFlow->redirect($this, CommonControllerAction::CMD_INDEX); } - private function cancel() { + private function cancel(): void { $this->controlFlow->redirect($this, CommonControllerAction::CMD_INDEX); } - private function sequence() { + private function sequence(): void { $learnplace = $this->learnplaceService->findByObjectId(ilObject::_lookupObjectId($this->getCurrentRefId())); $blockIterator = new AppendIterator(); diff --git a/composer.json b/composer.json index bc98599..360bae5 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,16 @@ { - "name": "studer-raimann.ch/learnplaces", + "name": "fluxlabs/learnplaces", "description": "Ground up rewrite of the Lernorte plugin for modern ILIAS versions.", "type": "project", "license": "GPL-3.0", "authors": [ { "name": "Nicolas Schäfli", - "email": "ns@studer-raimann.ch" + "email": "nick@fluxlabs.ch" } ], "support": { - "email": "info@studer-raimann.ch" + "email": "support@fluxlabs.ch" }, "minimum-stability": "stable", "require": { diff --git a/composer.lock b/composer.lock index 6a1e097..a0d5cd6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d327857cf7018abe711acbd4b640b67", + "content-hash": "72d705d5720f6ad0dcf32fd9c63a7063", "packages": [ { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { @@ -75,30 +75,34 @@ "uri", "url" ], - "time": "2020-09-30T07:37:11+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.2" + }, + "time": "2021-04-26T09:17:50+00:00" }, { "name": "intervention/image", - "version": "2.5.1", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e" + "reference": "0925f10b259679b5d8ca58f3a2add9255ffcda45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", - "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", + "url": "https://api.github.com/repos/Intervention/image/zipball/0925f10b259679b5d8ca58f3a2add9255ffcda45", + "reference": "0925f10b259679b5d8ca58f3a2add9255ffcda45", "shasum": "" }, "require": { "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1", + "guzzlehttp/psr7": "~1.1 || ^2.0", "php": ">=5.4.0" }, "require-dev": { "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7" + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" }, "suggest": { "ext-gd": "to use GD library based image processing.", @@ -145,7 +149,21 @@ "thumbnail", "watermark" ], - "time": "2019-11-02T09:15:47+00:00" + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.6.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/interventionphp", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2021-07-22T14:31:53+00:00" }, { "name": "league/flysystem", @@ -229,6 +247,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.0.70" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -285,6 +307,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { @@ -325,6 +350,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -375,6 +404,11 @@ "uri", "url" ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/uri/issues", + "source": "https://github.com/fruux/sabre-uri" + }, "time": "2019-09-09T23:00:25+00:00" }, { @@ -411,6 +445,10 @@ "formats", "mimetype" ], + "support": { + "issues": "https://github.com/wapmorgan/FileTypeDetector/issues", + "source": "https://github.com/wapmorgan/FileTypeDetector/tree/master" + }, "time": "2017-05-13T11:45:42+00:00" } ], @@ -427,5 +465,5 @@ "platform-overrides": { "php": "7.0.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.1.0" } diff --git a/plugin.php b/plugin.php index 4ac3b67..9446c69 100644 --- a/plugin.php +++ b/plugin.php @@ -1,7 +1,7 @@