comanchify connedit, group

This commit is contained in:
friendica 2013-12-19 23:56:37 -08:00
parent cd78f9d13d
commit 2c0fbc508e
6 changed files with 42 additions and 28 deletions

View file

@ -229,7 +229,7 @@ function mini_group_select($uid,$group = '') {
function group_side($every="contacts",$each="group",$edit = false, $group_id = 0, $cid = '',$mode = 1) {
function group_side($every="connections",$each="group",$edit = false, $group_id = 0, $cid = '',$mode = 1) {
$o = '';

View file

@ -34,10 +34,39 @@ function widget_tagcloud($args) {
function widget_collections($args) {
require_once('include/group.php');
$page = argv(0);
$gid = $_REQUEST['gid'];
return group_side($page,$page,true,$_REQUEST['gid'],'',0);
$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 '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 = get_app()->poi['abook_xchan'];
$wmode = 1;
break;
default:
return '';
break;
}
return group_side($every, $each, $edit, $current, $abook_id, $wmode);
}

View file

@ -31,24 +31,6 @@ function connedit_init(&$a) {
}
function connedit_aside(&$a) {
if (! local_user())
return;
if($a->poi) {
$a->set_widget('vcard',vcard_from_xchan($a->poi,$a->get_observer()));
$a->set_widget('collections', group_side('connections','group',false,0,$a->poi['abook_xchan']));
}
$a->set_widget('suggest',widget_suggestions(array()));
$a->set_widget('findpeople',findpeople_widget());
}
function connedit_post(&$a) {
if(! local_user())

View file

@ -2,12 +2,6 @@
require_once('include/group.php');
function group_aside(&$a) {
if(local_user()) {
$a->set_widget('groups_edit',group_side('connections','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0)));
}
}
function group_post(&$a) {

View file

@ -0,0 +1,6 @@
[region=aside]
[widget=vcard][/widget]
[widget=collections][var=mode]abook[/var][/widget]
[widget=suggestions][/widget]
[widget=findpeople][/widget]
[/region]

3
view/pdl/mod_group.pdl Normal file
View file

@ -0,0 +1,3 @@
[region=aside]
[widget=collections][var=mode]groups[/var][/widget]
[/region]