From 4500faf463e7fd6fcf9948666421c941a1292df9 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 19 Sep 2017 18:59:06 +0200 Subject: fix various wikipage widget issues (sort pages by name, respect locked mime type setting, move create tool back to the bottom) --- Zotlabs/Lib/NativeWikiPage.php | 9 ++++++++- view/tpl/wiki_page_list.tpl | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index 4b637781e..209a5ef3c 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -21,7 +21,7 @@ class NativeWikiPage { $sql_extra = item_permissions_sql($channel_id,$observer_hash); $r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and item_deleted = 0 - $sql_extra order by created asc", + $sql_extra order by title asc", dbesc($resource_id), intval($channel_id) ); @@ -74,6 +74,7 @@ class NativeWikiPage { $arr['uid'] = $channel_id; $arr['author_xchan'] = $observer_hash; $arr['mimetype'] = $mimetype; + $arr['title'] = $name; $arr['resource_type'] = 'nwikipage'; $arr['resource_id'] = $resource_id; $arr['allow_cid'] = $w['wiki']['allow_cid']; @@ -139,8 +140,14 @@ class NativeWikiPage { if($ic) { foreach($ic as $c) { set_iconfig($c['item_id'],'nwikipage','pagetitle',$pageNewName); + $ids[] = $c['item_id']; } + $str_ids = implode(',', $ids); + q("update item set title = '%s' where id in ($str_ids)", + dbesc($pageNewName) + ); + $page = [ 'rawName' => $pageNewName, 'htmlName' => escape_tags($pageNewName), diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl index bf5f6697d..a7e6ebdaf 100644 --- a/view/tpl/wiki_page_list.tpl +++ b/view/tpl/wiki_page_list.tpl @@ -3,6 +3,16 @@ {{/if}}

{{$header}}

{{if ! $refresh}} -- cgit v1.2.3