X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FContactSelector.php;h=9035d37e73c01d3c838e35c30bbc662e1507acc0;hb=30dcf3380c8c06b2b8b2583e38282857fec41b3c;hp=fcaafb898c5275a51bd35ce200517cfb82f0809b;hpb=745bc7cf3f3990a8887fcc806a16d218f82e35db;p=friendica.git diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index fcaafb898c..9035d37e73 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -1,48 +1,45 @@ . + * */ + namespace Friendica\Content; -use Friendica\Core\Addon; -use Friendica\Database\DBM; -use Friendica\Protocol\Diaspora; -use dba; +use Friendica\Core\Hook; +use Friendica\Core\Protocol; +use Friendica\Database\DBA; +use Friendica\DI; +use Friendica\Util\Network; +use Friendica\Util\Strings; /** - * @brief ContactSelector class + * ContactSelector class */ class ContactSelector { - /** - * @param string $current current - * @param string $foreign_net network - */ - public static function profileAssign($current, $foreign_net) - { - $o = ''; - - $disabled = (($foreign_net) ? ' disabled="true" ' : ''); - - $o .= "\r\n"; - return $o; - } + static $serverdata = []; + static $server_url = []; /** * @param string $current current * @param boolean $disabled optional, default false - * @return object + * @return string */ public static function pollInterval($current, $disabled = false) { @@ -51,12 +48,12 @@ class ContactSelector $o .= ""; - foreach ($select as $selection) { - if ($selection !== 'NOTRANSLATION') { - $selected = (($selection == $current) ? ' selected="selected" ' : ''); - $o .= ""; + if ($network == Protocol::ACTIVITYPUB) { + $networkname .= ' (AP)'; + } } } - $o .= ''; - return $o; - } - - /** - * @param string $current optional, default empty - * @param string $suffix optionsl, default empty - */ - public static function sexualPreference($current = "", $suffix = "") - { - $o = ''; - $select = ['', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')]; - - - Addon::callHooks('sexpref_selector', $select); - - $o .= "'; - return $o; + + return $networkname; } - + /** - * @param string $current optional, default empty + * @param string $network network + * @param string $profile optional, default empty + * @return string + * @throws \Exception */ - public static function maritalStatus($current = "") + public static function networkToIcon($network, $profile = "") { - $o = ''; - $select = ['', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me')]; - - Addon::callHooks('marital_selector', $select); - - $o .= ''; - return $o; + + return $network_icon; } }