Renders a select2Field
@return mixed|void
485012
protected function select2Field()
	{
		if (isset($this->htmlOptions['options'])) {
			$options = $this->htmlOptions['options'];
			unset($this->htmlOptions['options']);
		}

		if (isset($this->htmlOptions['events'])) {
			$events = $this->htmlOptions['events'];
			unset($this->htmlOptions['events']);
		}

		if (isset($this->htmlOptions['data'])) {
			$data = $this->htmlOptions['data'];
			unset($this->htmlOptions['data']);
		}

		if (isset($this->htmlOptions['asDropDownList'])) {
			$asDropDownList = $this->htmlOptions['asDropDownList'];
			unset($this->htmlOptions['asDropDownList']);
		}

		if (isset($this->htmlOptions['val']))
		{
			$val = $this->htmlOptions['val'];
			unset($this->htmlOptions['val']);
		}

		echo $this->getLabel();
		echo $this->getPrepend();
		$this->widget(
			'booster.widgets.TbSelect2',
			array(
				'model' => $this->model,
				'attribute' => $this->attribute,
				'options' => isset($options) ? $options : array(),
				'events' => isset($events) ? $events : array(),
				'data' => isset($data) ? $data : array(),
				'asDropDownList' => isset($asDropDownList) ? $asDropDownList : true,
				'val' => isset($val) ? $val : null,
				'htmlOptions' => $this->htmlOptions,
				'form' => $this->form
			)
		);
		echo $this->getAppend();
		echo $this->getError() . $this->getHint();
	}
469339
protected function renderSelect()
    {
        $options = $this->getOptions();

        $selectedExtensionStyle = '';

        $renderedOptionTags = [];
        foreach ($options as $option) {
            if (isset($option['selected']) && $option['selected'] === 'selected') {
                $selectedExtensionStyle = $option['style'];
            }
            if ($option['value'] === \Tx_Phpunit_Testable::ALL_EXTENSIONS) {
                $optionValue = $this->translate('all_extensions');
            } else {
                $optionValue = $option['value'];
            }
            $renderedOptionTags[] = $this->renderTag('option', $option, $optionValue);
        }

        return $this->renderTag(
            'select',
            [
                'name' => \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE .
                    '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE . ']',
                'onchange' => 'document.location = \'' . $this->action . '&' .
                    \Tx_Phpunit_Interface_Request::PARAMETER_NAMESPACE .
                    '[' . \Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE . ']=' .
                    '\'+this.options[this.selectedIndex].value;',
                'style' => $selectedExtensionStyle,
            ],
            implode(LF, $renderedOptionTags)
        );
    }
1053686
public function render()
    {
        $name = $this->getName();
        if ($this->hasArgument('multiple')) {
            $name .= '[]';
        }

        $this->tag->addAttribute('name', $name);

        $options = $this->getOptions();
        $this->tag->setContent($this->renderOptionTags($options));

        $this->addAdditionalIdentityPropertiesIfNeeded();
        $this->setErrorClassAttribute();

        // register field name for token generation.
        // in case it is a multi-select, we need to register the field name
        // as often as there are elements in the box
        if ($this->hasArgument('multiple') && $this->arguments['multiple'] !== '') {
            $this->renderHiddenFieldForEmptyValue();
            for ($i = 0; $i < count($options); $i++) {
                $this->registerFieldNameForFormTokenGeneration($name);
            }
        } else {
            $this->registerFieldNameForFormTokenGeneration($name);
        }

        return $this->tag->render();
    }
852279
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        if ($this->useHelperSelectBox) {
            $select = Yii::createComponent(
                CMap::mergeArray(
                    $this->helperOptions,
                    array(
                        'class' => 'yiiwheels.widgets.formhelpers.WhSelectBox',
                        'htmlOptions' => $this->htmlOptions,
                        'model' => $this->model,
                        'attribute' => $this->attribute,
                        'name' => $this->name,
                        'value' => $this->value,
                        'wrapperOptions' => array(
                            'class' => 'bfh-fonts',
                            'data-family' => $this->hasModel() ? $this->model->{$this->attribute} : $this->value,
                        )
                    )
                )
            );
            $select->init();
            $select->run();
        } else {
            $this->htmlOptions['data-family'] = $this->hasModel()
                ? $this->model->{$this->attribute}
                : $this->value;

            if ($this->hasModel()) {
                echo CHtml::activeDropDownList($this->model, $this->attribute, array(), $this->htmlOptions);
            } else {
                echo CHtml::dropDownList($name, $this->value, array(), $this->htmlOptions);
            }
        }
    }
429432
function renderOReillyField() {
		$this->renderField(
			[
				'id' => 'oreilly',
				'name' => $this->getSlug(),
				'option' => 'oreilly',
				'value' => ( isset( $this->options['oreilly'] ) ) ? $this->options['oreilly'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
919870
public function select2($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'cleanup' => false,
            'debug'   => \Kodekit::getInstance()->isDebug(),
            'element' => '.select2-listbox',
            'options_callback' => null, // wraps the call to select2 options in JavaScript, can be used to add JS code
            'options' => array(
                'theme'   => 'bootstrap',
                'width' => 'resolve'
            )
        ));

        $html = '';

        if (!static::isLoaded('select2'))
        {
            $html .= $this->jquery();
            $html .= '<ktml:script src="assets://js/'.($config->debug ? 'build/' : 'min/').'kodekit.select2.js" />';

            static::setLoaded('select2');
        }

        $options   = $config->options;
        $signature = md5('select2-'.$config->element.$config->options_callback.$options);

        if($config->element && !static::isLoaded($signature))
        {
            $options = (string) $options;

            if ($config->options_callback) {
                $options = $config->options_callback.'('.$options.')';
            }

            $html .= '<script>
            kQuery(function($){
                $("'.$config->element.'").select2('.$options.');
            });</script>';

            static::setLoaded($signature);
        }

        return $html;
    }
520524
protected function buildSelect()
    {
        if (!empty($this->props['attribs']['multiple']) && \substr($this->props['attribs']['name'], -2) !== '[]') {
            $this->props['attribs']['name'] .= '[]';
        }
        if ($this->props['attribs']['required'] && !$this->props['attribs']['multiple'] && $this->props['options']) {
            /*
                Check for an empty-value "Select" option
                If no empty option, add one
            */
            $firstValue = $this->props['options'][0]['attribs']['value'];
            $emptyValues = array('','--','select');
            if (!\in_array(\strtolower($firstValue), $emptyValues)) {
                $selectOption = array(
                    'attribs' => array(
                        'value' => '',
                        'disabled' => true,
                        'selected' => empty($this->props['values']),
                    ),
                    'label' => 'Select',
                );
                \array_unshift($this->props['options'], $selectOption);
            }
        }
        // build select input
        $this->props['attribs']['type'] = null;
        $attribStrings = $this->buildAttribStrings($this->props);
        $props = \array_merge($this->props, $attribStrings);
        if (empty($props['input'])) {
            $this->props['input'] = Html::buildTag(
                $props['tagname'],
                $props['attribs'],
                "\n".$this->buildSelectOptions($this->props['options'], $this->props['values'])
            );
            $props['input'] = $this->buildInputGroup();
        }
        return $this->props['tagOnly']
            ? $props['input']
            : Str::quickTemp($props['template'], $props);
    }
77662
function ajax_render_options()
	{
		// vars
		$options = array(
			'field_key' => '',
			'field_type' => '',
			'post_id' => 0,
			'nonce' => ''
		);
		
		// load post options
		$options = array_merge($options, $_POST);
		
		
		// verify nonce
		if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') )
		{
			die(0);
		}
		
		
		// required
		if( ! $options['field_type'] )
		{
			die(0);
		}
		
		
		// find key (not actual field key, more the html attr name)
		$options['field_key'] = str_replace("fields[", "", $options['field_key']);
		$options['field_key'] = str_replace("][type]", "", $options['field_key']) ;
		
		
		// render options
		$field = array(
			'type' => $options['field_type'],
			'name' => $options['field_key']
		);
		do_action('acf/create_field_options', $field );
		
		
		die();
		
	}
1079009
public function renderFields()
    {
        $result = '';
        foreach ($this->fields as $field => $value) {
            $result .= '<input type="hidden" name="' . $field . '" value="' . $value . '"/>' . "\r\n";
        }

        return $result;
    }
133572
public function render()
    {
        parent::render();

        $sOxId = $this->_aViewData["oxid"] = $this->getEditObjectId();

        //create empty edit object
        $this->_aViewData["edit"] = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);

        if (isset($sOxId) && $sOxId != "-1") {
            // generating category tree for select list
            // A. hack - passing language by post as lists uses only language passed by POST/GET/SESSION
            $_POST["language"] = $this->_iEditLang;
            $this->_createCategoryTree("artcattree", $sOxId);

            // load object
            $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);
            $oAttr->loadInLang($this->_iEditLang, $sOxId);

            $aFieldList = $oAttr->getFieldList();
            if (is_array($aFieldList)) {
                foreach ($aFieldList as $key => $oField) {
                    if ($oField->priceUnit == '%') {
                        $oField->price = $oField->fprice;
                    }
                }
            }

            $oOtherLang = $oAttr->getAvailableInLangs();
            if (!isset($oOtherLang[$this->_iEditLang])) {
                // echo "language entry doesn't exist! using: ".key($oOtherLang);
                $oAttr->loadInLang(key($oOtherLang), $sOxId);
            }
            $this->_aViewData["edit"] = $oAttr;

            // Disable editing for derived items.
            if ($oAttr->isDerived()) {
                $this->_aViewData['readonly'] = true;
            }

            // remove already created languages
            $aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
            if (count($aLang)) {
                $this->_aViewData["posslang"] = $aLang;
            }

            foreach ($oOtherLang as $id => $language) {
                $oLang = new stdClass();
                $oLang->sLangDesc = $language;
                $oLang->selected = ($id == $this->_iEditLang);
                $this->_aViewData["otherlang"][$id] = clone $oLang;
            }

            $iErr = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("iErrorCode");

            if (!$iErr) {
                $iErr = ERR_SUCCESS;
            }

            $this->_aViewData["iErrorCode"] = $iErr;
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iErrorCode", ERR_SUCCESS);
        }
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) {
            $oSelectlistMainAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\SelectListMainAjax::class);
            $this->_aViewData['oxajax'] = $oSelectlistMainAjax->getColumns();

            return "popups/selectlist_main.tpl";
        }

        return "selectlist_main.tpl";
    }
55820
public function render()
    {
        $returnValue = $this->renderLabel();
        
        $returnValue .= "<select name='{$this->name}' id='{$this->name}' ";
        $returnValue .= $this->renderAttributes();
        $returnValue .= ">";
        if (! empty($this->emptyOption)) {
            $this->options = array_merge(array(
                ' ' => $this->emptyOption), $this->options);
        }
        foreach ($this->options as $optionId => $optionLabel) {
            $returnValue .= "<option value='{$optionId}' ";
            if ($this->value === $optionId) {
                $returnValue .= " selected='selected' ";
            }
            $returnValue .= ">" . _dh($optionLabel) . "</option>";
        }
        $returnValue .= "</select>";
        
        return (string) $returnValue;
    }
869989
public function render()
    {
        // transform selected values into the format used by TCEforms
        $selectedValues = $this->selectedValues;
        $tablesToIndex = $this->getIndexQueueConfigurationTableMap();

        $formField = $this->renderSelectCheckbox($this->buildSelectorItems($tablesToIndex), $selectedValues);

        // need to wrap the field in a TCEforms table to make the CSS apply
        $form[] = '<div class="typo3-TCEforms tx_solr-TCEforms">';
        $form[] = $formField;
        $form[] = '</div>';

        return implode(LF, $form);
    }
35909
public function _render_field()
    {
        $ret = [];

        if (!$this->args['field']) {
            throw new Exception([
                'No fields defined for table',
            ]);
        }

        foreach ($this->args['field'] as $field => $options) {
            if ($options instanceof Expression) {
                $ret[] = $this->_escape($field).' '.$this->_consume($options);
                continue;
            }

            $ret[] = $this->_render_one_field($field, $options);
        }

        return implode(',', $ret);
    }
549871
function render_field( $field ) {

		$maxrows = null;

		$disablesort = null;

		$defaultheaders = null;


		// vars
		$o = array( 'id', 'name' );
		$s = array( 'readonly', 'disabled' );
		$e = '';


		// maxlength
		if( $field['maxrows'] !== '' ) {

			$maxrows = 'data-maxrows="'.$field['maxrows'].'"';

		}

						// disable sort
		if( !empty($field['disable_sort']) ) $disablesort = ' data-disablesort="'.$field['disable_sort'].'"';

		// rows
		if( !empty($field['fixed_columns']) ) {

			$defaultheaders = preg_split( '/\r\n|\r|\n/',  $field['default_headers'] );

			$defaultheaders = 'data-defaultheaders="'.implode(",", $defaultheaders) .'"';
			if( empty($field['default_headers']) ) $defaultheaders = 'data-defaultheaders="No Default Headers Set"';

		}




		// populate atts
		$atts = array();
		foreach( $o as $k ) {

			$atts[ $k ] = $field[ $k ];

		}



		// special atts
		foreach( $s as $k ) {

			if( $field[ $k ] ) {

				$atts[ $k ] = $k;

			}

		}



		$e .= '<textarea style="display:none" '.$maxrows.' '.$disablesort.' '.$defaultheaders.' data-key="'.$field['key'].'" ' . acf_esc_attr( $atts ) . ' >';
		$e .= esc_textarea( $field['value'] );
		$e .= '</textarea>';


		// return
		echo $e;

	}
589546
public function render()
    {
        if (!$this->grid->showColumnSelector()) {
            return '';
        }
        $show = array_filter(explode(',', request(static::SELECT_COLUMN_NAME)));

        $columns = $this->getGridColumns();

        $this->setupScript();

        $lists = $columns->map(function ($val, $key) use ($show) {
            if (empty($show)) {
                $checked = 'checked';
            } else {
                $checked = in_array($key, $show) ? 'checked' : '';
            }

            return <<<HTML
<li class="checkbox icheck" style="margin: 0;">
    <label style="width: 100%;padding: 3px;">
        <input type="checkbox" class="column-select-item" value="{$key}" {$checked}/>&nbsp;&nbsp;&nbsp;{$val}
    </label>
</li>
HTML;
        })->implode("\r\n");

        $btns = [
            'all'    => __('admin.all'),
            'submit' => __('admin.submit'),
        ];

        return <<<EOT

<div class="dropdown pull-right column-selector" style="margin-right: 10px">
    <button type="button" class="btn btn-sm btn-instagram dropdown-toggle" data-toggle="dropdown">
        <i class="fa fa-table"></i>
        &nbsp;
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu" style="padding: 10px;">
        <li>
            <ul style='padding: 0;'>
                {$lists}
            </ul>
        </li>
        <li class="divider"></li>
        <li class="text-right">
            <button class="btn btn-sm btn-defalut column-select-all">{$btns['all']}</button>&nbsp;&nbsp;
            <button class="btn btn-sm btn-primary column-select-submit">{$btns['submit']}</button>
        </li>
    </ul>
</div>
EOT;
    }
842819
function _render_select(){

	var buf = new Array();

	//
	buf.push('<select id="');
	buf.push(anchor.mid);
	buf.push('" name="');
	buf.push(anchor.mname);
	buf.push('" multiple size="');
	buf.push(anchor.msize);
	buf.push('">');
	
	buf.push(_render_option());

	//
	buf.push('</select>');

	return buf.join('');
    }
226483
public function selectAction()
    {
        $selectFieldProviders = $this->get('phlexible_elementtype.select_field_providers');

        $data = [];
        foreach ($selectFieldProviders->all() as $selectFieldProvider) {
            $data[] = [
                'name' => $selectFieldProvider->getName(),
                'title' => $selectFieldProvider->getTitle($this->getUser()->getInterfaceLanguage('en')),
            ];
        }

        return new JsonResponse(['functions' => $data]);
    }