. * * @category Widget * @package GNU Social * @author Max Shinn * @copyright 2010 Free Software Foundation, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 */ function gnusocial_profile_merge(&$profile) { $responses = GNUsocialProfileExtensionResponse::findResponsesByProfile($profile->id); $profile->customfields = array(); 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_alphanum($systemname); }