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