Generate HTML select element to define additional field type
@param int $type Current field selected type
@return string HTML select element code
435628
public static function createSelect($type = 0)
    {
        // Create html view
        $html = '';

        // Define all types of data
        $typeData = array(
            'Текст' => 0,
            'Ресурс' => 1,
            'Дата' => 3,
            'Дата и время' => 10,
            'Select' => 4,
            'Таблицы' => 5,
            'Материал' => 6,
            'Число' => 7,
            'WYSIWYG' => 8,
            'Внешняя картинка' => 13,
            'Галерея' => 9
        );

        // Iterate current types
        foreach ($typeData as $key => $value) {
            // Check selected status
            $selected = ($type == $value) ? 'selected' : '';

            // Create options of select
            $html .= '<option value="' . $value . '" ' . $selected . '>' . $key . '</option>';
        }

        // Return view
        return '<select name="Type" id="Type">' . $html . '</select>';
    }
993562
function toHtml(){
        global $PAGE;

        // Enhance the select with javascript.
        $this->_generateId();
        $id = $this->getAttribute('id');

        if (!$this->isFrozen()) {
            $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,
                $this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));
        }

        $html = parent::toHTML();

        // Hacky bodge to add in the HTML code to the option tag. There is a nicer
        // version of this code in the new template version (see export_for_template).
        if ($this->valuehtmlcallback) {
            $html = preg_replace_callback('~value="([^"]+)"~', function($matches) {
                $value = html_entity_decode($matches[1]);
                $htmlvalue = call_user_func($this->valuehtmlcallback, $value);
                if ($htmlvalue !== false) {
                    return $matches[0] . ' data-html="' . s($htmlvalue) . '"';
                } else {
                    return $matches[0];
                }
            }, $html);
        }

        return $html;
    }
1166432
public function xml($type = 'dom')
	{
		$xml = $this->content;
		$type = trim(strtolower($type));
		switch($type)
		{
			case 'dom':
				$xml = new \DOMDocument();
				$xml->loadXML($this->content);
				break;
			case 'simple':
				$xml = new \SimpleXMLElement($this->content);
				break;
		}

		return $xml;
	}
1306114
public static function fetchType($type): string
    {
        if(\is_int($type)) {
            switch($type) {
                case self::TYPE_UNKNOWN:
                    return "unknown";
                case self::TYPE_INT:
                    return "integer";
                case self::TYPE_LONG:
                    return "long";
                case self::TYPE_SHORT:
                    return "short";
                case self::TYPE_BOOLEAN:
                    return "boolean";
                case self::TYPE_FLOAT:
                    return "float";
                case self::TYPE_STRING:
                    return "string";
                case self::TYPE_CHAR:
                    return "char";
                case self::TYPE_VARCHAR:
                    return "varchar";
                case self::TYPE_ARRAY:
                    return "array";
                case self::TYPE_OBJECT:
                    return "object";
                case self::TYPE_DATE:
                    return "date";
            }
        }
        return (string) $type;
    }
288394
public function findElementtypeByType($type)
    {
        $elementtypes = [];
        foreach ($this->elementtypeManager->findAll() as $elementtype) {
            if ($elementtype->getType() === $type) {
                $elementtypes[] = $elementtype;
            }
        }

        return $elementtypes;
    }
755599
public function getFormUrl($type = null)
    {
        $type = strtoupper($type);
        return $this->client->getFormBaseUrl() . $type . '.js?' . $this->getPaymentUrlQueryString(
            self::FORM_TYPE_FL === $type || self::FORM_TYPE_FLS === $type
        );
    }
1121802
protected static function getPositionerInstance($type)
    {
        if (!isset(self::$_positioners[$type])) {
            $class = '\\Dompdf\\Positioner\\'.$type;
            self::$_positioners[$type] = new $class();
        }
        return self::$_positioners[$type];
    }
283833
protected function generateHtmlCode($type, $file)
    {
        // Generate the url
        $url = $this->getUrlToTheAssetLoader($file);
        
        // Return the correct html tag
        if ($type === AssetManager::CSS) {
            return '<link rel="stylesheet" type="text/css" href="' . $url . '">' . PHP_EOL;
        } else if ($type === AssetManager::JS) {
            return '<script type="text/javascript" src="' . $url . '"></script>' . PHP_EOL;
        }
    }
644035
protected function getFormElements($type = 'list', $element)
    {
        $form = array();
        $template = $this->getTemplate("{$type}-block");
        $attributes = $this->getModelAttributes($this->tableInfo);

        foreach($attributes as $name)
        {
            $form[] = $this->renderElement($template, $element, $name);
        }

        return implode(PHP_EOL . PHP_EOL, $form);
    }
1071109
protected function renderElement($field)
    {
        $type = $field['type'];
        switch ($type) {
            case 'textarea':
            case 'markup':
            case 'select':
            case 'radio':
            case 'checkbox':
                return $this->$type($field);
            default:
                return $this->input($field);
        }
    }
1332558
function typeToForm($name, $type)
    {
        // get typedef
        if ($typeDef = $this->getTypeDef($type)) {
            // if struct
            if ($typeDef['phpType'] == 'struct') {
                $buffer .= '<table>';
                foreach ($typeDef['elements'] as $child => $childDef) {
                    $buffer .= "
					<tr><td align='right'>$childDef[name] (type: " . $this->getLocalPart($childDef['type']) . "):</td>
					<td><input type='text' name='parameters[" . $name . "][$childDef[name]]'></td></tr>";
                }
                $buffer .= '</table>';
                // if array
            } elseif ($typeDef['phpType'] == 'array') {
                $buffer .= '<table>';
                for ($i = 0; $i < 3; $i++) {
                    $buffer .= "
					<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
					<td><input type='text' name='parameters[" . $name . "][]'></td></tr>";
                }
                $buffer .= '</table>';
                // if scalar
            } else {
                $buffer .= "<input type='text' name='parameters[$name]'>";
            }
        } else {
            $buffer .= "<input type='text' name='parameters[$name]'>";
        }

        return $buffer;
    }
440862
public function renderLine($type = 'cursor')
    {
        $choice = $this->choices[$this->line];
        $this->stream->write(Terminal::cursorToLineStart());
        if (is_string($choice)) {
            $this->stream->write($this->getTemplate($type, $this->getGroupTemplate($choice)));
            $this->stream->write(Terminal::cursorToLineStart());
        } else {
            $choice = ['selected' => isset($this->selections[$choice['key']])] + $choice;
            $this->stream->write($this->getTemplate($type, $this->getChoiceTemplate($choice)));
            $this->stream->write(Terminal::cursorToLineStart());
        }
    }
1025187
public function createElement($type, $name, $options = null) {
        $element = parent::createElement($type, $name, $options);
        return $element;
    }
275029
public function render(): string
    {
        $elementKey = $this->arguments['elementKey'];
        $fieldKey = $this->arguments['fieldKey'];
        $field = $this->arguments['field'];
        $table = $this->arguments['table'];

        $this->fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        // if we have the whole field configuration
        if ($field) {
            // check if this field is in an repeating field
            if ($field["inlineParent"]) {
                // if yes, the label is in the configuration
                $label = $field["label"];
            } else {
                // otherwise the type can only be tt_content or pages
                if ($table) {
                    // if we have table param, the type must be the table
                    $type = $table;
                } else {
                    // otherwise try to get the label, set param $excludeInlineFields to true
                    $type = $this->fieldHelper->getFieldType($fieldKey, $elementKey, true);
                }
                $label = $this->fieldHelper->getLabel($elementKey, $fieldKey, $type);
            }
        } else {
            // if we don't have the field configuration, try the best to fetch the type and the correct label
            $type = $this->fieldHelper->getFieldType($fieldKey, $elementKey, false);
            $label = $this->fieldHelper->getLabel($elementKey, $fieldKey, $type);
        }
        return $label;
    }
888537
public function __cast(string $type)
    {
        if (!isset($this->__delegate)) {
            $this->__createDelegate();
        }

        return $this->__delegate->__cast($type);
    }
376233
protected function getHtmlType($type)
    {
        $map = Config::getEloquentToHtmlMap();

        if (array_key_exists($type, $map)) {
            return $map[$type];
        }

        return 'text';
    }
356223
public function formfield_select($config = array())
    {
        $config = new AnConfig($config);

        $config->append(array(
            'class' => 'input-block-level',
            'name' => '',
            'selected' => '',
            'description' => '',
            'id' => '',
            'label' => '',
            'options' => array(),
            'disabled' => false,
        ));

        return $this->_render('formfield_select', $config);
    }