mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 22:15:15 +00:00
stream order widget
This commit is contained in:
parent
e2e4dd6f2c
commit
bd1fa5c360
4 changed files with 31 additions and 19 deletions
|
@ -82,24 +82,29 @@ class ActivityStreams {
|
|||
if($this->ldsig) {
|
||||
$this->signer = $this->get_compound_property('creator',$this->ldsig);
|
||||
if($this->signer && $this->signer['publicKey'] && $this->signer['publicKey']['publicKeyPem']) {
|
||||
$this->sigok = \Zotlabs\Lib\LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']);
|
||||
$this->sigok = LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']);
|
||||
}
|
||||
}
|
||||
|
||||
if(! $this->obj) {
|
||||
$this->obj = $this->data;
|
||||
$this->type = 'Create';
|
||||
if(! $this->actor) {
|
||||
$this->actor = $this->get_actor('attributedTo',$this->obj);
|
||||
}
|
||||
}
|
||||
|
||||
if($this->obj && $this->obj['actor'])
|
||||
$this->obj['actor'] = $this->get_actor('actor',$this->obj);
|
||||
if($this->tgt && $this->tgt['actor'])
|
||||
$this->tgt['actor'] = $this->get_actor('actor',$this->tgt);
|
||||
|
||||
|
||||
if(! $this->obj) {
|
||||
$this->obj = $this->data;
|
||||
$this->type = 'Create';
|
||||
}
|
||||
|
||||
$this->parent_id = $this->get_property_obj('inReplyTo');
|
||||
if(! $this->parent_id) {
|
||||
$this->parent_id = $this->id;
|
||||
$this->parent_id = $this->get_property_obj('inReplyTo',$this->obj);
|
||||
}
|
||||
if(! $this->parent_id) {
|
||||
$this->parent_id = $this->obj['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -333,6 +333,7 @@ class Apps {
|
|||
'Poke' => t('Poke'),
|
||||
'Chat' => t('Chat'),
|
||||
'Search' => t('Search'),
|
||||
'Stream Order' => t('Stream Order'),
|
||||
'Probe' => t('Probe'),
|
||||
'Suggest' => t('Suggest'),
|
||||
'Random Channel' => t('Random Channel'),
|
||||
|
|
|
@ -2,15 +2,21 @@
|
|||
|
||||
namespace Zotlabs\Widget;
|
||||
|
||||
class Activity_order {
|
||||
use Zotlabs\Lib\Apps;
|
||||
use App;
|
||||
|
||||
class Stream_order {
|
||||
|
||||
function widget($arr) {
|
||||
|
||||
if(! local_channel())
|
||||
return '';
|
||||
|
||||
if(! feature_enabled(local_channel(),'order_tab')) {
|
||||
set_pconfig(local_channel(), 'mod_network', 'order', 0);
|
||||
$module = 'mod_' . App::$module;
|
||||
|
||||
|
||||
if(! Apps::addon_app_installed(local_channel(),'stream_order')) {
|
||||
set_pconfig(local_channel(), $module, 'order', 0);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -22,15 +28,15 @@ class Activity_order {
|
|||
switch($_GET['order']){
|
||||
case 'post':
|
||||
$postord_active = 'active';
|
||||
set_pconfig(local_channel(), 'mod_network', 'order', 1);
|
||||
set_pconfig(local_channel(), $module, 'order', 1);
|
||||
break;
|
||||
case 'comment':
|
||||
$commentord_active = 'active';
|
||||
set_pconfig(local_channel(), 'mod_network', 'order', 0);
|
||||
set_pconfig(local_channel(), $module, 'order', 0);
|
||||
break;
|
||||
case 'unthreaded':
|
||||
$unthreaded_active = 'active';
|
||||
set_pconfig(local_channel(), 'mod_network', 'order', 2);
|
||||
set_pconfig(local_channel(), $module, 'order', 2);
|
||||
break;
|
||||
default:
|
||||
$commentord_active = 'active';
|
||||
|
@ -38,7 +44,7 @@ class Activity_order {
|
|||
}
|
||||
}
|
||||
else {
|
||||
$order = get_pconfig(local_channel(), 'mod_network', 'order', 0);
|
||||
$order = get_pconfig(local_channel(), $module, 'order', 0);
|
||||
switch($order) {
|
||||
case 0:
|
||||
$commentord_active = 'active';
|
||||
|
@ -60,7 +66,7 @@ class Activity_order {
|
|||
$commentord_active = $postord_active = 'disabled';
|
||||
}
|
||||
|
||||
$cmd = \App::$cmd;
|
||||
$cmd = App::$cmd;
|
||||
|
||||
$filter = '';
|
||||
|
||||
|
@ -110,7 +116,7 @@ class Activity_order {
|
|||
|
||||
$arr = ['tabs' => $tabs];
|
||||
|
||||
call_hooks('network_tabs', $arr);
|
||||
call_hooks('stream_order_tabs', $arr);
|
||||
|
||||
$o = '';
|
||||
|
||||
|
@ -120,7 +126,7 @@ class Activity_order {
|
|||
]);
|
||||
|
||||
$o = replace_macros(get_markup_template('common_widget.tpl'), [
|
||||
'$title' => t('Activity Order'),
|
||||
'$title' => t('Stream Order'),
|
||||
'$content' => $content,
|
||||
]);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
[region=aside]
|
||||
[widget=activity_order][/widget]
|
||||
[widget=stream_order][/widget]
|
||||
[widget=activity_filter][/widget]
|
||||
[widget=savedsearch][/widget]
|
||||
[widget=suggestions][/widget]
|
||||
|
|
Loading…
Reference in a new issue