function formData()
 {
     $title = null;
     $description = null;
     $type = null;
     $systemname = null;
     $id = null;
     $fieldsettitle = _("New Profile Field");
     //Edit a field
     if ($this->out->trimmed('edit')) {
         $field = GNUsocialProfileExtensionField::getKV('id', $this->out->trimmed('edit'));
         $title = $field->title;
         $description = $field->description;
         $type = $field->type;
         $systemname = $field->systemname;
         $this->out->hidden('id', $field->id, 'id');
         $fieldsettitle = _("Edit Profile Field");
     } else {
         $this->out->elementStart('fieldset');
         $this->out->element('legend', null, _('Existing Custom Profile Fields'));
         $this->out->elementStart('ul', 'form_data');
         $fields = GNUsocialProfileExtensionField::allFields();
         foreach ($fields as $field) {
             $this->li();
             $content = $this->out->elementStart('div');
             $this->out->element('a', array('href' => '/admin/profilefields?edit=' . $field->id), $field->title);
             $this->out->text(' (' . $field->type . '): ' . $field->description);
             $this->out->elementEnd('div');
             $this->unli();
         }
         $this->out->elementEnd('ul');
         $this->out->elementEnd('fieldset');
     }
     //New fields
     $this->out->elementStart('fieldset');
     $this->out->element('legend', null, $fieldsettitle);
     $this->out->elementStart('ul', 'form_data');
     $this->li();
     $this->out->input('title', _('Title'), $title, _('The title of the field'));
     $this->unli();
     $this->li();
     $this->out->input('systemname', _('Internal name'), $systemname, _('The alphanumeric name used internally for this field.  Also the key used in OStatus user info. (optional)'));
     $this->unli();
     $this->li();
     $this->out->input('description', _('Description'), $description, _('An optional more detailed description of the field'));
     $this->unli();
     $this->li();
     $this->out->dropdown('type', _('Type'), array('text' => _("Text"), 'str' => _("String")), _('The type of the datafield'), false, $type);
     $this->unli();
     $this->out->elementEnd('ul');
     $this->out->elementEnd('fieldset');
 }