aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-14 21:27:05 -0800
committerfriendica <info@friendica.com>2012-11-14 21:27:05 -0800
commit5fee78b2150b740581d0060432ec5da5241f2df1 (patch)
treeb9230e6948cc5c3460e9bfd7128bbc6f26637fcc /mod
parent160258fd5deeca6fdee659a8d3471cfbff6a9325 (diff)
downloadvolse-hubzilla-5fee78b2150b740581d0060432ec5da5241f2df1.tar.gz
volse-hubzilla-5fee78b2150b740581d0060432ec5da5241f2df1.tar.bz2
volse-hubzilla-5fee78b2150b740581d0060432ec5da5241f2df1.zip
cleanup
Diffstat (limited to 'mod')
-rw-r--r--mod/connections.php2
-rw-r--r--mod/group.php41
2 files changed, 16 insertions, 27 deletions
diff --git a/mod/connections.php b/mod/connections.php
index d5b4a650c..addebc9cd 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -32,7 +32,7 @@ function connections_aside(&$a) {
$a->set_widget('follow', follow_widget());
$a->set_widget('collections', group_side('connnections','group',false,0,$abook_id));
- $a->set_widget('fidpeople',findpeople_widget());
+ $a->set_widget('findpeople',findpeople_widget());
}
diff --git a/mod/group.php b/mod/group.php
index f62aeb554..ae56da525 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -1,18 +1,13 @@
<?php
-function validate_members(&$item) {
- $item = intval($item);
-}
-
-function group_init(&$a) {
+function group_aside(&$a) {
if(local_user()) {
require_once('include/group.php');
- $a->page['aside'] = group_side('collections','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0));
+ $a->set_widget('groups_edit',group_side('collections','group',false,(($a->argc > 1) ? intval($a->argv[1]) : 0)));
}
}
-
function group_post(&$a) {
if(! local_user()) {
@@ -20,7 +15,7 @@ function group_post(&$a) {
return;
}
- if(($a->argc == 2) && ($a->argv[1] === 'new')) {
+ if((argc() == 2) && (argv(1) === 'new')) {
check_form_security_token_redirectOnErr('/group/new', 'group_edit');
$name = notags(trim($_POST['groupname']));
@@ -36,14 +31,14 @@ function group_post(&$a) {
goaway($a->get_baseurl() . '/group');
}
- if(($a->argc == 2) && (intval($a->argv[1]))) {
+ if((argc() == 2) && (intval(argv(1)))) {
check_form_security_token_redirectOnErr('/group', 'group_edit');
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
- intval($a->argv[1]),
+ intval(argv(1)),
intval(local_user())
);
- if(! count($r)) {
+ if(! $r) {
notice( t('Collection not found.') . EOL );
goaway($a->get_baseurl() . '/connections');
@@ -60,7 +55,7 @@ function group_post(&$a) {
info( t('Collection name changed.') . EOL );
}
- $a->page['aside'] = group_side();
+ goaway(z_root() . '/group/' . argv(1) . '/' . argv(2));
}
return;
}
@@ -84,7 +79,7 @@ function group_content(&$a) {
$tpl = get_markup_template('group_edit.tpl');
$context = array('$submit' => t('Submit'));
- if(($a->argc == 2) && ($a->argv[1] === 'new')) {
+ if((argc() == 2) && (argv(1) === 'new')) {
return replace_macros($tpl, $context + array(
'$title' => t('Create a collection of connections.'),
@@ -96,15 +91,15 @@ function group_content(&$a) {
}
- if(($a->argc == 3) && ($a->argv[1] === 'drop')) {
+ if((argc() == 3) && (argv(1) === 'drop')) {
check_form_security_token_redirectOnErr('/group', 'group_drop', 't');
- if(intval($a->argv[2])) {
+ if(intval(argv(2))) {
$r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
- intval($a->argv[2]),
+ intval(argv(2)),
intval(local_user())
);
- if(count($r))
+ if($r)
$result = group_rmv(local_user(),$r[0]['name']);
if($result)
info( t('Collection removed.') . EOL);
@@ -130,14 +125,14 @@ function group_content(&$a) {
}
- if(($a->argc > 1) && (intval($a->argv[1]))) {
+ if((argc() > 1) && (intval(argv(1)))) {
require_once('include/acl_selectors.php');
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1",
- intval($a->argv[1]),
+ intval(argv(1)),
intval(local_user())
);
- if(! count($r)) {
+ if(! $r) {
notice( t('Collection not found.') . EOL );
goaway($a->get_baseurl() . '/connnections');
}
@@ -151,8 +146,6 @@ function group_content(&$a) {
$preselected[] = $member['xchan_hash'];
}
-
-
if($change) {
if(in_array($change,$preselected)) {
@@ -171,8 +164,6 @@ function group_content(&$a) {
}
}
-
-
$drop_tpl = get_markup_template('group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, array(
'$id' => $group['id'],
@@ -180,8 +171,6 @@ function group_content(&$a) {
'$form_security_token' => get_form_security_token("group_drop"),
));
- $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
-
$context = $context + array(
'$title' => t('Collection Editor'),