Adds the module type option, if allowed
@param Select $select The select box
@param string $type The module type
2760
private function AddModuleTypeOption(Select $select, $type)
    {
        if ($type != 'BuiltIn-Container'  ||
                (!Request::GetData('container') && Container::Schema()->Count() > 0))
        {
            $select->AddOption($type, Trans($type));
        }
    }
201521
protected function bootstrapObjectOptions(String $selector, $options, $type)
    {
        if( ! empty($options) )
        {
            $optionsEncode = json_encode($options);
        }
        
        $return  = '<script>$("' . $selector . '").' . $type . '(' . ($optionsEncode ?? NULL) . ')';
        
        if( $parameter = $this->transferAttributesAndUnset('attr', 'on') )
        {
            $return .= '.on(\'' . $parameter . '\', function(){' . $this->transferAttributesAndUnset('attr', 'onCallback') . '})';
        }

        $return .= ';</script>';

        $this->bootstrapOptions[$type][$selector] = $return;

        return $return;
    }
498601
public function addSelect($_)
    {
        RecursiveArgs::each(func_get_args(), function ($arg) {
           $this->selectClauses[] = $arg;
        });

        return $this;
    }
259900
public function add($name, $type = 'text', array $options = [], $modify = false)
    {
        $this->formHelper->checkFieldName($name, get_class($this));

        if ($this->rebuilding && !$this->has($name)) {
            return $this;
        }

        $this->addField($this->makeField($name, $type, $options), $modify);

        return $this;
    }
343315
public function addOptionType(OptionType $optionType): void
    {
        if ($this->optionTypes->contains($optionType)) {
            throw new InvalidArgumentException(sprintf('OptionType « %s » for product « %s » is already set', $optionType->getName(), $this->getName()));
        }
        $this->optionTypes->add($optionType);
        $optionType->addProduct($this);
    }
133961
protected function checkSelectNode(DOMAttr $select, Tag $tag)
	{
		$this->checkExpression($select, $select->value, $tag);
	}
746680
public function setButtonType($type, $submitFormOnClick = false)
    {
        $this->model->type = $type;

        if ($submitFormOnClick) {
            $this->model->addCssClassNames("submit-on-click");
        }
    }
1270613
protected function applyTypeConditions(ISelectBuilder $selectBuilder)
    {
        $types = $this->getSelectionTypes();

        if (count($types)) {
            $typeField = $this->collection->getObjectTypeField();
            $typeFieldColumn = $this->collection->getSourceAlias()
                . ISelector::FIELD_SEPARATOR
                . $typeField->getColumnName();
            $typeConditionPlaceholder = ':type' . self::PLACEHOLDER_SEPARATOR . $this->collection->getName();

            $typeConditions = [];
            foreach ($types as $typeName) {
                $typeConditions[] = $this->collection->getName() . IObjectType::PATH_SEPARATOR . $typeName;
            }

            $selectBuilder->expr($typeFieldColumn, 'IN', $typeConditionPlaceholder);
            $selectBuilder->bindArray($typeConditionPlaceholder, $typeConditions);
        }
    }
1039501
function() {

            this.$select.children().each($.proxy(function(index, element) {

                // Support optgroups and options without a group simultaneously.
                var tag = $(element).prop('tagName')
                    .toLowerCase();

                if ($(element).prop('value') == this.options.selectAllValue) {
                    return;
                }

                if (tag === 'optgroup') {
                    this.createOptgroup(element);
                }
                else if (tag === 'option') {

                    if ($(element).data('role') === 'divider') {
                        this.createDivider();
                    }
                    else {
                        this.createOptionValue(element);
                    }

                }

                // Other illegal tags will be ignored.
            }, this));

            // Bind the change event on the dropdown elements.
            $('li input', this.$ul).on('change', $.proxy(function(event) {
                var $target = $(event.target);

                var checked = $target.prop('checked') || false;
                var isSelectAllOption = $target.val() === this.options.selectAllValue;

                // Apply or unapply the configured selected class.
                if (this.options.selectedClass) {
                    if (checked) {
                        $target.parents('li')
                            .addClass(this.options.selectedClass);
                    }
                    else {
                        $target.parents('li')
                            .removeClass(this.options.selectedClass);
                    }
                }

                // Get the corresponding option.
                var value = $target.val();
                var $option = this.getOptionByValue(value);

                var $optionsNotThis = $('option', this.$select).not($option);
                var $checkboxesNotThis = $('input', this.$container).not($target);

                if (isSelectAllOption) {
                    if (checked) {
                        this.selectall();
                    }
                    else {
                        this.deselectall();
                    }
                }

                if(!isSelectAllOption){
                    if (checked) {
                        $option.prop('selected', true);

                        if (this.options.multiple) {
                            // Simply select additional option.
                            $option.prop('selected', true);
                        }
                        else {
                            // Unselect all other options and corresponding checkboxes.
                            if (this.options.selectedClass) {
                                $($checkboxesNotThis).parents('li').removeClass(this.options.selectedClass);
                            }

                            $($checkboxesNotThis).prop('checked', false);
                            $optionsNotThis.prop('selected', false);

                            // It's a single selection, so close.
                            this.$button.click();
                        }

                        if (this.options.selectedClass === "active") {
                            $optionsNotThis.parents("a").css("outline", "");
                        }
                    }
                    else {
                        // Unselect option.
                        $option.prop('selected', false);
                    }
                }

                this.$select.change();

                this.updateButtonText();
                this.updateSelectAll();

                this.options.onChange($option, checked);

                if(this.options.preventInputChangeEvent) {
                    return false;
                }
            }, this));

            $('li a', this.$ul).on('touchstart click', function(event) {
                event.stopPropagation();

                var $target = $(event.target);

                if (event.shiftKey) {
                    var checked = $target.prop('checked') || false;

                    if (checked) {
                        var prev = $target.parents('li:last')
                            .siblings('li[class="active"]:first');

                        var currentIdx = $target.parents('li')
                            .index();
                        var prevIdx = prev.index();

                        if (currentIdx > prevIdx) {
                            $target.parents("li:last").prevUntil(prev).each(
                                function() {
                                    $(this).find("input:first").prop("checked", true)
                                        .trigger("change");
                                }
                            );
                        }
                        else {
                            $target.parents("li:last").nextUntil(prev).each(
                                function() {
                                    $(this).find("input:first").prop("checked", true)
                                        .trigger("change");
                                }
                            );
                        }
                    }
                }

                $target.blur();
            });

            // Keyboard support.
            this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function(event) {
                if ($('input[type="text"]', this.$container).is(':focus')) {
                    return;
                }
                if ((event.keyCode === 9 || event.keyCode === 27)
                        && this.$container.hasClass('open')) {

                    // Close on tab or escape.
                    this.$button.click();
                }
                else {
                    var $items = $(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible");

                    if (!$items.length) {
                        return;
                    }

                    var index = $items.index($items.filter(':focus'));

                    // Navigation up.
                    if (event.keyCode === 38 && index > 0) {
                        index--;
                    }
                    // Navigate down.
                    else if (event.keyCode === 40 && index < $items.length - 1) {
                        index++;
                    }
                    else if (!~index) {
                        index = 0;
                    }

                    var $current = $items.eq(index);
                    $current.focus();

                    if (event.keyCode === 32 || event.keyCode === 13) {
                        var $checkbox = $current.find('input');

                        $checkbox.prop("checked", !$checkbox.prop("checked"));
                        $checkbox.change();
                    }

                    event.stopPropagation();
                    event.preventDefault();
                }
            }, this));
        }
1338941
public function addSelection(Selection $selection)
    {
        if (!$this->selections->contains($selection)) {
            $this->selections->add($selection);
            $selection->setInteractionSelection($this);
        }
    }
1066777
protected function configureForm($form, AbstractOptions $options)
    {
        /* @var $options \Applications\Options\ModuleOptions */
        $form->get($this->fileName)->setViewHelper('formImageUpload')
           ->setMaxSize($options->getContactImageMaxSize())
           ->setAllowedTypes($options->getContactImageMimeType())
           ->setForm($form);
    }
523225
public function preSelect(Select $select)
	{
		$tableGateway = $this->tableGateway;
		$tableName    = $tableGateway->getTable();
		$tableClass   = get_class($tableGateway);

		$tablePrimKey = $this->getPrimaryKey($tableGateway);    
		
		$locale       = $this->getLocale();

		foreach ($this->getTranslatableFields() as $tf) {
			$name = 'I18n__'.$tf;
			// get name of translation table
			$joinTable = $this->getTranslationTable()->table;
			
			$expression = new Expression("
				$name.foreign_key = ?.?
				AND $name.model = ?
				AND $name.field = ?
				AND $name.locale = ?"
				,array(
					$tableName,$tablePrimKey,
					$tableClass,
					$tf,
					$locale
				)
				,array(
					Expression::TYPE_IDENTIFIER,
					Expression::TYPE_IDENTIFIER
				)
			);
			
			$select->join(
				array($name => $joinTable),//join table name
				$expression //conditions
				// `I18n__description`.`content` AS `description`
				#,array($tf => 'content') 
					// this way we dont need postSelect replacement
			
				// `I18n__description`.`content` AS `sampletableI18n__description`
				,array($tableName.$name => 'content') 
					// toSolve: dar taghaabol baa exp. DMS gharaar migirad va field e tarjome shode tarjome nemishavad
                ,Select::JOIN_LEFT
			);
		}
	}
350954
public function iSelect( $option )
    {
        trigger_error(
            "iSelect is deprecated since v6.3.0, use PlatformUI Context iSelect instead",
            E_USER_DEPRECATED
        );
        $elements = $this->getXpath()->findXpath( "//select" );
        Assertion::assertNotEmpty( $elements, "Unable to find a select field" );
        $elements[0]->selectOption( $option );
    }
1123633
public void addSelectOption(CmsSelectWidgetOption option) {

        if (m_selectOptions == null) {
            m_selectOptions = new ArrayList<CmsSelectWidgetOption>();
        }
        m_selectOptions.add(option);
    }
736959
public function addOption($option)
    {
        $options = $this->getOptions();
        array_push($options, $option);
        $this->setOptions($options);
    }
543675
private function joinCategoryIdsTable(\Magento\Framework\DB\Select $select)
    {
        $select->group('entity_id');
        $select->joinInner(
            [self::CAT_PROD_LINK_ALIAS => $this->getTable(self::CAT_PROD_LINK)],
            'e.entity_id = ' . self::CAT_PROD_LINK_ALIAS . '.post_id',
            'category_id'
        );
    }
941955
protected function assignSelected(Option $option)
	{
		$attributes = $option->getAttributes();
		$attributes[] = 'selected';
		$option->setAttributes($attributes);
	}