class RulesDataUITextFormatted

UI for formatted text.

Hierarchy

Expanded class hierarchy of RulesDataUITextFormatted

2 string references to 'RulesDataUITextFormatted'
hook_rules_data_info in ./rules.api.php
Define rules data types.
rules_rules_core_data_info in modules/rules_core.rules.inc
Implements hook_rules_data_info() on behalf of the pseudo rules_core module.

File

ui/ui.data.inc, line 265

View source
class RulesDataUITextFormatted extends RulesDataUIText {
    
    /**
     * Implements RulesDataDirectInputFormInterface::inputForm().
     */
    public static function inputForm($name, $info, $settings, RulesPlugin $element) {
        $form = parent::inputForm($name, $info, $settings, $element);
        $settings += array(
            $name => isset($info['default value']) ? $info['default value'] : array(
                'value' => NULL,
                'format' => NULL,
            ),
        );
        $form[$name]['#type'] = 'text_format';
        $form[$name]['#base_type'] = 'textarea';
        $form[$name]['#default_value'] = $settings[$name]['value'];
        $form[$name]['#format'] = $settings[$name]['format'];
        return $form;
    }
    
    /**
     * Implements RulesDataDirectInputFormInterface::render().
     */
    public static function render($value) {
        return array(
            'content' => array(
                '#markup' => check_plain($value['value']),
            ),
            '#attributes' => array(
                'class' => array(
                    'rules-parameter-text-formatted',
                ),
            ),
        );
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
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.
RulesDataUIText::getDefaultMode public static function Overrides RulesDataUI::getDefaultMode(). Overrides RulesDataUI::getDefaultMode 2
RulesDataUITextFormatted::inputForm public static function Implements RulesDataDirectInputFormInterface::inputForm(). Overrides RulesDataUIText::inputForm
RulesDataUITextFormatted::render public static function Implements RulesDataDirectInputFormInterface::render(). Overrides RulesDataUIText::render