]> git.mxchange.org Git - friendica.git/blob - mod/nogroup.php
Class file relocations
[friendica.git] / mod / nogroup.php
1 <?php
2
3 use Friendica\App;
4 use Friendica\Database\DBM;
5
6 require_once('include/Contact.php');
7 require_once('include/socgraph.php');
8 require_once('include/contact_selectors.php');
9
10 function nogroup_init(App $a) {
11
12         if (! local_user()) {
13                 return;
14         }
15
16         require_once('include/group.php');
17         require_once('include/contact_widgets.php');
18
19         if (! x($a->page,'aside')) {
20                 $a->page['aside'] = '';
21         }
22
23         $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
24 }
25
26
27 function nogroup_content(App $a) {
28
29         if (! local_user()) {
30                 notice( t('Permission denied.') . EOL);
31                 return '';
32         }
33
34         require_once('include/Contact.php');
35         $r = contacts_not_grouped(local_user());
36         if (DBM::is_result($r)) {
37                 $a->set_pager_total($r[0]['total']);
38         }
39         $r = contacts_not_grouped(local_user(),$a->pager['start'],$a->pager['itemspage']);
40         if (DBM::is_result($r)) {
41                 foreach ($r as $rr) {
42
43                         $contact_details = get_contact_details_by_url($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_photo_menu($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($tpl, array(
68                 '$header' => t('Contacts who are not members of a group'),
69                 '$contacts' => $contacts,
70                 '$paginate' => paginate($a),
71         ));
72
73         return $o;
74
75 }