public static function UCXF_Field::get_example in Extra Fields Checkout Pane 7
Same name and namespace in other branches
- 6.2 class/UCXF_Field.class.php \UCXF_Field::get_example()
Returns an example for the value section
@access public @static
Parameters
int $field_type: One of the field types defined by Extra Fields Pane
Return value
string
2 calls to UCXF_Field::get_example()
- UCXF_Field::edit_form_validate in class/UCXF_Field.class.php 
- Validate the edit form for the item.
- uc_extra_fields_pane_help in ./uc_extra_fields_pane.module 
- Implements hook_help().
File
- class/UCXF_Field.class.php, line 72 
- Contains the UCXF_Field class.
Class
- UCXF_Field
- Base class for a Extra Fields Pane field
Code
public static function get_example($field_type) {
  switch ($field_type) {
    case self::UCXF_WIDGET_TYPE_SELECT:
      return '<code>
           |' . t('Please select') . '<br />
          option1|' . t('Option 1') . '<br />
          option2|' . t('Option 2') . '</code>';
    case self::UCXF_WIDGET_TYPE_CONSTANT:
      return '<code>' . t('A constant value') . '</code>';
    case self::UCXF_WIDGET_TYPE_PHP:
      return '<code><?php return "' . t('A string') . '"; ?></code>';
    case self::UCXF_WIDGET_TYPE_PHP_SELECT:
      return "<code>\n          <?php<br />\n          return array(<br />\n            '' => '" . t('Please select') . "',<br />\n            'option1' => '" . t('Option 1') . "',<br />\n            'option2' => '" . t('Option 2') . "',<br />\n          );<br />\n          ?>" . "</code>";
  }
}