public function buildLocationSelect($selected = null, $name = 'fields[location]', $label_value = null)
    {
        if (!$label_value) {
            $label_value = __('Placement');
        }

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

        $options = array(
            array('main', $selected == 'main', __('Main content')),
            array('sidebar', $selected == 'sidebar', __('Sidebar'))
        );
        $label->appendChild(Widget::Select($name, $options));

        return $label;
    }
public function buildLocationSelect($selected = null, $name = 'fields[location]', $label_value = null)
    {
        if (!$label_value) {
            $label_value = __('Placement');
        }

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

        $options = array(
            array('main', $selected == 'main', __('Main content')),
            array('sidebar', $selected == 'sidebar', __('Sidebar'))
        );
        $label->appendChild(Widget::Select($name, $options));

        return $label;
    }
public function buildLocationSelect ( $ selected = null , $ name = 'fields[location]' , $ label_value = null ) { if ( ! $ label_value ) { $ label_value = __ ( 'Placement' ) ; } $ label = Widget :: Label ( $ label_value ) ; $ label -> setAttribute ( 'class' , 'column' ) ; $ options = array ( array ( 'main' , $ selected == 'main' , __ ( 'Main content' ) ) , array ( 'sidebar' , $ selected == 'sidebar' , __ ( 'Sidebar' ) ) ) ; $ label -> appendChild ( Widget :: Select ( $ name , $ options ) ) ; return $ label ; }
Build the location select widget. This widget allows users to select
whether this field will appear in the main content column or in the sidebar
when creating a new entry.

@param string|null $selected (optional)
the currently selected location, if there is one. this defaults to null.
@param string $name (optional)
the name of this field. this is optional and defaults to `fields[location]`.
@param string $label_value (optional)
any predefined label for this widget. this is an optional argument that defaults
to null.
@throws InvalidArgumentException
@return XMLElement
An XMLElement representing a `<select>` field containing the options.
Build the location select widget . This widget allows users to select whether this field will appear in the main content column or in the sidebar when creating a new entry .