Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.0 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. <?php
  2. function contact_profile_assign($current,$foreign_net) {
  3. $o = '';
  4. $disabled = (($foreign_net) ? ' disabled="true" ' : '');
  5. $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\r\n";
  6. $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d",
  7. intval($_SESSION['uid']));
  8. if(count($r)) {
  9. foreach($r as $rr) {
  10. $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : "");
  11. $o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
  12. }
  13. }
  14. $o .= "</select>\r\n";
  15. return $o;
  16. }
  17. function contact_reputation($current) {
  18. $o = '';
  19. $o .= "<select id=\"contact-reputation-selector\" name=\"reputation\" />\r\n";
  20. $rep = array(
  21. 0 => t('Unknown | Not categorised'),
  22. 1 => t('Block immediately'),
  23. 2 => t('Shady, spammer, self-marketer'),
  24. 3 => t('Known to me, but no opinion'),
  25. 4 => t('OK, probably harmless'),
  26. 5 => t('Reputable, has my trust')
  27. );
  28. foreach($rep as $k => $v) {
  29. $selected = (($k == $current) ? " selected=\"selected\" " : "");
  30. $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
  31. }
  32. $o .= "</select>\r\n";
  33. return $o;
  34. }
  35. function contact_poll_interval($current, $disabled = false) {
  36. $dis = (($disabled) ? ' disabled="disabled" ' : '');
  37. $o = '';
  38. $o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
  39. $rep = array(
  40. 0 => t('Frequently'),
  41. 1 => t('Hourly'),
  42. 2 => t('Twice daily'),
  43. 3 => t('Daily'),
  44. 4 => t('Weekly'),
  45. 5 => t('Monthly')
  46. );
  47. foreach($rep as $k => $v) {
  48. $selected = (($k == $current) ? " selected=\"selected\" " : "");
  49. $o .= "<option value=\"$k\" $selected >$v</option>\r\n";
  50. }
  51. $o .= "</select>\r\n";
  52. return $o;
  53. }
  54. function network_to_name($s) {
  55. call_hooks('network_to_name', $s);
  56. return str_replace(array(NETWORK_DFRN,NETWORK_OSTATUS,NETWORK_FEED,NETWORK_MAIL,NETWORK_DIASPORA,NETWORK_FACEBOOK,NETWORK_ZOT),
  57. array(t('Friendika'),t('OStatus'),t('RSS/Atom'),t('Email'),t('Diaspora'),t('Facebook'),t('Zot!')),$s);
  58. }