aboutsummaryrefslogtreecommitdiffstats
path: root/mod/connedit.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/connedit.php')
-rw-r--r--mod/connedit.php42
1 files changed, 38 insertions, 4 deletions
diff --git a/mod/connedit.php b/mod/connedit.php
index b9b7fcce3..61bb62766 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -1,5 +1,11 @@
<?php
+/* @file connedit.php
+ * @brief In this file the connection-editor form is generated and evaluated.
+ *
+ *
+ */
+
require_once('include/Contact.php');
require_once('include/socgraph.php');
require_once('include/contact_selectors.php');
@@ -8,6 +14,11 @@ require_once('include/contact_widgets.php');
require_once('include/zot.php');
require_once('include/widgets.php');
+/* @brief Initialize the connection-editor
+ *
+ *
+ */
+
function connedit_init(&$a) {
if(! local_user())
@@ -31,6 +42,10 @@ function connedit_init(&$a) {
}
+/* @brief Evaluate posted values and set changes
+ *
+ */
+
function connedit_post(&$a) {
if(! local_user())
@@ -81,7 +96,7 @@ function connedit_post(&$a) {
if(strpos($k,'perms_') === 0) {
$abook_my_perms += $v;
}
- }
+ }
$abook_flags = $orig_record[0]['abook_flags'];
$new_friend = false;
@@ -103,6 +118,15 @@ function connedit_post(&$a) {
intval(local_user())
);
+ if($orig_record[0]['abook_profile'] != $profile_id) { //Update profile photo permissions
+
+ logger('As a new profile was assigned updateing profile photos');
+ require_once('mod/profile_photo.php');
+ profile_photo_set_profile_perms($profile_id);
+
+ }
+
+
if($r)
info( t('Connection updated.') . EOL);
else
@@ -114,7 +138,7 @@ function connedit_post(&$a) {
}
if($new_friend) {
- $channel = $a->get_channel();
+ $channel = $a->get_channel();
$default_group = $channel['channel_default_group'];
if($default_group) {
require_once('include/group.php');
@@ -158,6 +182,11 @@ function connedit_post(&$a) {
}
+/* @brief Clone connection
+ *
+ *
+ */
+
function connedit_clone(&$a) {
if(! $a->poi)
@@ -171,6 +200,10 @@ function connedit_clone(&$a) {
build_sync_packet(0 /* use the current local_user */, array('abook' => array($clone)));
}
+/* @brief Generate content of connection edit page
+ *
+ *
+ */
function connedit_content(&$a) {
@@ -298,7 +331,7 @@ function connedit_content(&$a) {
contact_remove(local_user(), $orig_record[0]['abook_id']);
// FIXME - send to clones
- info( t('Contact has been removed.') . EOL );
+ info( t('Connection has been removed.') . EOL );
if(x($_SESSION,'return_url'))
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
goaway($a->get_baseurl(true) . '/contacts');
@@ -316,7 +349,7 @@ function connedit_content(&$a) {
array(
'label' => t('View Profile'),
- 'url' => $a->get_baseurl(true) . '/chanview/?f=&cid=' . $contact['abook_id'],
+ 'url' => chanlink_cid($contact['abook_id']),
'sel' => '',
'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']),
),
@@ -449,6 +482,7 @@ function connedit_content(&$a) {
'$them' => t('Their Settings'),
'$me' => t('My Settings'),
'$perms' => $perms,
+ '$clear' => t('Clear/Disable Automatic Permissions'),
'$forum' => t('Forum Members'),
'$soapbox' => t('Soapbox'),
'$full' => t('Full Sharing (typical social network permissions)'),