You are here

public static function UCXF_Field::get_example in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 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>
          &nbsp;|' . 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>&lt;?php return "' . t('A string') . '"; ?&gt;</code>';
    case self::UCXF_WIDGET_TYPE_PHP_SELECT:
      return "<code>\n          &lt;?php<br />\n          return array(<br />\n          &nbsp;&nbsp;'' => '" . t('Please select') . "',<br />\n          &nbsp;&nbsp;'option1' => '" . t('Option 1') . "',<br />\n          &nbsp;&nbsp;'option2' => '" . t('Option 2') . "',<br />\n          );<br />\n          ?&gt;" . "</code>";
  }
}