Wiki navigation bar

This commit is contained in:
2022-03-27 22:00:29 +00:00
parent 9c6114cf86
commit 4807b7d4ae
13 changed files with 189 additions and 48 deletions

View File

@ -25,7 +25,7 @@ class WikiService {
}
public function test() {
$folderId = 381;
$folderId = 880;
return $this->wikiHelper->setFolderId($folderId)->reloadWikiTree();
return $this->wikiHelper->setFolderId($folderId)->rename(707, 'UnoMasUno');
return $this->wikiHelper->setFolderId($folderId)->rename(647, 'RenameTest3');
@ -57,17 +57,20 @@ class WikiService {
}
}
public function create(string $title, int $fileId, string $userId) {
$this->wikiHelper->setFolderId($fileId);
if ( $this->wikiHelper->isWiki() ) {
if ( !$this->wikiHelper->initWiki($title) ) {
throw new ReadOnlyException('Error creating wiki');
}
public function create(string $folderPath, string $title, string $userId) {
$folderId = $this->wikiHelper->initWiki($folderPath, $title);
if ( $folderId === null ) {
throw new ReadOnlyException('Error creating wiki');
}
$wikis = $this->mapper->findAll($userId, ['fileId'=>$folderId]);
if ( count($wikis)>0 ) {
return $wikis[0];
}
$wiki = new Wiki();
$wiki->setTitle($title);
$wiki->setFileId($fileId);
$wiki->setFileId($folderId);
$wiki->setUserId($userId);
return $this->mapper->insert($wiki);
}