You are here

class DoubleFiledDataUIDoubleField in Double Field 7.2

UI for double field type parameter.

Hierarchy

Expanded class hierarchy of DoubleFiledDataUIDoubleField

1 string reference to 'DoubleFiledDataUIDoubleField'
double_field_rules_data_info in ./double_field.rules.inc
Implements hook_rules_data_info().

File

./double_field.rules.inc, line 43
Rules integration for the double field module.

View source
class DoubleFiledDataUIDoubleField extends RulesDataUI implements RulesDataDirectInputFormInterface {

  /**
   * {@inheritdoc}
   */
  public static function inputForm($name, $info, $settings, RulesPlugin $element) {
    foreach (double_field_rules_property_info() as $subfield => $info) {
      $form[$name][$subfield] = array(
        '#type' => 'textarea',
        '#title' => $info['label'],
        '#default_value' => $settings['value'][$subfield],
      );
    }
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public static function render($value) {
    return array(
      'content' => array(
        '#markup' => is_array($value) ? implode(' & ', $value) : $value,
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DoubleFiledDataUIDoubleField::inputForm public static function Constructs the direct input form. Overrides RulesDataDirectInputFormInterface::inputForm
DoubleFiledDataUIDoubleField::render public static function Render the configured value. Overrides RulesDataDirectInputFormInterface::render
RulesDataUI::getDefaultMode public static function Specifies the default input mode per data type. 2
RulesDataUI::getTypeInfo public static function Returns the data type and parameter information for the given arguments.
RulesDataUI::renderOptionsLabel public static function Renders the value with a label if an options list is available.
RulesDataUI::selectionForm public static function Provides the selection form for a parameter.