public function buildFormatterSelect($selected = null, $name = 'fields[format]', $label_value)
    {
        $formatters = TextformatterManager::listAll();

        if (!$label_value) {
            $label_value = __('Formatting');
        }

        $label = Widget::Label($label_value);
        $label->setAttribute('class', 'column');

        $options = array();

        $options[] = array('none', false, __('None'));

        if (!empty($formatters) && is_array($formatters)) {
            foreach ($formatters as $handle => $about) {
                $options[] = array($handle, ($selected == $handle), $about['name']);
            }
        }

        $label->appendChild(Widget::Select($name, $options));

        return $label;
    }
public function buildFormatterSelect($selected = null, $name = 'fields[format]', $label_value)
    {
        $formatters = TextformatterManager::listAll();

        if (!$label_value) {
            $label_value = __('Formatting');
        }

        $label = Widget::Label($label_value);
        $label->setAttribute('class', 'column');

        $options = array();

        $options[] = array('none', false, __('None'));

        if (!empty($formatters) && is_array($formatters)) {
            foreach ($formatters as $handle => $about) {
                $options[] = array($handle, ($selected == $handle), $about['name']);
            }
        }

        $label->appendChild(Widget::Select($name, $options));

        return $label;
    }
public function buildFormatterSelect ( $ selected = null , $ name = 'fields[format]' , $ label_value ) { $ formatters = TextformatterManager :: listAll ( ) ; if ( ! $ label_value ) { $ label_value = __ ( 'Formatting' ) ; } $ label = Widget :: Label ( $ label_value ) ; $ label -> setAttribute ( 'class' , 'column' ) ; $ options = array ( ) ; $ options [ ] = array ( 'none' , false , __ ( 'None' ) ) ; if ( ! empty ( $ formatters ) && is_array ( $ formatters ) ) { foreach ( $ formatters as $ handle => $ about ) { $ options [ ] = array ( $ handle , ( $ selected == $ handle ) , $ about [ 'name' ] ) ; } } $ label -> appendChild ( Widget :: Select ( $ name , $ options ) ) ; return $ label ; }
Construct the html widget for selecting a text formatter for this field.

@param string $selected (optional)
the currently selected text formatter name if there is one. this defaults
to null.
@param string $name (optional)
the name of this field in the form. this is optional and defaults to
"fields[format]".
@param string $label_value
the default label for the widget to construct. if null is passed in then
this defaults to the localization of "Formatting".
@throws InvalidArgumentException
@return XMLElement
An XMLElement representing a `<select>` field containing the options.
Construct the html widget for selecting a text formatter for this field .