2017-03-16 01:31:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zotlabs\Widget;
|
2019-06-04 00:57:47 +00:00
|
|
|
|
|
|
|
use App;
|
2019-02-14 23:26:37 +00:00
|
|
|
use Zotlabs\Lib\AccessList;
|
2017-03-16 01:31:34 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class Collections
|
|
|
|
{
|
2017-03-16 01:31:34 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
public function widget($args)
|
|
|
|
{
|
2017-03-16 01:31:34 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
// if(argc() < 2)
|
|
|
|
// return;
|
2018-06-17 14:58:12 +00:00
|
|
|
|
2021-12-02 23:02:31 +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';
|
|
|
|
$each = 'lists';
|
|
|
|
$edit = true;
|
|
|
|
$current = 0;
|
|
|
|
$abook_id = 0;
|
|
|
|
$wmode = 1;
|
|
|
|
break;
|
|
|
|
case 'groups':
|
|
|
|
$every = 'connections';
|
|
|
|
$each = argv(0);
|
|
|
|
$edit = false;
|
|
|
|
$current = intval(argv(1));
|
|
|
|
$abook_id = 0;
|
|
|
|
$wmode = 1;
|
|
|
|
break;
|
|
|
|
case 'abook':
|
|
|
|
$every = 'connections';
|
|
|
|
$each = 'lists';
|
|
|
|
$edit = false;
|
|
|
|
$current = 0;
|
|
|
|
$abook_id = App::$poi['abook_xchan'];
|
|
|
|
$wmode = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return '';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return AccessList::widget($every, $each, $edit, $current, $abook_id, $wmode);
|
|
|
|
}
|
2017-03-16 01:31:34 +00:00
|
|
|
}
|