diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 61f8dd3..dd3032b 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -5,7 +5,7 @@ "type": 2, "subtype": 1, "name": "OnlineResourceWatcher", - "uri": "{/lang}/{/app}/orw/resource/list?u={?u}", + "uri": "{/base}/orw/resource/list?u={?u}", "target": "self", "icon": null, "order": 40, @@ -19,7 +19,7 @@ "type": 3, "subtype": 1, "name": "Resources", - "uri": "{/lang}/{/app}/orw/resource/list?u={?u}", + "uri": "{/base}/orw/resource/list?u={?u}", "target": "self", "icon": null, "order": 1, diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index bcb2ad6..6bb6191 100755 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Application\ApplicationAbstract; * Navigation class. * * @package Modules\OnlineResourceWatcher\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Install/Workflow.php b/Admin/Install/Workflow.php index dfaa381..393e928 100644 --- a/Admin/Install/Workflow.php +++ b/Admin/Install/Workflow.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Application\ApplicationAbstract; * Workflow class. * * @package Modules\OnlineResourceWatcher\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Installer.php b/Admin/Installer.php index 6e2a786..fe714aa 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Module\ModuleInfo; * Installer class. * * @package Modules\OnlineResourceWatcher\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Routes/Cli.php b/Admin/Routes/Cli.php index 599bccf..233741e 100644 --- a/Admin/Routes/Cli.php +++ b/Admin/Routes/Cli.php @@ -6,7 +6,7 @@ * * @package Modules * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 0a5000a..f12dfb0 100755 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -6,7 +6,7 @@ * * @package Modules * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 709e173..fca839f 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,7 +6,7 @@ * * @package Modules * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Status.php b/Admin/Status.php index 64ef717..802a9a7 100755 --- a/Admin/Status.php +++ b/Admin/Status.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\StatusAbstract; * Status class. * * @package Modules\OnlineResourceWatcher\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Uninstaller.php b/Admin/Uninstaller.php index b012b0a..ee41e31 100755 --- a/Admin/Uninstaller.php +++ b/Admin/Uninstaller.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\UninstallerAbstract; * Uninstaller class. * * @package Modules\OnlineResourceWatcher\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Updater.php b/Admin/Updater.php index 3c0bdfc..f6cb23d 100755 --- a/Admin/Updater.php +++ b/Admin/Updater.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\UpdaterAbstract; * Updater class. * * @package Modules\OnlineResourceWatcher\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 3edc479..a811229 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -36,7 +36,7 @@ use phpOMS\Utils\StringUtils; * OnlineResourceWatcher controller class. * * @package Modules\OnlineResourceWatcher - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -70,17 +70,21 @@ final class ApiController extends Controller $path = 'Modules/OnlineResourceWatcher/Files/' . $resource->path . '/' . $resource->lastVersionPath . '/index.html'; } else { $files = \scandir($basePath); - foreach ($files as $file) { - if ($file === '.' || $files === '..') { - continue; - } + $path = ''; - $path = 'Modules/OnlineResourceWatcher/Files/' . $resource->path . '/' . $resource->lastVersionPath . '/' . $file; + if ($files !== false) { + foreach ($files as $file) { + if ($file === '.' || $files === '..') { + continue; + } + + $path = 'Modules/OnlineResourceWatcher/Files/' . $resource->path . '/' . $resource->lastVersionPath . '/' . $file; + } } } } - $internalRequest = new HttpRequest(); + $internalRequest = new HttpRequest(); $internalRequest->header->account = $request->header->account; $internalRequest->setData('path', $path); $this->app->moduleManager->get('Media')->apiMediaExport($internalRequest, $response, ['guard' => __DIR__ . '/../Files']); @@ -148,8 +152,8 @@ final class ApiController extends Controller { $resource = new Resource(); $resource->owner = new NullAccount($request->header->account); - $resource->title = (string) ($request->getData('title') ?? ''); - $resource->uri = (string) ($request->getData('uri') ?? ''); + $resource->title = $request->getDataString('title') ?? ''; + $resource->uri = $request->getDataString('uri') ?? ''; $resource->owner = new NullAccount($request->header->account); // @todo: check if user is part of organization below AND has free resources to add!!! @@ -297,7 +301,7 @@ final class ApiController extends Controller $resource->path = (string) $resource->getId(); $resource->lastVersionPath = (string) $check['timestamp']; $resource->lastVersionDate = $report->createdAt; - $resource->hash = $hash; + $resource->hash = $hash == false ? '' : $hash; $resource->checkedAt = $report->createdAt; ResourceMapper::update()->execute($resource); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 59a8def..1dceac5 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -26,7 +26,7 @@ use Web\Backend\Views\TableView; * OnlineResourceWatcher controller class. * * @package Modules\OnlineResourceWatcher - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -86,14 +86,14 @@ final class BackendController extends Controller $mapper = ResourceMapper::getAll()->with('createdBy'); $list = ResourceMapper::find( - search: $request->getData('search'), + search: $request->getDataString('search'), mapper: $mapper, - id: (int) ($request->getData('id') ?? 0), - secondaryId: (string) ($request->getData('subid') ?? ''), - type: $request->getData('pType'), - pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')), - sortBy: $request->getData('sort_by') ?? '', - sortOrder: $request->getData('sort_order') ?? OrderType::DESC, + id: $request->getDataInt('id') ?? 0, + secondaryId: $request->getDataString('subid') ?? '', + type: $request->getDataString('pType'), + pageLimit: empty($request->getDataInt('limit') ?? 0) ? 100 : ((int) $request->getData('limit')), + sortBy: $request->getDataString('sort_by') ?? '', + sortOrder: $request->getDataString('sort_order') ?? OrderType::DESC, searchFields: $searchField, filters: $filterField ); diff --git a/Controller/Controller.php b/Controller/Controller.php index f81e728..1f37b6a 100755 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\ModuleAbstract; * OnlineResourceWatcher controller class. * * @package Modules\OnlineResourceWatcher - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/NullResource.php b/Models/NullResource.php index 24ec638..ab86e02 100644 --- a/Models/NullResource.php +++ b/Models/NullResource.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\OnlineResourceWatcher\Models; * Null model * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index e04c323..683217d 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Permision state enum. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Report.php b/Models/Report.php index 2023f8b..f0a347a 100644 --- a/Models/Report.php +++ b/Models/Report.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use Modules\Admin\Models\NullAccount; * Report class. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/ReportMapper.php b/Models/ReportMapper.php index b9683ac..20f8a5c 100644 --- a/Models/ReportMapper.php +++ b/Models/ReportMapper.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Resource mapper class. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/ReportStatus.php b/Models/ReportStatus.php index 86f2391..c7e8dcc 100644 --- a/Models/ReportStatus.php +++ b/Models/ReportStatus.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Event type enum. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Resource.php b/Models/Resource.php index 77d806b..87f51b4 100755 --- a/Models/Resource.php +++ b/Models/Resource.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use Modules\Admin\Models\NullAccount; * Resource class. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/ResourceMapper.php b/Models/ResourceMapper.php index 07638fd..ce085ea 100755 --- a/Models/ResourceMapper.php +++ b/Models/ResourceMapper.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Resource mapper class. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/ResourceStatus.php b/Models/ResourceStatus.php index 12dab3d..daf09f6 100755 --- a/Models/ResourceStatus.php +++ b/Models/ResourceStatus.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Event type enum. * * @package Modules\OnlineResourceWatcher\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Theme/Backend/Lang/Navigation.de.lang.php b/Theme/Backend/Lang/Navigation.de.lang.php index a1eca9f..7a31494 100644 --- a/Theme/Backend/Lang/Navigation.de.lang.php +++ b/Theme/Backend/Lang/Navigation.de.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index a1eca9f..7a31494 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index ed4ba7f..8562a03 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index fb2ef1a..14ee961 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/resource-create.tpl.php b/Theme/Backend/resource-create.tpl.php index a835a2d..a4ffa3f 100755 --- a/Theme/Backend/resource-create.tpl.php +++ b/Theme/Backend/resource-create.tpl.php @@ -6,7 +6,7 @@ * * @package Web\Backend * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -76,7 +76,7 @@ use phpOMS\Uri\UriFactory; getHtml('User', '0', '0'); ?> getHtml('Email', '0', '0'); ?> - $value) : ++$c; $url = UriFactory::build('{/lang}/{/app}/admin/account/settings?{?}&id=' . $value->getId()); ?> + $value) : ++$c; $url = UriFactory::build('{/base}/admin/account/settings?{?}&id=' . $value->getId()); ?> diff --git a/Theme/Backend/resource-list.tpl.php b/Theme/Backend/resource-list.tpl.php index fbfbebf..5c7c2aa 100755 --- a/Theme/Backend/resource-list.tpl.php +++ b/Theme/Backend/resource-list.tpl.php @@ -6,7 +6,7 @@ * * @package Modules\OnlineResourceWatcher * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -44,7 +44,7 @@ $next = $tableView->getNextLink( renderTitle( $this->getHtml('Resources') ); ?> - getHtml('New', '0', '0'); ?> + getHtml('New', '0', '0'); ?>
@@ -78,7 +78,7 @@ $next = $tableView->getNextLink( $resource) : ++$count; - $url = UriFactory::build('{/lang}/{/app}/orw/resource?id=' . $resource->getId()); ?> + $url = UriFactory::build('{/base}/orw/resource?id=' . $resource->getId()); ?>
getId(); ?> printHtml($resource->title); ?> diff --git a/Theme/Backend/resource-single.tpl.php b/Theme/Backend/resource-single.tpl.php index 807a97c..36a5cd8 100644 --- a/Theme/Backend/resource-single.tpl.php +++ b/Theme/Backend/resource-single.tpl.php @@ -6,7 +6,7 @@ * * @package Web\Backend * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index 5e5b7a2..8e49aaa 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -6,7 +6,7 @@ * * @package tests * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/tests/Autoloader.php b/tests/Autoloader.php index d032623..d08f1b7 100755 --- a/tests/Autoloader.php +++ b/tests/Autoloader.php @@ -6,7 +6,7 @@ * * @package Modules/tests * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ namespace tests; * Autoloader class. * * @package tests - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 545eb86..a37a7b8 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -6,7 +6,7 @@ * * @package tests * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */