]> git.mxchange.org Git - friendica.git/blob - view/contact_selectors.php
more post branch bug fixes
[friendica.git] / view / contact_selectors.php
1 <?php
2
3
4 function contact_profile_assign($current) {
5
6         $o = '';
7         $o .= "<select id=\"contact-profile-selector\" name=\"profile-assign\" />\r\n";
8
9         $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d",
10                         intval($_SESSION['uid']));
11
12         if(count($r)) {
13                 foreach($r as $rr) {
14                         $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : "");
15                         $o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
16                 }
17         }
18         $o .= "</select>\r\n";
19         return $o;
20 }
21
22
23 function contact_reputation($current) {
24
25         $o = '';
26         $o .= "<select id=\"contact-reputation-selector\" name=\"reputation\" />\r\n";
27
28         $rep = array(
29                 0 => t('Unknown | Not categorised'),
30                 1 => t('Block immediately'),
31                 2 => t('Shady, spammer, self-marketer'),
32                 3 => t('Known to me, but no opinion'),
33                 4 => t('OK, probably harmless'),
34                 5 => t('Reputable, has my trust')
35         );
36
37         foreach($rep as $k => $v) {
38                 $selected = (($k == $current) ? " selected=\"selected\" " : "");
39                 $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
40         }
41         $o .= "</select>\r\n";
42         return $o;
43 }
44
45
46 function contact_poll_interval($current) {
47
48         $o = '';
49         $o .= '<select id="contact-poll-interval" name="poll" />' . "\r\n";
50
51         $rep = array(
52                 0 => t('Frequently'),
53                 1 => t('Hourly'),
54                 2 => t('Twice daily'),
55                 3 => t('Daily'),
56                 4 => t('Weekly'),
57                 5 => t('Monthly')
58         );
59
60         foreach($rep as $k => $v) {
61                 $selected = (($k == $current) ? " selected=\"selected\" " : "");
62                 $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
63         }
64         $o .= "</select>\r\n";
65         return $o;
66 }