streams/Zotlabs/Widget/Collections.php

56 lines
1 KiB
PHP
Raw Normal View History

2017-03-16 01:31:34 +00:00
<?php
namespace Zotlabs\Widget;
2019-06-04 00:57:47 +00:00
use App;
use Zotlabs\Lib\AccessList;
2017-03-16 01:31:34 +00:00
class Collections {
function widget($args) {
2018-06-17 14:58:12 +00:00
if(argc() < 2)
return;
2017-03-16 01:31:34 +00:00
$mode = ((array_key_exists('mode',$args)) ? $args['mode'] : 'conversation');
switch($mode) {
case 'conversation':
$every = argv(0);
$each = argv(0);
$edit = true;
$current = $_REQUEST['gid'];
$abook_id = 0;
$wmode = 0;
break;
case 'connections':
$every = 'connections';
2019-10-02 02:03:48 +00:00
$each = 'lists';
2017-03-16 01:31:34 +00:00
$edit = true;
$current = $_REQUEST['gid'];
$abook_id = 0;
$wmode = 0;
case 'groups':
$every = 'connections';
$each = argv(0);
$edit = false;
$current = intval(argv(1));
$abook_id = 0;
$wmode = 1;
break;
case 'abook':
$every = 'connections';
2019-10-02 02:03:48 +00:00
$each = 'lists';
2017-03-16 01:31:34 +00:00
$edit = false;
$current = 0;
2019-06-04 00:57:47 +00:00
$abook_id = App::$poi['abook_xchan'];
2017-03-16 01:31:34 +00:00
$wmode = 1;
break;
default:
return '';
break;
}
return AccessList::widget($every, $each, $edit, $current, $abook_id, $wmode);
2017-03-16 01:31:34 +00:00
}
}