Remove usage of profile.gender
This commit is contained in:
parent
a7dd0173a7
commit
8e2910976f
10 changed files with 25 additions and 201 deletions
|
@ -1181,54 +1181,6 @@ Mutually exclusive with <code>link</code>.
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>hometown</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>gender</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>marital</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>marital_with</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>marital_since</code></td>
|
|
||||||
<td>String (Date)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>sexual</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>politic</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>religion</code></td>
|
|
||||||
<td>String</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>public_keywords</code></td>
|
<td><code>public_keywords</code></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
|
@ -1241,90 +1193,12 @@ Mutually exclusive with <code>link</code>.
|
||||||
<td>Comma-separated list of words meant to be used for search only.</td>
|
<td>Comma-separated list of words meant to be used for search only.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>likes</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>dislikes</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>about</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>music</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>book</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>tv</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>film</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>interest</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>romance</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>work</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>education</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>social_networks</code></td>
|
|
||||||
<td>String (Plaintext)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>homepage</code></td>
|
<td><code>homepage</code></td>
|
||||||
<td>String (URL)</td>
|
<td>String (URL)</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>users</code></td>
|
|
||||||
<td>List of <a href="help/API-Entities#Contact">Contacts</a></td>
|
|
||||||
<td>If populated, only these contacts have access to the profile.</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -695,9 +695,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
|
||||||
### src/Content/ContactSelector.php
|
### src/Content/ContactSelector.php
|
||||||
|
|
||||||
Hook::callAll('network_to_name', $nets);
|
Hook::callAll('network_to_name', $nets);
|
||||||
Hook::callAll('gender_selector', $select);
|
|
||||||
Hook::callAll('sexpref_selector', $select);
|
|
||||||
Hook::callAll('marital_selector', $select);
|
|
||||||
|
|
||||||
### src/Content/OEmbed.php
|
### src/Content/OEmbed.php
|
||||||
|
|
||||||
|
|
|
@ -16,29 +16,29 @@ Table profile
|
||||||
| region | | varchar(255) | NO | | | |
|
| region | | varchar(255) | NO | | | |
|
||||||
| postal-code | | varchar(32) | NO | | | |
|
| postal-code | | varchar(32) | NO | | | |
|
||||||
| country-name | | varchar(255) | NO | | | |
|
| country-name | | varchar(255) | NO | | | |
|
||||||
| hometown | | varchar(255) | NO | MUL | | |
|
| hometown | Deprecated | varchar(255) | NO | MUL | | |
|
||||||
| gender | | varchar(32) | NO | | | |
|
| gender | Deprecated | varchar(32) | NO | | | |
|
||||||
| marital | | varchar(255) | NO | | | |
|
| marital | Deprecated | varchar(255) | NO | | | |
|
||||||
| with | | text | NO | | NULL | |
|
| with | Deprecated | text | NO | | NULL | |
|
||||||
| howlong | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| howlong | Deprecated | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| sexual | | varchar(255) | NO | | | |
|
| sexual | Deprecated | varchar(255) | NO | | | |
|
||||||
| politic | | varchar(255) | NO | | | |
|
| politic | Deprecated | varchar(255) | NO | | | |
|
||||||
| religion | | varchar(255) | NO | | | |
|
| religion | Deprecated | varchar(255) | NO | | | |
|
||||||
| pub_keywords | | text | NO | | NULL | |
|
| pub_keywords | | text | NO | | NULL | |
|
||||||
| prv_keywords | | text | NO | | NULL | |
|
| prv_keywords | | text | NO | | NULL | |
|
||||||
| likes | | text | NO | | NULL | |
|
| likes | Deprecated | text | NO | | NULL | |
|
||||||
| dislikes | | text | NO | | NULL | |
|
| dislikes | Deprecated | text | NO | | NULL | |
|
||||||
| about | | text | NO | | NULL | |
|
| about | Deprecated | text | NO | | NULL | |
|
||||||
| summary | | varchar(255) | NO | | | |
|
| summary | Deprecated | varchar(255) | NO | | | |
|
||||||
| music | | text | NO | | NULL | |
|
| music | Deprecated | text | NO | | NULL | |
|
||||||
| book | | text | NO | | NULL | |
|
| book | Deprecated | text | NO | | NULL | |
|
||||||
| tv | | text | NO | | NULL | |
|
| tv | Deprecated | text | NO | | NULL | |
|
||||||
| film | | text | NO | | NULL | |
|
| film | Deprecated | text | NO | | NULL | |
|
||||||
| interest | | text | NO | | NULL | |
|
| interest | Deprecated | text | NO | | NULL | |
|
||||||
| romance | | text | NO | | NULL | |
|
| romance | Deprecated | text | NO | | NULL | |
|
||||||
| work | | text | NO | | NULL | |
|
| work | Deprecated | text | NO | | NULL | |
|
||||||
| education | | text | NO | | NULL | |
|
| education | Deprecated | text | NO | | NULL | |
|
||||||
| contact | | text | NO | | NULL | |
|
| contact | Deprecated | text | NO | | NULL | |
|
||||||
| homepage | | varchar(255) | NO | | | |
|
| homepage | | varchar(255) | NO | | | |
|
||||||
| photo | | varchar(255) | NO | | | |
|
| photo | | varchar(255) | NO | | | |
|
||||||
| thumb | | varchar(255) | NO | | | |
|
| thumb | | varchar(255) | NO | | | |
|
||||||
|
|
|
@ -408,9 +408,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
|
||||||
### src/Content/ContactSelector.php
|
### src/Content/ContactSelector.php
|
||||||
|
|
||||||
Hook::callAll('network_to_name', $nets);
|
Hook::callAll('network_to_name', $nets);
|
||||||
Hook::callAll('gender_selector', $select);
|
|
||||||
Hook::callAll('sexpref_selector', $select);
|
|
||||||
Hook::callAll('marital_selector', $select);
|
|
||||||
|
|
||||||
### src/Content/OEmbed.php
|
### src/Content/OEmbed.php
|
||||||
|
|
||||||
|
|
|
@ -196,46 +196,6 @@ class ContactSelector
|
||||||
return $network_icon;
|
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 gender($current = "", $suffix = "")
|
|
||||||
{
|
|
||||||
$o = '';
|
|
||||||
$select = [
|
|
||||||
'' => DI::l10n()->t('No answer'),
|
|
||||||
'Male' => DI::l10n()->t('Male'),
|
|
||||||
'Female' => DI::l10n()->t('Female'),
|
|
||||||
'Currently Male' => DI::l10n()->t('Currently Male'),
|
|
||||||
'Currently Female' => DI::l10n()->t('Currently Female'),
|
|
||||||
'Mostly Male' => DI::l10n()->t('Mostly Male'),
|
|
||||||
'Mostly Female' => DI::l10n()->t('Mostly Female'),
|
|
||||||
'Transgender' => DI::l10n()->t('Transgender'),
|
|
||||||
'Intersex' => DI::l10n()->t('Intersex'),
|
|
||||||
'Transsexual' => DI::l10n()->t('Transsexual'),
|
|
||||||
'Hermaphrodite' => DI::l10n()->t('Hermaphrodite'),
|
|
||||||
'Neuter' => DI::l10n()->t('Neuter'),
|
|
||||||
'Non-specific' => DI::l10n()->t('Non-specific'),
|
|
||||||
'Other' => DI::l10n()->t('Other'),
|
|
||||||
'Undecided' => DI::l10n()->t('Undecided'),
|
|
||||||
];
|
|
||||||
|
|
||||||
Hook::callAll('gender_selector', $select);
|
|
||||||
|
|
||||||
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
|
|
||||||
foreach ($select as $neutral => $selection) {
|
|
||||||
if ($selection !== 'NOTRANSLATION') {
|
|
||||||
$selected = (($neutral == $current) ? ' selected="selected" ' : '');
|
|
||||||
$o .= "<option value=\"$neutral\" $selected >$selection</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$o .= '</select>';
|
|
||||||
return $o;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $current optional, default empty
|
* @param string $current optional, default empty
|
||||||
* @param string $suffix optionsl, default empty
|
* @param string $suffix optionsl, default empty
|
||||||
|
|
|
@ -722,7 +722,7 @@ class Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region',
|
$fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region',
|
||||||
'country-name', 'gender', 'pub_keywords', 'xmpp', 'net-publish'];
|
'country-name', 'pub_keywords', 'xmpp', 'net-publish'];
|
||||||
$profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
|
$profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
|
||||||
if (!DBA::isResult($profile)) {
|
if (!DBA::isResult($profile)) {
|
||||||
return;
|
return;
|
||||||
|
@ -733,7 +733,7 @@ class Contact
|
||||||
$fields = ['name' => $profile['name'], 'nick' => $user['nickname'],
|
$fields = ['name' => $profile['name'], 'nick' => $user['nickname'],
|
||||||
'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile),
|
'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile),
|
||||||
'about' => $profile['about'], 'keywords' => $profile['pub_keywords'],
|
'about' => $profile['about'], 'keywords' => $profile['pub_keywords'],
|
||||||
'gender' => $profile['gender'], 'contact-type' => $user['account-type'],
|
'gender' => '', 'contact-type' => $user['account-type'],
|
||||||
'xmpp' => $profile['xmpp']];
|
'xmpp' => $profile['xmpp']];
|
||||||
|
|
||||||
$avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
|
$avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
|
||||||
|
|
|
@ -1117,7 +1117,7 @@ class GContact
|
||||||
);
|
);
|
||||||
|
|
||||||
$gcontact = ['name' => $userdata['name'], 'location' => $location, 'about' => $userdata['about'],
|
$gcontact = ['name' => $userdata['name'], 'location' => $location, 'about' => $userdata['about'],
|
||||||
'gender' => $userdata['gender'], 'keywords' => $userdata['pub_keywords'],
|
'gender' => '', 'keywords' => $userdata['pub_keywords'],
|
||||||
'birthday' => $userdata['dob'], 'photo' => $userdata['photo'],
|
'birthday' => $userdata['dob'], 'photo' => $userdata['photo'],
|
||||||
"notify" => $userdata['notify'], 'url' => $userdata['url'],
|
"notify" => $userdata['notify'], 'url' => $userdata['url'],
|
||||||
"hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
|
"hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
|
||||||
|
|
|
@ -919,7 +919,6 @@ class Profile
|
||||||
(`profile`.`locality` LIKE ?) OR
|
(`profile`.`locality` LIKE ?) OR
|
||||||
(`profile`.`region` LIKE ?) OR
|
(`profile`.`region` LIKE ?) OR
|
||||||
(`profile`.`country-name` LIKE ?) OR
|
(`profile`.`country-name` LIKE ?) OR
|
||||||
(`profile`.`gender` LIKE ?) OR
|
|
||||||
(`profile`.`marital` LIKE ?) OR
|
(`profile`.`marital` LIKE ?) OR
|
||||||
(`profile`.`sexual` LIKE ?) OR
|
(`profile`.`sexual` LIKE ?) OR
|
||||||
(`profile`.`about` LIKE ?) OR
|
(`profile`.`about` LIKE ?) OR
|
||||||
|
@ -961,7 +960,6 @@ class Profile
|
||||||
(`profile`.`locality` LIKE ?) OR
|
(`profile`.`locality` LIKE ?) OR
|
||||||
(`profile`.`region` LIKE ?) OR
|
(`profile`.`region` LIKE ?) OR
|
||||||
(`profile`.`country-name` LIKE ?) OR
|
(`profile`.`country-name` LIKE ?) OR
|
||||||
(`profile`.`gender` LIKE ?) OR
|
|
||||||
(`profile`.`marital` LIKE ?) OR
|
(`profile`.`marital` LIKE ?) OR
|
||||||
(`profile`.`sexual` LIKE ?) OR
|
(`profile`.`sexual` LIKE ?) OR
|
||||||
(`profile`.`about` LIKE ?) OR
|
(`profile`.`about` LIKE ?) OR
|
||||||
|
|
|
@ -137,7 +137,6 @@ class Directory extends BaseModule
|
||||||
$location = '';
|
$location = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$gender = (!empty($profile['gender']) ? DI::l10n()->t('Gender:') : false);
|
|
||||||
$marital = (!empty($profile['marital']) ? DI::l10n()->t('Status:') : false);
|
$marital = (!empty($profile['marital']) ? DI::l10n()->t('Status:') : false);
|
||||||
$homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false);
|
$homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false);
|
||||||
$about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false);
|
$about = (!empty($profile['about']) ? DI::l10n()->t('About:') : false);
|
||||||
|
@ -160,7 +159,6 @@ class Directory extends BaseModule
|
||||||
'profile' => $profile,
|
'profile' => $profile,
|
||||||
'location' => $location_e,
|
'location' => $location_e,
|
||||||
'tags' => $contact['pub_keywords'],
|
'tags' => $contact['pub_keywords'],
|
||||||
'gender' => $gender,
|
|
||||||
'pdesc' => $pdesc,
|
'pdesc' => $pdesc,
|
||||||
'marital' => $marital,
|
'marital' => $marital,
|
||||||
'homepage' => $homepage,
|
'homepage' => $homepage,
|
||||||
|
|
|
@ -103,7 +103,7 @@ class NoScrape extends BaseModule
|
||||||
$json_info['last-activity'] = date('o-W', $last_active);
|
$json_info['last-activity'] = date('o-W', $last_active);
|
||||||
|
|
||||||
//These are optional fields.
|
//These are optional fields.
|
||||||
$profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about'];
|
$profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'marital', 'about'];
|
||||||
foreach ($profile_fields as $field) {
|
foreach ($profile_fields as $field) {
|
||||||
if (!empty($a->profile[$field])) {
|
if (!empty($a->profile[$field])) {
|
||||||
$json_info["$field"] = $a->profile[$field];
|
$json_info["$field"] = $a->profile[$field];
|
||||||
|
|
Loading…
Reference in a new issue