Merge remote-tracking branch 'upstream/dev' into wiki

This commit is contained in:
Andrew Manning
2016-06-30 21:51:33 -04:00
319 changed files with 10689 additions and 8258 deletions

View File

@@ -20,11 +20,23 @@ class Wiki extends \Zotlabs\Web\Controller {
notice(t('You must be logged in to see this page.') . EOL);
goaway('/login');
}
profile_load($nick);
}
function get() {
if(observer_prohibited(true)) {
return login();
}
$tab = 'wiki';
require_once('include/wiki.php');
require_once('include/acl_selectors.php');
require_once('include/conversation.php');
// TODO: Combine the interface configuration into a unified object
// Something like $interface = array('new_page_button' => false, 'new_wiki_button' => false, ...)
$wiki_owner = false;
@@ -123,7 +135,7 @@ class Wiki extends \Zotlabs\Web\Controller {
notice('Error retrieving page content' . EOL);
goaway('/'.argv(0).'/'.argv(1).'/'.$wikiUrlName);
}
$content = ($p['content'] !== '' ? $p['content'] : '"# New page\n"');
$content = ($p['content'] !== '' ? htmlspecialchars_decode($p['content'],ENT_COMPAT) : '"# New page\n"');
// Render the Markdown-formatted page content in HTML
require_once('library/markdown.php');
$html = wiki_generate_toc(purify_html(Markdown(json_decode($content))));
@@ -150,6 +162,11 @@ class Wiki extends \Zotlabs\Web\Controller {
)
);
$is_owner = ((local_channel()) && (local_channel() == \App::$profile['profile_uid']) ? true : false);
$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']);
$o .= replace_macros(get_markup_template('wiki.tpl'),array(
'$wikiheaderName' => $wikiheaderName,
'$wikiheaderPage' => $wikiheaderPage,