public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $options = array(); $default_values = explode('|', $member_extended_field->get_value()); foreach ($member_extended_field->get_possible_values() as $name => $parameters) { $options[] = new FormFieldMultipleCheckboxOption($name, stripslashes($parameters['title'])); } $fieldset->add_field(new FormFieldMultipleCheckbox($member_extended_field->get_field_name(), $member_extended_field->get_name(), $default_values, $options, array('required' => (bool) $member_extended_field->get_required(), 'description' => $member_extended_field->get_description()))); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $value = $member_extended_field->get_value(); $image = !empty($value) ? '<img src="' . Url::to_rel($value) . '" alt="' . LangLoader::get_message('avatar', 'user-common') . '" title="' . LangLoader::get_message('avatar', 'user-common') . '" />' : $this->lang['extended-field.field.avatar.no_avatar']; $fieldset->add_field(new FormFieldFree('current_avatar', $this->lang['extended-field.field.avatar.current_avatar'], $image)); if (UserAccountsConfig::load()->is_avatar_upload_enabled()) { $fieldset->add_field(new FormFieldFilePicker('upload_avatar', $this->lang['extended-field.field.avatar.upload_avatar'], array('description' => $this->lang['extended-field.field.avatar.upload_avatar-explain']))); } $fieldset->add_field(new FormFieldTextEditor('link_avatar', $this->lang['extended-field.field.avatar.link'], '', array('description' => $this->lang['extended-field.field.avatar.link-explain'], 'required' => (bool) $member_extended_field->get_required()))); $fieldset->add_field(new FormFieldCheckbox('delete_avatar', $this->lang['extended-field.field.avatar.delete'], FormFieldCheckbox::UNCHECKED)); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $options = array(); $default = $member_extended_field->get_value(); foreach ($member_extended_field->get_possible_values() as $name => $parameters) { $options[] = new FormFieldRadioChoiceOption(stripslashes($parameters['title']), $name); } if (empty($default)) { $options = array_merge(array(new FormFieldSelectChoiceOption('', '')), $options); $default = ''; } $fieldset->add_field(new FormFieldRadioChoice($member_extended_field->get_field_name(), $member_extended_field->get_name(), $default, $options, array('required' => (bool) $member_extended_field->get_required(), 'description' => $member_extended_field->get_description()))); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $fieldset->add_field(new FormFieldCheckbox($member_extended_field->get_field_name(), $member_extended_field->get_name(), $member_extended_field->get_value(), array('description' => $member_extended_field->get_description(), 'required' => (bool) $member_extended_field->get_required()))); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $fieldset->add_field(new FormFieldRichTextEditor($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' => 5, 'cols' => 47, 'description' => $member_extended_field->get_description()), array($this->constraint($member_extended_field->get_regex())))); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $regex = $member_extended_field->get_regex(); switch ($regex) { case 1: $field_class = 'FormFieldNumberEditor'; $display_constraint = false; break; case 4: $field_class = 'FormFieldMailEditor'; $display_constraint = false; break; case 5: $field_class = 'FormFieldUrlEditor'; $display_constraint = false; break; case 8: $field_class = 'FormFieldTelEditor'; $display_constraint = false; break; default: $field_class = 'FormFieldTextEditor'; $display_constraint = true; } $fieldset->add_field(new $field_class($member_extended_field->get_field_name(), $member_extended_field->get_name(), $member_extended_field->get_value(), array('required' => (bool) $member_extended_field->get_required(), 'description' => $member_extended_field->get_description()), $display_constraint ? array($this->constraint($regex)) : array())); }
public function display_field_update(MemberExtendedField $member_extended_field) { $fieldset = $member_extended_field->get_fieldset(); $fieldset->add_field(new FormFieldSimpleSelectChoice($member_extended_field->get_field_name(), $member_extended_field->get_name(), $member_extended_field->get_value(), array(new FormFieldSelectChoiceOption('--', ''), new FormFieldSelectChoiceOption(LangLoader::get_message('male', 'main'), '1'), new FormFieldSelectChoiceOption(LangLoader::get_message('female', 'main'), '2')), array('description' => $member_extended_field->get_description(), 'required' => (bool) $member_extended_field->get_required()))); }