From c334fc9d22c7f2633d9b7e8d9e0fae1f2bb40547 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 6 May 2022 07:29:59 +0000 Subject: move wiki to addons --- Zotlabs/Widget/Wiki_list.php | 28 --------- Zotlabs/Widget/Wiki_page_history.php | 36 ------------ Zotlabs/Widget/Wiki_pages.php | 110 ----------------------------------- 3 files changed, 174 deletions(-) delete mode 100644 Zotlabs/Widget/Wiki_list.php delete mode 100644 Zotlabs/Widget/Wiki_page_history.php delete mode 100644 Zotlabs/Widget/Wiki_pages.php (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Wiki_list.php b/Zotlabs/Widget/Wiki_list.php deleted file mode 100644 index 217ab8706..000000000 --- a/Zotlabs/Widget/Wiki_list.php +++ /dev/null @@ -1,28 +0,0 @@ - t('Wikis'), - '$channel' => $channel['channel_address'], - '$wikis' => $wikis['wikis'] - )); - } - return ''; - } - -} diff --git a/Zotlabs/Widget/Wiki_page_history.php b/Zotlabs/Widget/Wiki_page_history.php deleted file mode 100644 index 3c9f5ed1a..000000000 --- a/Zotlabs/Widget/Wiki_page_history.php +++ /dev/null @@ -1,36 +0,0 @@ - \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( - '$pageHistory' => $pageHistory['history'], - '$permsWrite' => $arr['permsWrite'], - '$name_lbl' => t('Name'), - '$msg_label' => t('Message','wiki_history'), - '$date_lbl' => t('Date'), - '$revert_btn' => t('Revert'), - '$compare_btn' => t('Compare') - )); - - } -} diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php deleted file mode 100644 index ece712334..000000000 --- a/Zotlabs/Widget/Wiki_pages.php +++ /dev/null @@ -1,110 +0,0 @@ - $w['resource_id'], - 'channel_id' => $c['channel_id'], - 'channel_address' => $c['channel_address'], - 'refresh' => false - ); - - $can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_wiki'); - - $can_delete = ((local_channel() && (local_channel() == \App::$profile['uid'])) ? true : false); - $pageName = NativeWiki::name_decode(escape_tags(argv(3))); - - $wikiname = $w['urlName']; - return replace_macros(get_markup_template('wiki_page_not_found.tpl'), array( - '$resource_id' => $arr['resource_id'], - '$channel_address' => $arr['channel_address'], - '$wikiname' => $wikiname, - '$canadd' => $can_create, - '$candel' => $can_delete, - '$addnew' => t('Add new page'), - '$typelock' => $typelock, - '$lockedtype' => $w['mimeType'], - '$mimetype' => mimetype_select(0,$w['mimeType'], - [ 'text/markdown' => t('Markdown'), 'text/bbcode' => t('BBcode'), 'text/plain' => t('Text') ]), - '$pageName' => array('missingPageName', 'Create Page' , $pageName), - '$refresh' => $arr['refresh'], - '$options' => t('Options'), - '$submit' => t('Submit') - )); - } - - function widget($arr) { - - if(argc() < 3) - return; - - if(! $arr['resource_id']) { - $c = channelx_by_nick(argv(1)); - $w = \Zotlabs\Lib\NativeWiki::exists_by_name($c['channel_id'],NativeWiki::name_decode(argv(2))); - $arr = array( - 'resource_id' => $w['resource_id'], - 'channel_id' => $c['channel_id'], - 'channel_address' => $c['channel_address'], - 'refresh' => false - ); - } - - $wikiname = ''; - - $pages = array(); - - $p = \Zotlabs\Lib\NativeWikiPage::page_list($arr['channel_id'],get_observer_hash(),$arr['resource_id']); - - if($p['pages']) { - $pages = $p['pages']; - $w = $p['wiki']; - // Wiki item record is $w['wiki'] - $wikiname = $w['urlName']; - if (!$wikiname) { - $wikiname = ''; - } - $typelock = $w['typelock']; - } - - $can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_wiki'); - - $can_delete = ((local_channel() && (local_channel() == \App::$profile['uid'])) ? true : false); - - return replace_macros(get_markup_template('wiki_page_list.tpl'), array( - '$resource_id' => $arr['resource_id'], - '$header' => t('Wiki Pages'), - '$channel_address' => $arr['channel_address'], - '$wikiname' => $wikiname, - '$pages' => $pages, - '$canadd' => $can_create, - '$candel' => $can_delete, - '$addnew' => t('Add new page'), - '$typelock' => $typelock, - '$lockedtype' => $w['mimeType'], - '$mimetype' => mimetype_select(0,$w['mimeType'], - [ 'text/markdown' => t('Markdown'), 'text/bbcode' => t('BBcode'), 'text/plain' => t('Text') ]), - '$pageName' => array('pageName', t('Page name')), - '$refresh' => $arr['refresh'], - '$options' => t('Options'), - '$submit' => t('Submit') - )); - } -} - - -- cgit v1.2.3