public function appendAssociationInterfaceSelect(XMLElement &$wrapper)
    {
        $wrapper->setAttribute('data-condition', 'associative');

        $interfaces = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_UI);
        $editors = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_EDITOR);

        if (!empty($interfaces) || !empty($editors)) {
            $association_context = $this->getAssociationContext();

            $group = new XMLElement('div');
            if (!empty($interfaces) && !empty($editors)) {
                $group->setAttribute('class', 'two columns');
            }

            // Create interface select
            if (!empty($interfaces)) {
                $label = Widget::Label(__('Association Interface'), null, 'column');
                $label->appendChild(new XMLElement('i', __('Optional')));

                $options = array(
                    array(null, false, __('None'))
                );
                foreach ($interfaces as $id => $name) {
                    $options[] = array($id, ($association_context['interface'] === $id), $name);
                }

                $select = Widget::Select('fields[' . $this->get('sortorder') . '][association_ui]', $options);
                $label->appendChild($select);
                $group->appendChild($label);
            }

            // Create editor select
            if (!empty($editors)) {
                $label = Widget::Label(__('Association Editor'), null, 'column');
                $label->appendChild(new XMLElement('i', __('Optional')));

                $options = array(
                    array(null, false, __('None'))
                );
                foreach ($editors as $id => $name) {
                    $options[] = array($id, ($association_context['editor'] === $id), $name);
                }

                $select = Widget::Select('fields[' . $this->get('sortorder') . '][association_editor]', $options);
                $label->appendChild($select);
                $group->appendChild($label);
            }

            $wrapper->appendChild($group);
        }
    }
public function appendAssociationInterfaceSelect(XMLElement &$wrapper)
    {
        $wrapper->setAttribute('data-condition', 'associative');

        $interfaces = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_UI);
        $editors = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_EDITOR);

        if (!empty($interfaces) || !empty($editors)) {
            $association_context = $this->getAssociationContext();

            $group = new XMLElement('div');
            if (!empty($interfaces) && !empty($editors)) {
                $group->setAttribute('class', 'two columns');
            }

            // Create interface select
            if (!empty($interfaces)) {
                $label = Widget::Label(__('Association Interface'), null, 'column');
                $label->appendChild(new XMLElement('i', __('Optional')));

                $options = array(
                    array(null, false, __('None'))
                );
                foreach ($interfaces as $id => $name) {
                    $options[] = array($id, ($association_context['interface'] === $id), $name);
                }

                $select = Widget::Select('fields[' . $this->get('sortorder') . '][association_ui]', $options);
                $label->appendChild($select);
                $group->appendChild($label);
            }

            // Create editor select
            if (!empty($editors)) {
                $label = Widget::Label(__('Association Editor'), null, 'column');
                $label->appendChild(new XMLElement('i', __('Optional')));

                $options = array(
                    array(null, false, __('None'))
                );
                foreach ($editors as $id => $name) {
                    $options[] = array($id, ($association_context['editor'] === $id), $name);
                }

                $select = Widget::Select('fields[' . $this->get('sortorder') . '][association_editor]', $options);
                $label->appendChild($select);
                $group->appendChild($label);
            }

            $wrapper->appendChild($group);
        }
    }
public function appendAssociationInterfaceSelect ( XMLElement & $ wrapper ) { $ wrapper -> setAttribute ( 'data-condition' , 'associative' ) ; $ interfaces = Symphony :: ExtensionManager ( ) -> getProvidersOf ( iProvider :: ASSOCIATION_UI ) ; $ editors = Symphony :: ExtensionManager ( ) -> getProvidersOf ( iProvider :: ASSOCIATION_EDITOR ) ; if ( ! empty ( $ interfaces ) || ! empty ( $ editors ) ) { $ association_context = $ this -> getAssociationContext ( ) ; $ group = new XMLElement ( 'div' ) ; if ( ! empty ( $ interfaces ) && ! empty ( $ editors ) ) { $ group -> setAttribute ( 'class' , 'two columns' ) ; } // Create interface select if ( ! empty ( $ interfaces ) ) { $ label = Widget :: Label ( __ ( 'Association Interface' ) , null , 'column' ) ; $ label -> appendChild ( new XMLElement ( 'i' , __ ( 'Optional' ) ) ) ; $ options = array ( array ( null , false , __ ( 'None' ) ) ) ; foreach ( $ interfaces as $ id => $ name ) { $ options [ ] = array ( $ id , ( $ association_context [ 'interface' ] === $ id ) , $ name ) ; } $ select = Widget :: Select ( 'fields[' . $ this -> get ( 'sortorder' ) . '][association_ui]' , $ options ) ; $ label -> appendChild ( $ select ) ; $ group -> appendChild ( $ label ) ; } // Create editor select if ( ! empty ( $ editors ) ) { $ label = Widget :: Label ( __ ( 'Association Editor' ) , null , 'column' ) ; $ label -> appendChild ( new XMLElement ( 'i' , __ ( 'Optional' ) ) ) ; $ options = array ( array ( null , false , __ ( 'None' ) ) ) ; foreach ( $ editors as $ id => $ name ) { $ options [ ] = array ( $ id , ( $ association_context [ 'editor' ] === $ id ) , $ name ) ; } $ select = Widget :: Select ( 'fields[' . $ this -> get ( 'sortorder' ) . '][association_editor]' , $ options ) ; $ label -> appendChild ( $ select ) ; $ group -> appendChild ( $ label ) ; } $ wrapper -> appendChild ( $ group ) ; } }
Append the html widget for selecting an association interface and editor
for this field.

@param XMLElement $wrapper
the parent XML element to append the association interface selection to,
if either interfaces or editors are provided to the system.
@since Symphony 2.5.0
Append the html widget for selecting an association interface and editor for this field .