Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/4.0.0' into 'master'
Browse files Browse the repository at this point in the history
Release 4.0.0

See merge request fluxns/learnplaces!17
  • Loading branch information
fluxns committed Sep 16, 2021
2 parents a8f96aa + 59062ef commit 9aa703d
Show file tree
Hide file tree
Showing 26 changed files with 153 additions and 129 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ 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 |
|---|---|---|
| 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

Expand Down Expand Up @@ -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)
<https://www.studer-raimann.ch>
[connect@fluxlabs.ch](mailto:connect@fluxlabs.ch)
<https://fluxlabs.ch>
2 changes: 1 addition & 1 deletion classes/class.ilObjLearnplacesGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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.');

Expand Down
18 changes: 9 additions & 9 deletions classes/gui/block/AccordionBlock/class.xsrlAccordionBlockGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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", "<")) {
Expand Down Expand Up @@ -131,7 +131,7 @@ public function executeCommand()
return false;
}

private function add()
private function add(): void
{
$this->controlFlow->saveParameter($this, PlusView::POSITION_QUERY_PARAM);

Expand All @@ -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 {
Expand Down Expand Up @@ -179,15 +179,15 @@ private function create()
}
}

private function edit()
private function edit(): void
{
$block = $this->accordionService->find($this->getBlockId());
$form = new AccordionBlockEditFormView($block);
$form->fillForm();
$this->template->setContent($form->getHTML());
}

private function update()
private function update(): void
{
$form = new AccordionBlockEditFormView(new AccordionBlockModel());
try {
Expand All @@ -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]);
Expand All @@ -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();

Expand All @@ -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);
}
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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();
}
Expand All @@ -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.');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
}

Expand Down
21 changes: 9 additions & 12 deletions classes/gui/block/IliasLinkBlock/class.xsrlIliasLinkBlockGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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 {
Expand Down Expand Up @@ -209,7 +206,7 @@ private function create()
}
}

private function edit()
private function edit(): void
{
$blockId = $this->getBlockId();
$block = $this->iliasLinkService->find($blockId);
Expand All @@ -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 {
Expand All @@ -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]);
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion classes/gui/block/MapBlock/MapBlockPresentationView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

Expand Down
Loading

0 comments on commit 9aa703d

Please sign in to comment.