aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Collections.php
blob: ad1a10f4b34493a80bde23fd6e616c436871dbef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php

namespace Zotlabs\Widget;

use Zotlabs\Lib\AccessList;

class Collections {

	function widget($args) {

		if(argc() < 2)
		//	return;

		$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 = 'group';
					$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';
					$each = 'group';
					$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);
	}
}