Skip to content

Commit 8c06bff

Browse files
authored
Merge pull request #80 from funktechno/dev
v 0.3.6
2 parents 4d2d1f7 + 90bc78e commit 8c06bff

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 0.3.6
2+
Improvements:
3+
4+
* fix missing changes for sub pages
5+
6+
Bug fixes:
7+
8+
* Fix https://github.com/funktechno/kanboard-plugin-wiki/issues/11
9+
110
Version 0.3.5
211
Improvements:
312

Controller/WikiController.php

+22-2
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ public function detail_readonly() {
187187
), 'wiki:wiki/sidebar'));
188188
}
189189

190+
function getNestedChildren($parent_id, $items) {
191+
$children = [];
192+
193+
foreach ($items as $item) {
194+
if ($item['parent_id'] === $parent_id) {
195+
$item['children'] = $this->getNestedChildren($item['id'], $items);
196+
array_push($children, $item);
197+
}
198+
}
199+
200+
return $children;
201+
}
202+
203+
190204
/**
191205
* details for single wiki page
192206
*/
@@ -197,11 +211,17 @@ public function detail()
197211
$wiki_id = $this->request->getIntegerParam('wiki_id');
198212

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

201216
foreach ($wikipages as $page) {
202217
if (t($wiki_id) == t($page['id'])) {
203218
$wikipage = $page;
204-
break;
219+
}
220+
if(!isset($page['parent_id'])){
221+
222+
$page['children'] = $this->getNestedChildren($page['id'], $wikipages);
223+
224+
array_push($wikiPagesResult, $page);
205225
}
206226
}
207227

@@ -220,7 +240,7 @@ public function detail()
220240
'images' => $this->wikiFile->getAllImages($wiki_id),
221241
// 'wikipage' => $this->wiki->getWikipage($wiki_id),
222242
'wikipage' => $wikipage,
223-
'wikipages' => $wikipages,
243+
'wikipages' => $wikiPagesResult,
224244
), 'wiki:wiki/sidebar'));
225245

226246
// $wikipage= $wikipages->select(1)->eq('id', $wiki_id)->findOne();

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugin=Wiki
2-
version=0.3.5
2+
version=0.3.6
33
all:
44
@ echo "Build archive for plugin ${plugin} version=${version}"
55
@ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip

Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getPluginAuthor()
9797

9898
public function getPluginVersion()
9999
{
100-
return '0.3.5';
100+
return '0.3.6';
101101
}
102102

103103
public function getPluginHomepage()

0 commit comments

Comments
 (0)