'textfield', '#title' => t(' Field Name'), '#description' => t('If you want to display a single field from the signup form (see theme/signup_form.inc), enter its name here. Otherwise, all fields will be displayed.'), '#default_value' => isset($this->options['form_data_fieldname']) ? $this->options['form_data_fieldname'] : '', ); } /** * Set each field value to "$key: $value" when rendering all fields. * * @see theme_signup_custom_data_field_text() */ function pre_render($values) { if (!$this->options['form_data_fieldname']) { foreach ($values as $key => $result) { $form_data = unserialize($result->{$this->field_alias}); if ($form_data) { foreach ($form_data as $key => $value) { $this->items[$result->{$this->field_alias}][$key] = check_plain(theme('signup_custom_data_field_text', $key, $value)); } } } } } function render($values) { if ($this->options['form_data_fieldname']) { $form_data = unserialize($values->{$this->field_alias}); return check_plain($form_data[$this->options['form_data_fieldname']]); } else { return parent::render($values); } } }