1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- defined('GNUSOCIAL') || die();
- function gnusocial_profile_merge(&$profile)
- {
- $responses = GNUsocialProfileExtensionResponse::findResponsesByProfile($profile->id);
- $profile->customfields = [];
- foreach ($responses as $response) {
- $title = $response->systemname;
- $profile->$title = $response->value;
- $profile->customfields[] = $title;
- }
- }
- function gnusocial_field_systemname_validate($systemname)
- {
-
- $fields = GNUsocialProfileExtensionField::allFields();
- foreach ($fields as $field) {
- if ($field->systemname == $systemname) {
- return false;
- }
- }
-
- return ctype_alnum($systemname);
- }
|