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