diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-09-13 10:30:08 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-09-13 10:30:08 +0200 |
commit | 29b0ed87d61ae7c5fae5a43ad667cefce3938e25 (patch) | |
tree | d94df5802569f08b4b640a5763a2ea27b2d49743 /Zotlabs/Lib/NativeWikiPage.php | |
parent | 87ca60b0b128bf12b611146264159377baca71a3 (diff) | |
parent | 0e6d84e20731f173e489fe0d54b43c01266c0391 (diff) | |
download | volse-hubzilla-29b0ed87d61ae7c5fae5a43ad667cefce3938e25.tar.gz volse-hubzilla-29b0ed87d61ae7c5fae5a43ad667cefce3938e25.tar.bz2 volse-hubzilla-29b0ed87d61ae7c5fae5a43ad667cefce3938e25.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Lib/NativeWikiPage.php')
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index 78b54ebda..ffd5aec31 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -55,7 +55,12 @@ class NativeWikiPage { } - static public function create_page($channel_id, $observer_hash, $name, $resource_id) { + static public function create_page($channel_id, $observer_hash, $name, $resource_id, $mimetype = 'text/bbcode') { + + logger('mimetype: ' . $mimetype); + + if(! in_array($mimetype,[ 'text/markdown','text/bbcode','text/plain','text/html' ])) + $mimetype = 'text/markdown'; $w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id); @@ -68,6 +73,7 @@ class NativeWikiPage { $arr = []; $arr['uid'] = $channel_id; $arr['author_xchan'] = $observer_hash; + $arr['mimetype'] = $mimetype; $arr['resource_type'] = 'nwikipage'; $arr['resource_id'] = $resource_id; $arr['allow_cid'] = $w['wiki']['allow_cid']; @@ -167,10 +173,11 @@ class NativeWikiPage { $content = $item['body']; return [ - 'content' => $content, - 'mimeType' => $w['mimeType'], - 'message' => '', - 'success' => true + 'content' => $content, + 'mimeType' => $w['mimeType'], + 'pageMimeType' => $item['mimetype'], + 'message' => '', + 'success' => true ]; } @@ -333,7 +340,6 @@ class NativeWikiPage { return array('message' => t('Error reading wiki'), 'success' => false); } - $mimetype = $w['mimeType']; // fetch the most recently saved revision. @@ -342,6 +348,8 @@ class NativeWikiPage { return array('message' => t('Page not found'), 'success' => false); } + $mimetype = $item['mimetype']; + // change just the fields we need to change to create a revision; unset($item['id']); |