aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/group.php2
-rw-r--r--include/widgets.php35
-rw-r--r--mod/connedit.php18
-rw-r--r--mod/group.php6
-rw-r--r--view/pdl/mod_connedit.pdl6
-rw-r--r--view/pdl/mod_group.pdl3
6 files changed, 42 insertions, 28 deletions
diff --git a/include/group.php b/include/group.php
index 8f690785d..c19c83c80 100644
--- a/include/group.php
+++ b/include/group.php
@@ -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 = '';
diff --git a/include/widgets.php b/include/widgets.php
index 5bb937c2e..2591a9d09 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -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);
}
diff --git a/mod/connedit.php b/mod/connedit.php
index c6c8845c8..e2d4b861c 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -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())
diff --git a/mod/group.php b/mod/group.php
index 5a34ab6fb..352484e25 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -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) {
diff --git a/view/pdl/mod_connedit.pdl b/view/pdl/mod_connedit.pdl
new file mode 100644
index 000000000..4b468e34c
--- /dev/null
+++ b/view/pdl/mod_connedit.pdl
@@ -0,0 +1,6 @@
+[region=aside]
+[widget=vcard][/widget]
+[widget=collections][var=mode]abook[/var][/widget]
+[widget=suggestions][/widget]
+[widget=findpeople][/widget]
+[/region]
diff --git a/view/pdl/mod_group.pdl b/view/pdl/mod_group.pdl
new file mode 100644
index 000000000..8db29cf78
--- /dev/null
+++ b/view/pdl/mod_group.pdl
@@ -0,0 +1,3 @@
+[region=aside]
+[widget=collections][var=mode]groups[/var][/widget]
+[/region]