@param string $elmType
@param string $selectedConditions
@param string $attribute
@param string $selectedValues
@param string $valueName
@param string $response

@return null
550720
private function evaluateElmType($elmType, $selectedConditions, $attribute, $selectedValues, $valueName, &$response)
    {
        if ($elmType == 'select' or $selectedConditions == 'null') {
            $isEmpty = false;

            if ($selectedConditions == 'null') {
                $isEmpty = true;
            }

            $valueOptions = $this->ruleValue->getValueSelectOptions($attribute, $isEmpty);

            $response['cvalue'] = str_replace(
                'value="' . $selectedValues . '"',
                'value="' . $selectedValues . '"' . 'selected="selected"',
                $this->getOptionHtml('cvalue', $valueName, $valueOptions)
            );
        } elseif ($elmType == 'text') {
            $encodedValue = $this->escaper->escapeHtml($selectedValues);
            $html = "<input style='width:160px' title='cvalue' name='$valueName' value='$encodedValue'/>";
            $response['cvalue'] = $html;
        }
    }
266356
private void changeEntityContentValues(
        CmsEntity newContent,
        String entityId,
        String attributeName,
        int valueIndex,
        ChangeType type) {

        switch (type) {
            case value:
                CmsAttributeHandler handler = m_rootHandler.getHandlerById(entityId, attributeName);
                CmsEntity entity = newContent.getEntityById(entityId);
                if ((entity != null) && (entity.getAttribute(attributeName) != null)) {
                    String value = entity.getAttribute(attributeName).getSimpleValues().get(valueIndex);
                    if ((handler != null) && handler.hasValueView(valueIndex) && (value != null)) {
                        handler.changeValue(value, valueIndex);
                        break;
                    }
                }
                //$FALL-THROUGH$
            default:
                m_editor.rerenderForm(newContent);
        }
    }
322006
protected function getBatchActionResponse($actionFunction, array $selectedIds)
    {
        $response = $this->getIndexRedirectionResponse();

        $successfullyUsedIds = array();
        foreach ($selectedIds as $id) {
            try {
                call_user_func($actionFunction, $id);
                $successfullyUsedIds[] = $id;
            } catch (NotFoundException $exception) {
                $response->addErrorMessage(sprintf(_('%s %s was not found.'),
                    _($this->getItemName()),
                    $id
                ));
            }
        }

        // TODO: Create a Report with the successfully used IDs.

        $response->addNotice(sprintf(_('%d %s were affected.'),
            count($successfullyUsedIds), _($this->getCollectionName())
        ));

        return $response;
    }
321952
private function prepareTextValue(DOMElement $xml, array $attributes = null)
    {
        $text = static::getElementText($xml, true);

        return (isset($attributes['type']) && 'text' === $attributes['type']) ?
            static::clearValue($text) :
            static::getPhpValue($text, null, $this);
    }
385935
private function collectAttributeTypeMetadata(
        PropertyMetadataBuilder $metadata,
        Attribute $attribute
    ) : void {
        $type = $attribute->type;

        // handle the case if the property type is mixed
        if ('mixed' === $type) {
            return;
        }

        if ($attribute->required) {
            $metadata->withBeingRequired();
        }

        // Evaluate type

        // Checks if the property has array<type>
        if (false !== $pos = strpos($type, '<')) {
            $arrayType = substr($type, $pos + 1, -1);

            $metadata->withType(new ArrayType(new MixedType(), $this->createTypeFromName($arrayType)));

            return;
        }

        // Checks if the property has type[]
         if (false !== $pos = strrpos($type, '[')) {
            $arrayType = substr($type, 0, $pos);

            $metadata->withType(new ArrayType(new MixedType(), $this->createTypeFromName($arrayType)));

            return;
        }

        $metadata->withType($this->createTypeFromName($attribute->type));
    }
452373
public function getAttributeValueByName($attributeValueName)
    {
        /** @var AttributeValueInterface $attributeValue */
        foreach ($this->attributeValues as $attributeValue) {
            if ($attributeValue->getAttributeName() == $attributeValueName) {
                return $attributeValue;
            }
        }

        return null;
    }
484925
public function elementAttributeContains($selectorType, $selector, $attribute, $text)
    {
        $element = $this->elementAttributeExists($selectorType, $selector, $attribute);
        $actual = $element->getAttribute($attribute);
        $regex = '/'.preg_quote($text, '/').'/ui';

        $message = sprintf(
            'The text "%s" was not found in the attribute "%s" of the %s.',
            $text,
            $attribute,
            $this->getMatchingElementRepresentation($selectorType, $selector)
        );

        $this->assertElement((bool) preg_match($regex, $actual), $message, $element);
    }
1227674
public function select($name, $list = [], $selected = null, array $selectAttributes = [], array $optionsAttributes = [], array $optgroupsAttributes = [])
    {
        $selectAttributes = $this->appendClassToOptions('form-control', $selectAttributes);

        if ($this->hasErrors($name)) {
            $selectAttributes = $this->appendClassToOptions('is-invalid', $selectAttributes);
        }

        return parent::select($name, $list, $selected, $selectAttributes, $optionsAttributes, $optgroupsAttributes);
    }
437270
protected function filterAttribute(
        EAVQueryBuilderInterface $eavQb,
        AttributeQueryBuilderInterface $attributeQueryBuilder,
        $value,
        $strategy = null,
        string $operationName = null
    ) {
        switch ($strategy) {
            case null:
            case BaseSearchFilter::STRATEGY_EXACT:
                $value = trim($value, '%');
                break;
            case BaseSearchFilter::STRATEGY_PARTIAL:
                $value = '%'.trim($value, '%').'%';
                break;
            case BaseSearchFilter::STRATEGY_START:
                $value = trim($value, '%').'%';
                break;
            case BaseSearchFilter::STRATEGY_END:
                $value = '%'.trim($value, '%');
                break;
            case BaseSearchFilter::STRATEGY_WORD_START:
                $value = '%'.trim($value, '%').'%'; // No, we are not going to implement this
                break;
            default:
                throw new InvalidArgumentException("strategy {$strategy} does not exist.");
        }

        return $attributeQueryBuilder->like($value);
    }
473538
public function allLanguageValues($values, $attribute = null)
    {
        $model = new $this->owner->modelClass();

        return $this->anyLanguageValues($values, $attribute)->andHaving(new Expression('COUNT(*) = ' . count($model->filterLanguageValues($values))));
    }
279184
public function fromLdap(array $entry, array $selectedAttributes)
    {
        $this->selectedAttributes = $this->getSelectedAttributes($selectedAttributes, $entry);

        $newEntry = [];
        foreach ($entry as $attribute => $value) {
            if ($this->schema) {
                $newEntry = $this->setMappedNames($newEntry, $attribute, $value);
            }
            // If the LDAP attribute name was also explicitly selected for, and is not already in the array, add it...
            if ($this->selectedButNotPartOfEntry($attribute, $newEntry)) {
                $newEntry[self::arraySearchGetValue($attribute, $this->selectedAttributes)] = $value;
            }
        }
        // The DN attribute must be present as it is used in many critical functions.
        $newEntry = $this->addDnFromLdapIfNotPresent($newEntry, $entry);

        return $newEntry;
    }
641160
function(input, datalistSelectValue) {
		var lastSeperator;

		// In case of type=email and multiple attribute, we need to set up the resulting inputs value differently
		input.value =
			// Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly
			input.getAttribute('type') === 'email' &&
			input.getAttribute('multiple') !== null &&
			(lastSeperator = input.value.lastIndexOf(',')) > -1
				? input.value.slice(0, lastSeperator) + ',' + datalistSelectValue
				: datalistSelectValue;
	}
1140351
private static function getSelectOptions($list, $selectedValue) {
        $result = '';

        if ($selectedValue !== null && !is_array($selectedValue)) {
            $selectedValue = array($selectedValue);
        }

        foreach ($list as $item) {
            $itemAttr = array();
            $text = '';

            if ($item instanceof SelectListItem) {
                $text = $item->text;
                $itemAttr['value'] = $item->value;

                if ($item->disabled === true) {
                    $itemAttr['disabled'] = 'disabled';
                }

                if ($selectedValue === null && $item->selected === true) {
                    $itemAttr['selected'] = 'selected';
                }
                elseif ($selectedValue !== null && in_array($item->value, $selectedValue) === true) {
                    $itemAttr['selected'] = 'selected';
                }
            }
            else {
                $text = $item;

                if ($selectedValue !== null && in_array($item, $selectedValue)) {
                    $itemAttr['selected'] = 'selected';
                }
            }

            $attr = self::buildAttributes($itemAttr);

            $result .= '<option' . (!empty($attr) ? ' ' : '') . $attr . '>';
            $result .= htmlspecialchars($text);
            $result .= '</option>';
        }

        return $result;
    }
162339
public function search($model , $fields , $value = "" , $select = null ,  $orderBy = null , $responseType = true , $limit = 10){
        $this->model = ucfirst($model);
        $this->fields = $fields;
        $this->limit  = $limit;
        $this->value = $value;
        $this->type = $responseType;
        $this->order = $orderBy;
        $this->select = $select;
        return $this->init();
    }
1110597
public static function select(string $name = '', array $values = [], array $selected = [],
                                  array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'class' => 'form-select'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $attributes['data-selected'] = \implode(',', $selected);
        $wrapperClass = ['select-wrapper'];

        if (\array_key_exists('multiple', $userAttributes) && $userAttributes['multiple'] === true) {
            $attributes['multiple'] = 'multiple';
            $attributes['name'] = \sprintf('%s[]', $attributes['name']);
            $wrapperClass[] = 'multiple';
        }
        if (\array_key_exists('wrapper-class', $userAttributes)) {
            $wrapperClass[] = $userAttributes['wrapper-class'];
        }
        if (\array_key_exists('disabled', $userAttributes)) {
            $wrapperClass[] = 'disabled';
        }
        $clearAttributes = ['method-get', 'id', 'multiple', 'wrapper-class'];
        $userAttributes = static::clearAttributes($userAttributes, $clearAttributes);
        $select = Tags::select(self::getOptions($values, $selected, 0), \array_merge($attributes, $userAttributes));

        return Tags::div($select, ['class' => \implode(' ', $wrapperClass)]);
    }
1002906
function(oAtt, aResult){
			if (!oAtt.getSelected()) {
				return;
			}
			aResult.push(oAtt);
			var aValues = oAtt.getAttributesInternal();
			for (var idx = 0; idx < aValues.length; idx++) {
				_computeSelectedAttributes(aValues[idx], aResult);
			}
		}
740185
public static function options2html(array $options = [], $selectedValue = null){
        // buffer prepared html codes
        $buffer = [];
        // loop options
        foreach ($options as $key => $value) {
            // make optgroup
            if(is_array($value)){
                // turn optgroup options to html
                $optgroupOptions = static::options2html($value, $selectedValue);
                // append prepared group to buffer
                $buffer[] = "<optgroup label='$key'>$optgroupOptions</options>";
            } else {
            // make option
                // print selected='' if option value and selected value are equivalent
                $selected = static::selected($selectedValue, $value);
                // append prepared option to buffer
                $buffer[] = "<option value='$value' $selected>$key</option>";
            }
        }
        // make html
        $html = implode('', $buffer);
        // return result
        return $html;
    }