diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 1be573d..061d47d 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -63,8 +63,8 @@ "pid": "/wiki", "type": 3, "subtype": 1, - "name": "Apps", - "uri": "{/prefix}wiki/app/list", + "name": "Wiki", + "uri": "{/prefix}wiki/list", "target": "self", "icon": null, "order": 15, diff --git a/Admin/Installer.php b/Admin/Installer.php index b15daec..6662ad9 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -14,12 +14,15 @@ declare(strict_types=1); namespace Modules\Knowledgebase\Admin; +use Modules\Knowledgebase\Models\WikiApp; use Modules\Knowledgebase\Models\WikiCategory; use Modules\Knowledgebase\Models\WikiCategoryMapper; use phpOMS\Config\SettingsInterface; use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InstallerAbstract; use phpOMS\Module\ModuleInfo; +use Modules\Knowledgebase\Models\WikiAppMapper; +use Modules\Knowledgebase\Models\NullWikiApp; /** * Installer class. @@ -38,7 +41,13 @@ final class Installer extends InstallerAbstract { parent::install($dbPool, $info, $cfgHandler); + $app = new WikiApp(); + $app->setName('Default'); + + $id = WikiAppMapper::create($app); + $category = new WikiCategory(); + $category->setApp(new NullWikiApp($id)); $category->setName('Default'); $category->setPath('/'); diff --git a/Models/WikiCategory.php b/Models/WikiCategory.php index cb2b77e..32be3c0 100755 --- a/Models/WikiCategory.php +++ b/Models/WikiCategory.php @@ -37,10 +37,10 @@ class WikiCategory implements \JsonSerializable * * There can be different wikis * - * @var null|WikiApp + * @var WikiApp * @since 1.0.0 */ - private ?WikiApp $app = null; + private WikiApp $app; /** * Name. @@ -66,6 +66,16 @@ class WikiCategory implements \JsonSerializable */ private ?self $parent = null; + /** + * Cosntructor + * + * @since 1.0.0 + */ + public function __construct() + { + $this->app = new NullWikiApp(); + } + /** * Get id. *