From 7393dccde816bafca2e3efe534fae56339e2c536 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 28 May 2016 12:33:07 -0400 Subject: Page content is loaded from the file on disk --- Zotlabs/Module/Wiki.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Wiki.php') diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 54511fc91..76c07f2bc 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -63,12 +63,20 @@ class Wiki extends \Zotlabs\Web\Controller { } if(argc()<3) { $wikiheader = t('Wiki Sandbox'); + $content = '# Wiki Sandbox\nContent you **edit** and **preview** here *will not be saved*.'; $hide_editor = false; } elseif (argc()<4) { - $wikiheader = 'Empty wiki: ' . rawurldecode(argv(2)); // show wiki name + $wikiheader = rawurldecode(argv(2)); // show wiki name + $content = ''; $hide_editor = true; } elseif (argc()<5) { - $wikiheader = rawurldecode(argv(2)) . ': ' . rawurldecode(argv(3)); // show wiki name and page + $wikiheader = rawurldecode(argv(2)) . ': ' . rawurldecode(argv(3)); // show wiki name and page + $p = wiki_get_page_content(array('wiki_resource_id' => $resource_id, 'page' => argv(3))); + if(!$p['success']) { + logger('Error getting page content'); + $content = 'Error retrieving page content. Try again.'; + } + $content = $p['content']; $hide_editor = false; } @@ -80,7 +88,7 @@ class Wiki extends \Zotlabs\Web\Controller { '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$bang' => $x['bang'], - '$content' => '# Start your wiki', + '$content' => $content, '$wikiName' => array('wikiName', t('Enter the name of your new wiki:'), '', ''), '$pageName' => array('pageName', t('Enter the name of the new page:'), '', '') )); -- cgit v1.2.3