public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     if ($form->has_field($field_name)) {
         return $form->get_value($field_name)->format(Date::FORMAT_TIMESTAMP);
     }
     return '';
 }
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     if ($form->has_field($field_name)) {
         return (int) $form->get_value($field_name);
     }
     return '';
 }
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     $array = array();
     if ($form->has_field($field_name)) {
         foreach ($form->get_value($field_name) as $field => $value) {
             $array[] = $value->get_label();
         }
     }
     return $this->serialise_value($array);
 }
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     if ($form->has_field($field_name)) {
         $value = $form->get_value($field_name);
         if (!empty($value)) {
             return $value->get_label();
         }
     }
     return '';
 }
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $streams = array();
     foreach ($form->get_value($member_extended_field->get_field_name(), array()) as $field => $option) {
         $streams[] = $option->get_id();
     }
     if (is_array($streams)) {
         NewsletterService::update_subscriptions_member_registered($streams, $member_extended_field->get_user_id());
     }
     $field_name = $member_extended_field->get_field_name();
     $streams = $this->get_streams();
     if (!empty($streams)) {
         $array = array();
         foreach ($form->get_value($field_name) as $field => $option) {
             $array[] = $option->get_id();
         }
         return $this->serialise_value($array);
     }
     return '';
 }
 public function display_field_profile(MemberExtendedField $member_extended_field)
 {
     $fieldset = $member_extended_field->get_fieldset();
     $user_accounts_config = UserAccountsConfig::load();
     $value = $member_extended_field->get_value();
     if (empty($value) && $user_accounts_config->is_default_avatar_enabled()) {
         $avatar = '<img src="' . Url::to_rel('/templates/' . AppContext::get_current_user()->get_theme() . '/images/' . $user_accounts_config->get_default_avatar_name()) . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '" title="' . LangLoader::get_message('avatar', 'user-common') . '" />';
     } elseif (!empty($value)) {
         $avatar = '<img src="' . Url::to_rel($value) . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '" title="' . LangLoader::get_message('avatar', 'user-common') . '" />';
     } else {
         $avatar = $this->lang['extended-field.field.avatar.no_avatar'];
     }
     if (!empty($avatar)) {
         $fieldset->add_field(new FormFieldFree($member_extended_field->get_field_name(), $member_extended_field->get_name(), $avatar));
     }
 }
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     return $form->get_value($field_name);
 }
 public function display_field_profile(MemberExtendedField $member_extended_field)
 {
     $fieldset = $member_extended_field->get_fieldset();
     $value = $member_extended_field->get_value();
     if ($value !== null && !empty($value)) {
         $fieldset->add_field(new FormFieldFree($member_extended_field->get_field_name(), $member_extended_field->get_name(), $this->get_value($member_extended_field, $value)));
     }
 }
 /**
  * {@inheritdoc}
  */
 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     return TextHelper::htmlspecialchars($form->get_value($field_name, ''));
 }
 public function display_field_update(MemberExtendedField $member_extended_field)
 {
     $fieldset = $member_extended_field->get_fieldset();
     $fieldset->add_field(new FormFieldShortMultiLineTextEditor($member_extended_field->get_field_name(), $member_extended_field->get_name(), $member_extended_field->get_value(), array('required' => (bool) $member_extended_field->get_required(), 'rows' => 4, 'cols' => 47, 'description' => $member_extended_field->get_description()), array($this->constraint($member_extended_field->get_regex()))));
 }