general fixes and tpl additions

This commit is contained in:
Dennis Eichhorn 2021-05-28 20:28:40 +02:00
parent 1410816347
commit 86437be733
24 changed files with 47 additions and 0 deletions

View File

@ -83,6 +83,17 @@ return [
],
],
],
'^.*/wiki/doc/edit.*$' => [
[
'dest' => '\Modules\Knowledgebase\Controller\BackendController:viewKnowledgebaseDocEdit',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionState::WIKI,
],
],
],
'^.*/wiki/doc/list.*$' => [
[
'dest' => '\Modules\Knowledgebase\Controller\BackendController:viewKnowledgebaseDocList',

View File

@ -299,6 +299,9 @@ final class BackendController extends Controller
$categories = WikiCategoryMapper::with('language', $lang)::getByParentAndApp($request->hasData('category') ? (int) $request->getData('category') : null, $app, 2);
$view->setData('categories', $categories);
$view->setData('document', $document);
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::WIKI, $document->getId())
);
return $view;
}
@ -332,4 +335,37 @@ final class BackendController extends Controller
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 viewKnowledgebaseDocEdit(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Knowledgebase/Theme/Backend/wiki-doc-create');
$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);
$accGrpSelector = new \Modules\Profile\Theme\Backend\Components\AccountGroupSelector\BaseView($this->app->l11nManager, $request, $response);
$view->addData('accGrpSelector', $accGrpSelector);
$tagSelector = new \Modules\Tag\Theme\Backend\Components\TagSelector\BaseView($this->app->l11nManager, $request, $response);
$view->addData('tagSelector', $tagSelector);
$view->addData('doc', WikiDocMapper::get((int) ($request->getData('id') ?? 0)));
return $view;
}
}

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