native wiki updates
This commit is contained in:
parent
6e504b7bc9
commit
d4e58e94f6
@ -541,7 +541,7 @@ class NativeWikiPage {
|
|||||||
|
|
||||||
$s = str_replace(array('[baseurl]', '[sitename]'), array(z_root(), get_config('system', 'sitename')), $s);
|
$s = str_replace(array('[baseurl]', '[sitename]'), array(z_root(), get_config('system', 'sitename')), $s);
|
||||||
|
|
||||||
$observer = App::get_observer();
|
$observer = \App::get_observer();
|
||||||
if ($observer) {
|
if ($observer) {
|
||||||
$s1 = '<span class="bb_observer" title="' . t('Different viewers will see this text differently') . '">';
|
$s1 = '<span class="bb_observer" title="' . t('Different viewers will see this text differently') . '">';
|
||||||
$s2 = '</span>';
|
$s2 = '</span>';
|
||||||
|
@ -39,7 +39,6 @@ class Wiki extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/wiki.php');
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
@ -239,8 +238,8 @@ class Wiki extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require_once('library/markdown.php');
|
require_once('library/markdown.php');
|
||||||
$html = wiki_generate_toc(zidify_text(purify_html(Markdown(wiki_bbcode(json_decode($content))))));
|
$html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode(json_decode($content))))));
|
||||||
$renderedContent = wiki_convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
|
$renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
|
||||||
}
|
}
|
||||||
$showPageControls = $wiki_editor;
|
$showPageControls = $wiki_editor;
|
||||||
break;
|
break;
|
||||||
@ -296,7 +295,7 @@ class Wiki extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
require_once('include/wiki.php');
|
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
$nick = argv(1);
|
$nick = argv(1);
|
||||||
|
@ -901,13 +901,10 @@ function widget_chatroom_members() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function widget_wiki_list($arr) {
|
function widget_wiki_list($arr) {
|
||||||
require_once("include/wiki.php");
|
|
||||||
$channel = channelx_by_n(App::$profile_uid);
|
$channel = channelx_by_n(App::$profile_uid);
|
||||||
|
|
||||||
if(defined('NATIVE_WIKI'))
|
|
||||||
$wikis = Zotlabs\Lib\NativeWiki::listwikis($channel,get_observer_hash());
|
$wikis = Zotlabs\Lib\NativeWiki::listwikis($channel,get_observer_hash());
|
||||||
else
|
|
||||||
$wikis = wiki_list($channel, get_observer_hash());
|
|
||||||
|
|
||||||
if($wikis) {
|
if($wikis) {
|
||||||
return replace_macros(get_markup_template('wikilist_widget.tpl'), array(
|
return replace_macros(get_markup_template('wikilist_widget.tpl'), array(
|
||||||
@ -921,7 +918,6 @@ function widget_wiki_list($arr) {
|
|||||||
|
|
||||||
function widget_wiki_pages($arr) {
|
function widget_wiki_pages($arr) {
|
||||||
|
|
||||||
require_once("include/wiki.php");
|
|
||||||
$channelname = ((array_key_exists('channel',$arr)) ? $arr['channel'] : '');
|
$channelname = ((array_key_exists('channel',$arr)) ? $arr['channel'] : '');
|
||||||
$c = channelx_by_nick($channelname);
|
$c = channelx_by_nick($channelname);
|
||||||
|
|
||||||
@ -935,10 +931,7 @@ function widget_wiki_pages($arr) {
|
|||||||
if (! array_key_exists('resource_id', $arr)) {
|
if (! array_key_exists('resource_id', $arr)) {
|
||||||
$hide = true;
|
$hide = true;
|
||||||
} else {
|
} else {
|
||||||
if(defined('NATIVE_WIKI'))
|
|
||||||
$p = Zotlabs\Lib\NativeWikiPage::page_list($c['channel_id'],get_observer_hash(),$arr['resource_id']);
|
$p = Zotlabs\Lib\NativeWikiPage::page_list($c['channel_id'],get_observer_hash(),$arr['resource_id']);
|
||||||
else
|
|
||||||
$p = wiki_page_list($arr['resource_id']);
|
|
||||||
|
|
||||||
if($p['pages']) {
|
if($p['pages']) {
|
||||||
$pages = $p['pages'];
|
$pages = $p['pages'];
|
||||||
@ -967,10 +960,10 @@ function widget_wiki_pages($arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function widget_wiki_page_history($arr) {
|
function widget_wiki_page_history($arr) {
|
||||||
require_once("include/wiki.php");
|
|
||||||
$pageUrlName = ((array_key_exists('pageUrlName', $arr)) ? $arr['pageUrlName'] : '');
|
$pageUrlName = ((array_key_exists('pageUrlName', $arr)) ? $arr['pageUrlName'] : '');
|
||||||
$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : '');
|
$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : '');
|
||||||
if(defined('NATIVE_WIKI')) {
|
|
||||||
$pageHistory = Zotlabs\Lib\NativeWikiPage::page_history(array('channel_id' => App::$profile_uid, 'observer_hash' => get_observer_hash(), 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
$pageHistory = Zotlabs\Lib\NativeWikiPage::page_history(array('channel_id' => App::$profile_uid, 'observer_hash' => get_observer_hash(), 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||||
return replace_macros(get_markup_template('nwiki_page_history.tpl'), array(
|
return replace_macros(get_markup_template('nwiki_page_history.tpl'), array(
|
||||||
'$pageHistory' => $pageHistory['history'],
|
'$pageHistory' => $pageHistory['history'],
|
||||||
@ -978,15 +971,7 @@ function widget_wiki_page_history($arr) {
|
|||||||
'$name_lbl' => t('Name'),
|
'$name_lbl' => t('Name'),
|
||||||
'$msg_label' => t('Message','wiki_history')
|
'$msg_label' => t('Message','wiki_history')
|
||||||
));
|
));
|
||||||
}
|
|
||||||
else {
|
|
||||||
$pageHistory = wiki_page_history(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
|
||||||
|
|
||||||
return replace_macros(get_markup_template('wiki_page_history.tpl'), array(
|
|
||||||
'$pageHistory' => $pageHistory['history'],
|
|
||||||
'$permsWrite' => $arr['permsWrite']
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function widget_bookmarkedchats($arr) {
|
function widget_bookmarkedchats($arr) {
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<ul id="panel-{{$wiki.id}}" class="lockview-panel dropdown-menu dropdown-menu-right"></ul>
|
<ul id="panel-{{$wiki.id}}" class="lockview-panel dropdown-menu dropdown-menu-right"></ul>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
<td class="wiki-index-tool"><i class="fa fa-download fakelink" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;"></i></td>
|
<!-- td class="wiki-index-tool"><i class="fa fa-download fakelink" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;"></i></td --!>
|
||||||
{{if $owner}}
|
{{if $owner}}
|
||||||
<td><i class="fa fa-trash-o drop-icons" onclick="wiki_delete_wiki('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;"></i></td>
|
<td><i class="fa fa-trash-o drop-icons" onclick="wiki_delete_wiki('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;"></i></td>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Reference in New Issue
Block a user