From 7b0ec6252f1169427068a25bd8655c573af04abc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 23:05:57 -0500 Subject: [PATCH] Remove uses of the rest of deprecated profile fields --- src/Content/ContactSelector.php | 45 +------ src/Model/Contact.php | 2 +- src/Model/Profile.php | 10 -- src/Module/Directory.php | 2 - src/Module/NoScrape.php | 2 +- src/Network/Probe.php | 3 - view/templates/settings/profile/index.tpl | 2 +- view/theme/duepuntozero/style.css | 137 +--------------------- view/theme/quattro/dark/style.css | 16 --- view/theme/quattro/green/style.css | 16 --- view/theme/quattro/lilac/style.css | 16 --- view/theme/quattro/quattro.less | 16 --- view/theme/smoothly/style.css | 21 ---- 13 files changed, 10 insertions(+), 278 deletions(-) diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 2fd9f61fe4..38227bc6e2 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -19,7 +19,7 @@ class ContactSelector /** * @param string $current current * @param boolean $disabled optional, default false - * @return object + * @return string */ public static function pollInterval($current, $disabled = false) { @@ -47,7 +47,7 @@ class ContactSelector /** * @param string $profile Profile URL * @return string Server URL - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ private static function getServerURLForProfile($profile) { @@ -147,7 +147,7 @@ class ContactSelector * @param string $network network * @param string $profile optional, default empty * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ public static function networkToIcon($network, $profile = "") { @@ -195,43 +195,4 @@ class ContactSelector return $network_icon; } - - /** - * @param string $current optional, default empty - * @param string $suffix optionsl, default empty - * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - public static function sexualPreference($current = "", $suffix = "") - { - $o = ''; - $select = [ - '' => DI::l10n()->t('No answer'), - 'Males' => DI::l10n()->t('Males'), - 'Females' => DI::l10n()->t('Females'), - 'Gay' => DI::l10n()->t('Gay'), - 'Lesbian' => DI::l10n()->t('Lesbian'), - 'No Preference' => DI::l10n()->t('No Preference'), - 'Bisexual' => DI::l10n()->t('Bisexual'), - 'Autosexual' => DI::l10n()->t('Autosexual'), - 'Abstinent' => DI::l10n()->t('Abstinent'), - 'Virgin' => DI::l10n()->t('Virgin'), - 'Deviant' => DI::l10n()->t('Deviant'), - 'Fetish' => DI::l10n()->t('Fetish'), - 'Oodles' => DI::l10n()->t('Oodles'), - 'Nonsexual' => DI::l10n()->t('Nonsexual'), - ]; - - Hook::callAll('sexpref_selector', $select); - - $o .= "'; - return $o; - } } diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 112a3f3fb1..7b43145856 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -721,7 +721,7 @@ class Contact return; } - $fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region', + $fields = ['name', 'photo', 'thumb', 'pdesc' => 'about', 'address', 'locality', 'region', 'country-name', 'pub_keywords', 'xmpp', 'net-publish']; $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]); if (!DBA::isResult($profile)) { diff --git a/src/Model/Profile.php b/src/Model/Profile.php index ff1575695d..caf0b0869d 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -913,11 +913,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`sexual` LIKE ?) OR - (`profile`.`about` LIKE ?) OR - (`profile`.`romance` LIKE ?) OR - (`profile`.`work` LIKE ?) OR - (`profile`.`education` LIKE ?) OR (`profile`.`pub_keywords` LIKE ?) OR (`profile`.`prv_keywords` LIKE ?))", $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, @@ -953,11 +948,6 @@ class Profile (`profile`.`locality` LIKE ?) OR (`profile`.`region` LIKE ?) OR (`profile`.`country-name` LIKE ?) OR - (`profile`.`sexual` LIKE ?) OR - (`profile`.`about` LIKE ?) OR - (`profile`.`romance` LIKE ?) OR - (`profile`.`work` LIKE ?) OR - (`profile`.`education` LIKE ?) OR (`profile`.`pub_keywords` LIKE ?) OR (`profile`.`prv_keywords` LIKE ?)) $order LIMIT ?,?", diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 7a6b65cf78..8335fb0cd4 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -138,7 +138,6 @@ class Directory extends BaseModule } $homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false); - $about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false); $location_e = $location; @@ -160,7 +159,6 @@ class Directory extends BaseModule 'tags' => $contact['pub_keywords'], 'pdesc' => $pdesc, 'homepage' => $homepage, - 'about' => $about, 'photo_menu' => $photo_menu, ]; diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 07ecf23d8a..2a705ff6ea 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -103,7 +103,7 @@ class NoScrape extends BaseModule $json_info['last-activity'] = date('o-W', $last_active); //These are optional fields. - $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'about']; + $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name']; foreach ($profile_fields as $field) { if (!empty($a->profile[$field])) { $json_info["$field"] = $a->profile[$field]; diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 4cd32b91ae..91d894d2ee 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -833,9 +833,6 @@ class Probe if (!empty($profile['country'])) { $loc['country-name'] = $profile['country']; } - if (!empty($profile['hometown'])) { - $loc['locality'] = $profile['hometown']; - } $location = Profile::formatLocation($loc); if (!empty($location)) { $data['location'] = $location; diff --git a/view/templates/settings/profile/index.tpl b/view/templates/settings/profile/index.tpl index bf98bb1587..c55928127e 100644 --- a/view/templates/settings/profile/index.tpl +++ b/view/templates/settings/profile/index.tpl @@ -64,7 +64,7 @@ -
+
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 3e8151c5ac..b30a7d4ed8 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -733,21 +733,15 @@ input#dfrn-url { #profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-homepage-label, -#profile-edit-hometown-label { +#profile-edit-homepage-label { float: left; width: 175px; } @@ -755,17 +749,12 @@ input#dfrn-url { #profile-edit-profile-name, #profile-edit-name, #profile-edit-pdesc, -#gender-select, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#marital-select, -#sexual-select, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-in-dir-yes, @@ -842,7 +831,7 @@ input#dfrn-url { } -#profile-edit-homepage, #profile-edit-hometown { +#profile-edit-homepage { float: left; margin-bottom: 35px; } @@ -865,24 +854,17 @@ input#dfrn-url { margin-bottom: 20px } -#profile-edit-profile-name-end, #profile-edit-name-end, #profile-edit-pdesc-end, -#profile-edit-gender-end, #profile-edit-dob-end, #profile-edit-address-end, #profile-edit-locality-end, #profile-edit-region-end, #profile-edit-postal-code-end, #profile-edit-country-name-end, -#profile-edit-marital-end, -#profile-edit-sexual-end, -#profile-edit-politic-end, -#profile-edit-religion-end, #profile-edit-pubkeywords-end, #profile-edit-prvkeywords-end, #profile-edit-homepage-end, -#profile-edit-hometown-end, #profile-in-dir-break, #profile-in-dir-end, #profile-in-netdir-break, @@ -909,10 +891,6 @@ input#dfrn-url { } -#gender-select, #marital-select, #sexual-select { - width: 220px; -} - #profile-edit-profile-name-wrapper .required { color: #FF0000; float: left; @@ -1589,113 +1567,6 @@ blockquote.shared_content { } -#advanced-profile-name-wrapper, -#advanced-profile-gender-wrapper, -#advanced-profile-dob-wrapper, -#advanced-profile-age-wrapper, -#advanced-profile-marital-wrapper, -#advanced-profile-sexual-wrapper, -#advanced-profile-homepage-wrapper, -#advanced-profile-politic-wrapper, -#advanced-profile-religion-wrapper, -#advanced-profile-about-wrapper, -#advanced-profile-interest-wrapper, -#advanced-profile-contact-wrapper, -#advanced-profile-music-wrapper, -#advanced-profile-book-wrapper, -#advanced-profile-tv-wrapper, -#advanced-profile-film-wrapper, -#advanced-profile-romance-wrapper, -#advanced-profile-work-wrapper, -#advanced-profile-education-wrapper { - margin-top: 20px; -} - -#advanced-profile-name-text, -#advanced-profile-gender-text, -#advanced-profile-dob-text, -#advanced-profile-age-text, -#advanced-profile-marital-text, -#advanced-profile-sexual-text, -#advanced-profile-homepage-text, -#advanced-profile-politic-text, -#advanced-profile-religion-text, -#advanced-profile-about-text, -#advanced-profile-interest-text, -#advanced-profile-contact-text, -#advanced-profile-music-text, -#advanced-profile-book-text, -#advanced-profile-tv-text, -#advanced-profile-film-text, -#advanced-profile-romance-text, -#advanced-profile-work-text, -#advanced-profile-education-text { - width: 300px; - float: left; -} - -#advanced-profile-name-end, -#advanced-profile-gender-end, -#advanced-profile-dob-end, -#advanced-profile-age-end, -#advanced-profile-marital-end, -#advanced-profile-sexual-end, -#advanced-profile-homepage-end, -#advanced-profile-politic-end, -#advanced-profile-religion-end { - height: 10px; -} - -#advanced-profile-about-end, -#advanced-profile-interest-end, -#advanced-profile-contact-end, -#advanced-profile-music-end, -#advanced-profile-book-end, -#advanced-profile-tv-end, -#advanced-profile-film-end, -#advanced-profile-romance-end, -#advanced-profile-work-end, -#advanced-profile-education-end { - - -} - -#advanced-profile-name, -#advanced-profile-gender, -#advanced-profile-dob, -#advanced-profile-age, -#advanced-profile-marital, -#advanced-profile-sexual, -#advanced-profile-homepage, -#advanced-profile-politic, -#advanced-profile-religion { - float: left; - -} - - -#advanced-profile-about, -#advanced-profile-interest, -#advanced-profile-contact, -#advanced-profile-music, -#advanced-profile-book, -#advanced-profile-tv, -#advanced-profile-film, -#advanced-profile-romance, -#advanced-profile-work, -#advanced-profile-education { - margin-top: 10px; - margin-left: 50px; - margin-right: 20px; - padding: 10px; - border: 1px solid #CCCCCC; -} - -#advanced-profile-with { - float: left; - margin-left: 15px; -} - #contact-edit-wrapper { margin-top: 10px; } @@ -2446,14 +2317,14 @@ aside input[type='text'] { margin-bottom: 25px; } -.location-label, .gender-label, .marital-label, .homepage-label, .network-label { +.location-label, .gender-label, .homepage-label, .network-label { float: left; text-align: right; display: block; width: 65px; } -.adr, .x-gender, .marital-text, .homepage-url, .x-network { +.adr, .homepage-url, .x-network { float: left; display: block; margin-left: 8px; diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index 64e4840e86..5f9e233c98 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, -#profile-edit-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index 40a0c71617..81a30cf088 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, -#profile-edit-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 16887f1e6a..7585877ae2 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -1973,45 +1973,29 @@ ul.tabs li .active { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, -#profile-edit-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index ce5c038d7d..5f435241c9 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -1267,45 +1267,29 @@ ul.tabs { background-color: #FFEEEE; padding: 7px; } -#profile-edit-profile-name-label, #profile-edit-name-label, #profile-edit-pdesc-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, -#profile-edit-with-label, -#profile-edit-sexual-label, -#profile-edit-politic-label, -#profile-edit-religion-label, #profile-edit-pubkeywords-label, #profile-edit-prvkeywords-label, -#profile-edit-gender-select, #profile-edit-homepage-label { float: left; width: 175px; padding-top: 7px; } -#profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-pdesc, -#profile-edit-gender, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#profile-edit-marital, -#profile-edit-with, -#profile-edit-sexual, -#profile-edit-politic, -#profile-edit-religion, #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 52324c0a97..081f1710a9 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -2046,20 +2046,6 @@ pre code { /* = Profile = */ /* =========== */ -.advanced-profile-content { - margin-top: 5px; - margin-bottom: 10px; - margin-left: 30px; - width: 60%; -} - -.advanced-profile-label { - margin-top: 10px; - margin-bottom: 0px; - padding-bottom: 5px; - font-size: 18px; -} - div[id$="wrapper"] { height: 100%; } @@ -2068,10 +2054,6 @@ div[id$="wrapper"] br { clear: left; } -#advanced-profile-with { - margin-left: 20px; -} - #profile-listing-desc, #profile-listing-new-link-wrapper { float: left; @@ -4524,7 +4506,6 @@ hr.line-dots { .location, .location-label, .gender-label, -.marital-label, .homepage-label, .network-label { float: left; @@ -4534,8 +4515,6 @@ hr.line-dots { } .adr, -.x-gender, -.marital-text, .homepage-url, .x-network { float: left;