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