]> git.mxchange.org Git - friendica.git/blobdiff - mod/contacts.php
match the documentation
[friendica.git] / mod / contacts.php
index beb1f1ecb82c29f46a7045263e1e264bf1f759af..29ef8a8cd76a24d2d7e416745430f18166a77ac9 100644 (file)
@@ -4,6 +4,8 @@ require_once('include/Contact.php');
 
 function contacts_init(&$a) {
        require_once('include/group.php');
+       if(! x($a->page,'aside'))
+               $a->page['aside'] = '';
        $a->page['aside'] .= group_side();
 
        if($a->config['register_policy'] != REGISTER_CLOSED)
@@ -84,7 +86,12 @@ function contacts_post(&$a) {
 
 function contacts_content(&$a) {
 
+       $sort_type = 0;
+       $o = '';
        $o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>';
+
+       $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
+
        if(! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
@@ -139,6 +146,31 @@ function contacts_content(&$a) {
                }
 
                if($cmd === 'drop') {
+
+                       // create an unfollow slap
+
+                       if($orig_record[0]['network'] === 'stat') {
+                               $tpl = load_view_file('view/follow_slap.tpl');
+                               $slap = replace_macros($tpl, array(
+                                       '$name' => $a->user['username'],
+                                       '$profile_page' => $a->get_baseurl() . '/profile/' . $a->user['nickname'],
+                                       '$photo' => $a->contact['photo'],
+                                       '$thumb' => $a->contact['thumb'],
+                                       '$published' => datetime_convert('UTC','UTC', 'now', ATOM_TIME),
+                                       '$item_id' => 'urn:X-dfrn:' . $a->get_hostname() . ':unfollow:' . random_string(),
+                                       '$title' => '',
+                                       '$type' => 'text',
+                                       '$content' => t('stopped following'),
+                                       '$nick' => $a->user['nickname'],
+                                       '$verb' => ACTIVITY_UNFOLLOW
+                               ));
+
+                               if((x($orig_record[0],'notify')) && (strlen($orig_record[0]['notify']))) {
+                                       require_once('include/salmon.php');
+                                       slapper($a->user,$orig_record[0]['notify'],$slap);
+                               }
+                       }
+
                        contact_remove($contact_id);
                        notice( t('Contact has been removed.') . EOL );
                        goaway($a->get_baseurl() . '/contacts');
@@ -158,9 +190,8 @@ function contacts_content(&$a) {
                        return;
                }
 
-               $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
 
-               require_once('view/contact_selectors.php');
+               require_once('include/contact_selectors.php');
 
                $tpl = load_view_file("view/contact_edit.tpl");
 
@@ -192,7 +223,14 @@ function contacts_content(&$a) {
                }
 
                $o .= replace_macros($tpl,array(
+                       '$header' => t('Contact Editor'),
+                       '$visit' => t('Visit $name\'s profile'),
+                       '$blockunblock' => t('Block/Unblock contact'),
+                       '$ignorecont' => t('Ignore contact'),
+                       '$delete' => t('Delete contact'),
                        '$poll_interval' => contact_poll_interval($r[0]['priority']),
+                       '$lastupdtext' => t('Last updated: '),
+                       '$updpub' => t('Update public posts: '),
                        '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') 
                                ? t('Never') 
                                : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')),
@@ -229,6 +267,7 @@ function contacts_content(&$a) {
 
        $tpl = load_view_file("view/contacts-top.tpl");
        $o .= replace_macros($tpl,array(
+               '$header' => t('Contacts'),
                '$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ),
                '$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')),
                '$search' => $search,