Skip to content

Commit

Permalink
Merge pull request #79 from funktechno/f/subpages
Browse files Browse the repository at this point in the history
add missing file
  • Loading branch information
lastlink authored Jul 23, 2024
2 parents c589b18 + fdd6f0e commit 90bc78e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Version 0.3.6
Improvements:

* fix missing changes for sub pages

Bug fixes:

* Fix https://github.com/funktechno/kanboard-plugin-wiki/issues/11

Version 0.3.5
Improvements:

Expand Down
24 changes: 22 additions & 2 deletions Controller/WikiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ public function detail_readonly() {
), 'wiki:wiki/sidebar'));
}

function getNestedChildren($parent_id, $items) {
$children = [];

foreach ($items as $item) {
if ($item['parent_id'] === $parent_id) {
$item['children'] = $this->getNestedChildren($item['id'], $items);
array_push($children, $item);
}
}

return $children;
}


/**
* details for single wiki page
*/
Expand All @@ -197,11 +211,17 @@ public function detail()
$wiki_id = $this->request->getIntegerParam('wiki_id');

$wikipages = $this->wiki->getWikipages($project['id']);
$wikiPagesResult = array();

foreach ($wikipages as $page) {
if (t($wiki_id) == t($page['id'])) {
$wikipage = $page;
break;
}
if(!isset($page['parent_id'])){

$page['children'] = $this->getNestedChildren($page['id'], $wikipages);

array_push($wikiPagesResult, $page);
}
}

Expand All @@ -220,7 +240,7 @@ public function detail()
'images' => $this->wikiFile->getAllImages($wiki_id),
// 'wikipage' => $this->wiki->getWikipage($wiki_id),
'wikipage' => $wikipage,
'wikipages' => $wikipages,
'wikipages' => $wikiPagesResult,
), 'wiki:wiki/sidebar'));

// $wikipage= $wikipages->select(1)->eq('id', $wiki_id)->findOne();
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugin=Wiki
version=0.3.5
version=0.3.6
all:
@ echo "Build archive for plugin ${plugin} version=${version}"
@ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip
2 changes: 1 addition & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '0.3.5';
return '0.3.6';
}

public function getPluginHomepage()
Expand Down

0 comments on commit 90bc78e

Please sign in to comment.