general fixes and tpl additions

This commit is contained in:
Dennis Eichhorn 2021-05-28 20:28:40 +02:00
parent fdc4e95471
commit 9111d632fe
32 changed files with 86 additions and 15 deletions

View File

@ -1,6 +1,6 @@
[
{
"id": 1000701001,
"id": 1000601001,
"pid": "/",
"type": 2,
"subtype": 1,
@ -14,7 +14,7 @@
"parent": 1006901001,
"children": [
{
"id": 1000702001,
"id": 1000602001,
"pid": "/news",
"type": 3,
"subtype": 1,
@ -25,11 +25,11 @@
"order": 1,
"from": "News",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000701001,
"parent": 1000601001,
"children": []
},
{
"id": 1000703001,
"id": 1000603001,
"pid": "/news",
"type": 3,
"subtype": 1,
@ -40,11 +40,11 @@
"order": 5,
"from": "News",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1000701001,
"parent": 1000601001,
"children": []
},
{
"id": 1000704001,
"id": 1000604001,
"pid": "/news",
"type": 3,
"subtype": 1,
@ -55,11 +55,11 @@
"order": 10,
"from": "News",
"permission": { "permission": 4, "type": null, "element": null },
"parent": 1000701001,
"parent": 1000601001,
"children": []
},
{
"id": 1000705001,
"id": 1000605001,
"pid": "/news",
"type": 3,
"subtype": 1,
@ -70,7 +70,22 @@
"order": 15,
"from": "News",
"permission": { "permission": 4, "type": null, "element": null },
"parent": 1000701001,
"parent": 1000601001,
"children": []
},
{
"id": 1000606001,
"pid": "/news",
"type": 3,
"subtype": 1,
"name": "Analysis",
"uri": "{/prefix}news/analysis",
"target": "self",
"icon": null,
"order": 15,
"from": "News",
"permission": { "permission": 4, "type": null, "element": null },
"parent": 1000601001,
"children": []
}
]

View File

@ -90,4 +90,15 @@ return [
],
],
],
'^.*/news/analysis.*$' => [
[
'dest' => '\Modules\Editor\Controller\BackendController:viewNewsAnalysis',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionState::ANALYSIS,
],
],
],
];

View File

@ -57,7 +57,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-dashboard');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
if ($request->getData('ptype') === 'p') {
$view->setData('news',
@ -153,7 +153,7 @@ final class BackendController extends Controller implements DashboardElementInte
}
$view->setTemplate('/Modules/News/Theme/Backend/news-single');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
$view->addData('news', $article);
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::NEWS, $article->getId())
@ -190,7 +190,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-archive');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
if ($request->getData('ptype') === 'p') {
$view->setData('news',
@ -230,7 +230,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-draft');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
if ($request->getData('ptype') === 'p') {
$view->setData('news',
@ -264,7 +264,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
$view->addData('editor', $editor);
@ -295,7 +295,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
$view->addData('editor', $editor);
@ -310,4 +310,26 @@ final class BackendController extends Controller implements DashboardElementInte
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewNewsAnalysis(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/News/Theme/Backend/news-analysis');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
return $view;
}
}

0
Docs/Dev/en/SUMMARY.md Normal file → Executable file
View File

0
Docs/Dev/en/structure.md Normal file → Executable file
View File

0
Models/NewsSeen.php Normal file → Executable file
View File

0
Models/NewsSeenMapper.php Normal file → Executable file
View File

0
Models/NullNewsSeen.php Normal file → Executable file
View File

View File

@ -27,4 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum
{
public const NEWS = 1;
public const ANALYSIS = 2;
}

0
Theme/Backend/Lang/ar.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/cs.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/da.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/de.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/el.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/en.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/es.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fi.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/hu.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/it.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ja.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ko.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/no.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pl.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pt.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ru.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/sv.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/th.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/tr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/uk.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/zh.lang.php Normal file → Executable file
View File

View File

@ -0,0 +1,21 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\News
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use Modules\News\Models\NewsType;
use phpOMS\Uri\UriFactory;
// @todo: stats: published timeline, published by tags, published by author
echo $this->getData('nav')->render(); ?>