]> git.mxchange.org Git - friendica.git/blob - mod/nogroup.php
Change called method names
[friendica.git] / mod / nogroup.php
1 <?php
2 /**
3  * @file mod/nogroup.php
4  */
5 use Friendica\App;
6 use Friendica\Database\DBM;
7 use Friendica\Object\Contact;
8
9 require_once 'include/Contact.php';
10 require_once 'include/contact_selectors.php';
11
12 function nogroup_init(App $a)
13 {
14         if (! local_user()) {
15                 return;
16         }
17
18         require_once 'include/group.php';
19         require_once 'include/contact_widgets.php';
20
21         if (! x($a->page, 'aside')) {
22                 $a->page['aside'] = '';
23         }
24
25         $a->page['aside'] .= group_side('contacts', 'group', 'extended', 0, $contact_id);
26 }
27
28 function nogroup_content(App $a)
29 {
30         if (! local_user()) {
31                 notice(t('Permission denied.') . EOL);
32                 return '';
33         }
34
35         require_once 'include/Contact.php';
36         $r = Contact::getUngroupedList(local_user());
37         if (DBM::is_result($r)) {
38                 $a->set_pager_total($r[0]['total']);
39         }
40         $r = Contact::getUngroupedList(local_user(), $a->pager['start'], $a->pager['itemspage']);
41         if (DBM::is_result($r)) {
42                 foreach ($r as $rr) {
43                         $contact_details = Contact::getDetailsByURL($rr['url'], local_user(), $rr);
44
45                         $contacts[] = array(
46                                 'img_hover' => sprintf(t('Visit %s\'s profile [%s]'), $contact_details['name'], $rr['url']),
47                                 'edit_hover' => t('Edit contact'),
48                                 'photo_menu' => Contact::photoMenu($rr),
49                                 'id' => $rr['id'],
50                                 'alt_text' => $alt_text,
51                                 'dir_icon' => $dir_icon,
52                                 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
53                                 'name' => $contact_details['name'],
54                                 'username' => $contact_details['name'],
55                                 'details'       => $contact_details['location'],
56                                 'tags'          => $contact_details['keywords'],
57                                 'about'         => $contact_details['about'],
58                                 'sparkle' => $sparkle,
59                                 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
60                                 'url' => $url,
61                                 'network' => network_to_name($rr['network'], $url),
62                         );
63                 }
64         }
65
66         $tpl = get_markup_template("nogroup-template.tpl");
67         $o .= replace_macros(
68                 $tpl,
69                 array(
70                 '$header' => t('Contacts who are not members of a group'),
71                 '$contacts' => $contacts,
72                 '$paginate' => paginate($a))
73         );
74
75         return $o;
76 }