Returns the main input field for rendering

@since 1.0.0
@see \uix\ui\uix
@access public
545009
public function input() {

		$settings = array( 'textarea_name' => $this->name() );
		if ( ! empty( $this->struct['settings'] ) && is_array( $this->struct['settings'] ) ) {
			$settings = array_merge( $this->struct['settings'], $settings );
		}

		ob_start();

		wp_editor( $this->get_value(), 'control-' . $this->id(), $settings );

		return ob_get_clean();

	}
309261
public static function getMainField()
    {
        //
        $attribute = 'MainField';

        // retrieve value from class setting definition
        if (!static::hasClassAttribute($attribute)) {
            $mainField = null;

            //
            $schema = static::getSchema();

            //
            foreach ($schema as $field => &$attributes) {
                if ($attributes['Key'] == 'PRI') {
                    continue;
                }

                //
                $mainField = $field;

                //
                break;
            }

            // store as setting for future request
            static::setClassAttribute($attribute, $mainField);
        }

        // return primary key field name
        return static::getClassAttribute($attribute);
    }
1271457
public function getInput()
    {
        $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . 'input markdown-input';
        $this->htmlOptions['ajax-url'] = $this->previewURL ?: WebApp::get()->request()->getCurrentURL();
        $this->htmlOptions['csrf-key'] = WebApp::get()->request()->getCsrfKey();
        $this->htmlOptions['csrf-value'] = WebApp::get()->request()->getCsrfValue();
        return Form::get()->textarea($this->getName(), $this->getValue(), $this->htmlOptions);
    }
753315
public function render()
    {
        /** @var TbForm $parent */
        $parent = $this->getParent();
        /** @var TbActiveForm $form */
        $form = $parent->getActiveFormWidget();
        /** @var CModel $model */
        $model = $parent->getModel();

        // Hidden fields do not require control groups.
        if ($this->type === TbHtml::INPUT_TYPE_HIDDEN) {
            return $form->hiddenField($model, $this->name, $this->attributes);
        }

        if (isset(self::$coreTypes[$this->type])) {
            $type = self::$coreTypes[$this->type];
        } else {
            $type = TbHtml::INPUT_TYPE_CUSTOM;
            $properties = $this->attributes;
            $properties['model'] = $model;
            $properties['attribute'] = $this->name;
            $this->attributes['input'] = $parent->getOwner()->widget($this->type, $properties, true);
        }

        return $form->createControlGroup($type, $model, $this->name, $this->attributes, $this->items);
    }
654212
public function GetActiveSettingAsHiddenInputField()
    {
        $sHTML = '';
        if (is_array($this->aActiveFilterData)) {
            reset($this->aActiveFilterData);
            foreach ($this->aActiveFilterData as $sItemName) {
                $sHTML .= '<input type="hidden" name="'.TGlobal::OutHTML($this->GetURLInputName()).'[]" value="'.TGlobal::OutHTML($sItemName).'" />';
            }
            reset($this->aActiveFilterData);
        }

        return $sHTML;
    }
353601
public function begin()
    {
        $this->form->beforeFieldRender($this);

        $inputID = $this->getInputId();
        $attribute = Html::getAttributeName($this->attribute);
        $options = $this->options;
        $class = isset($options['class']) ? (array) $options['class'] : [];
        $class[] = "field-$inputID";
        if ($this->model->isAttributeRequired($attribute)) {
            $class[] = $this->form->requiredCssClass;
        }
        $options['class'] = implode(' ', $class);
        if ($this->form->validationStateOn === ActiveForm::VALIDATION_STATE_ON_CONTAINER) {
            $this->addErrorClassIfNeeded($options);
        }
        $tag = ArrayHelper::remove($options, 'tag', 'div');

        return Html::beginTag($tag, $options);
    }
674544
protected function getInput()
	{
		$html = array();
		$attr = '';

		// Initialize some field attributes.
		$attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
		$attr .= $this->multiple ? ' multiple="multiple"' : '';

		// Initialize JavaScript field attributes.
		$attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		// Get the field groups.
		$groups = (array) $this->getGroups();

		// Create a read-only list (no name) with a hidden input to store the value.
		if ((string) $this->element['readonly'] == 'true')
		{
			$html[] = HtmlSelect::groupedlist(
				$groups,
				null,
				array(
					'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false,
					'option.text.toHtml' => false
				)
			);
			$html[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '"/>';
		}
		else
		// Create a regular list.
		{
			$html[] = HtmlSelect::groupedlist(
				$groups,
				$this->name,
				array(
					'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false,
					'option.text.toHtml' => false
				)
			);
		}

		return implode($html);
	}
551244
public function input() {

		$input  = '';
		$values = (array) $this->get_value();
		$id     = $this->id();

		foreach ( $this->struct['choices'] as $option_value => $option_label ) {
			$sel       = null;
			$option_id = $id . '-' . sanitize_key( $option_value );
			if ( in_array( $option_value, $values ) ) {
				$sel = ' checked="checked"';
			}

			$input .= '<div class="uix-' . esc_attr( $this->type ) . '">';
			$input .= '<label for="' . $option_id . '">';
			$input .= '<input id="' . $option_id . '" ' . $this->build_attributes() . ' value="' . esc_attr( $option_value ) . '"' . $sel . '>';
			$input .= esc_html( $option_label );
			$input .= '</label>';
			$input .= '</div>';
		}

		return $input;
	}
465495
protected function getInput()
	{
		// Initialize variables.

		// Get the client id.
		$clientId = $this->element['client_id'];

		if (is_null($clientId) && $this->form instanceof Form)
		{
			$clientId = $this->form->getValue('client_id');
		}
		$clientId = (int) $clientId;

		$client = ClientManager::client($clientId);

		// Get the extension.
		$extn = (string) $this->element['extension'];

		if (empty($extn) && ($this->form instanceof Form))
		{
			$extn = $this->form->getValue('extension');
		}

		$extn = preg_replace('#\W#', '', $extn);

		// Get the template.
		$template = (string) $this->element['template'];
		$template = preg_replace('#\W#', '', $template);

		// Get the style.
		if ($this->form instanceof Form)
		{
			$template_style_id = $this->form->getValue('template_style_id');
		}

		$template_style_id = preg_replace('#\W#', '', $template_style_id);

		// Get the view.
		$view = (string) $this->element['view'];
		$view = preg_replace('#\W#', '', $view);

		// If a template, extension and view are present build the options.
		if ($extn && $view && $client)
		{
			// Load language file
			$lang = App::get('language');
			$lang->load($extn . '.sys', App::get('component')->path($extn) . '/admin', null, false, true);

			// Get the database object and a new query object.
			$db = App::get('db');

			// Build the query.
			$query = $db->getQuery()
				->select('e.element')
				->select('e.name')
				->from('#__extensions', 'e')
				->whereEquals('e.client_id', (int) $clientId)
				->whereEquals('e.type', 'template')
				->whereEquals('e.enabled', '1');

			if ($template)
			{
				$query->whereEquals('e.element', $template);
			}

			if ($template_style_id)
			{
				$query
					->join('#__template_styles as s', 's.template', 'e.element', 'left')
					->whereEquals('s.id', (int) $template_style_id);
			}

			// Set the query and load the templates.
			$db->setQuery($query->toString());
			$templates = $db->loadObjectList('element');

			// Check for a database error.
			if ($db->getErrorNum())
			{
				throw new Exception(500, $db->getErrorMsg());
			}

			$paths = array(PATH_APP, PATH_CORE);

			$filesystem = App::get('filesystem');

			foreach ($paths as $path)
			{
				if (is_dir($path . '/components/' . $extn))
				{
					break;
				}
			}

			// Build the search paths for component layouts.
			$component_path = Util::normalizePath($path . '/components/' . $extn . '/views/' . $view . '/tmpl');

			// Prepare array of component layouts
			$component_layouts = array();

			// Prepare the grouped list
			$groups = array();

			// Add a Use Global option if useglobal="true" in XML file
			if ($this->element['useglobal'] == 'true')
			{
				$groups[$lang->txt('JOPTION_FROM_STANDARD')]['items'][] = Dropdown::option('', $lang->txt('JGLOBAL_USE_GLOBAL'));
			}

			// Add the layout options from the component path.
			if (is_dir($component_path) && ($component_layouts = $filesystem->files($component_path, '^[^_]*\.xml$', false, true)))
			{
				// Create the group for the component
				$groups['_'] = array();
				$groups['_']['id'] = $this->id . '__';
				$groups['_']['text'] = $lang->txt('JOPTION_FROM_COMPONENT');
				$groups['_']['items'] = array();

				foreach ($component_layouts as $i => $file)
				{
					// Attempt to load the XML file.
					if (!$xml = simplexml_load_file($file))
					{
						unset($component_layouts[$i]);

						continue;
					}

					// Get the help data from the XML file if present.
					if (!$menu = $xml->xpath('layout[1]'))
					{
						unset($component_layouts[$i]);

						continue;
					}

					$menu = $menu[0];

					// Add an option to the component group
					$value = $filesystem->name($file);
					$component_layouts[$i] = $value;
					$text = isset($menu['option']) ? $lang->txt($menu['option']) : (isset($menu['title']) ? $lang->txt($menu['title']) : $value);
					$groups['_']['items'][] = Dropdown::option('_:' . $value, $text);
				}
			}

			// Loop on all templates
			if ($templates)
			{
				foreach ($templates as $template)
				{
					$template->path = '';

					foreach ($paths as $p)
					{
						if (is_dir($p . '/templates/' . $template->element))
						{
							$template->path = $p . '/templates/' . $template->element;
							break;
						}
					}

					if (!$template->path)
					{
						continue;
					}

					// Load language file
					$lang->load('tpl_' . $template->element . '.sys', $template->path, null, false, true);

					$template_path = Util::normalizePath($template->path . '/html/' . $extn . '/' . $view);

					// Add the layout options from the template path.
					if (is_dir($template_path) && ($files = $filesystem->files($template_path, '^[^_]*\.php$', false, true)))
					{
						// Files with corresponding XML files are alternate menu items, not alternate layout files
						// so we need to exclude these files from the list.
						$xml_files = $filesystem->files($template_path, '^[^_]*\.xml$', false, true);
						for ($j = 0, $count = count($xml_files); $j < $count; $j++)
						{
							$xml_files[$j] = $filesystem->name($xml_files[$j]);
						}
						foreach ($files as $i => $file)
						{
							// Remove layout files that exist in the component folder or that have XML files
							if (in_array($filesystem->name($file), $component_layouts) || in_array($filesystem->name($file), $xml_files))
							{
								unset($files[$i]);
							}
						}
						if (count($files))
						{
							// Create the group for the template
							$groups[$template->name] = array();
							$groups[$template->name]['id'] = $this->id . '_' . $template->element;
							$groups[$template->name]['text'] = $lang->txt('JOPTION_FROM_TEMPLATE', $template->name);
							$groups[$template->name]['items'] = array();

							foreach ($files as $file)
							{
								// Add an option to the template group
								$value = $filesystem->name($file);
								$text = $lang->hasKey($key = strtoupper('TPL_' . $template->name . '_' . $extn . '_' . $view . '_LAYOUT_' . $value))
									? $lang->txt($key)
									: $value;
								$groups[$template->name]['items'][] = Dropdown::option($template->element . ':' . $value, $text);
							}
						}
					}
				}
			}

			// Compute attributes for the grouped list
			$attr = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';

			// Prepare HTML code
			$html = array();

			// Compute the current selected values
			$selected = array($this->value);

			// Add a grouped list
			$html[] = Dropdown::groupedlist(
				$groups,
				$this->name,
				array(
					'id' => $this->id,
					'group.id' => 'id',
					'list.attr' => $attr,
					'list.select' => $selected
				)
			);

			return implode($html);
		}

		return '';
	}
701973
public function openInput()
    {
        if (null === $this->_stdin) {
            return STDIN;
        } else {
            $this->_stdin = fopen($this->_stdin, 'rb');

            return $this->_stdin;
        }
    }
101679
public function render() {

		$output = '<div id="' . esc_attr( $this->id() ) . '" class="uix-control uix-control-' . esc_attr( $this->type ) . ' ' . esc_attr( $this->id() ) . '">';

		$output .= $this->label();
		$output .= '<div class="uix-control-input">';
		$output .= $this->input();
		$output .= '</div>';
		$output .= $this->description();

		$output .= '</div>';

		return $output;
	}
302642
protected function renderSwitch()
    {
        $value = ArrayHelper::getValue($this->inputOptions, 'value', null);

        if ($this->hasModel()) {
            $attributeValue = Html::getAttributeValue($this->model, $this->attribute);
            $this->checked = "{$value}" === "{$attributeValue}";
        }

        $name = ArrayHelper::remove($this->inputOptions, 'name', null);

        return implode("\n", [
            Html::beginTag('label'),
            $this->renderLabel('off'),
            Html::checkbox($name, $this->checked, $this->inputOptions),
            Html::tag('span', '', ['class' => 'lever']),
            $this->renderLabel('on'),
            Html::endTag('label'),
        ]);
    }
867773
public function begin()
    {
        if ($this->form->enableClientScript) {
            $clientOptions = $this->getClientOptions();
            if (!empty($clientOptions)) {
                $this->form->attributes[] = $clientOptions;
            }
        }

        $inputID = $this->getInputId();
        $attribute = Html::getAttributeName($this->attribute);
        $options = $this->options;
        $class = isset($options['class']) ? [$options['class']] : [];
        $class[] = "field-$inputID";
        if ($this->model->isAttributeRequired($attribute)) {
            $class[] = $this->form->requiredCssClass;
        }
        if ($this->model->hasErrors($attribute)) {
            $class[] = $this->form->errorCssClass;
        }
        $options['class'] = implode(' ', $class);
        $tag = ArrayHelper::remove($options, 'tag', 'div');

        return Html::beginTag($tag, $options);
    }
536786
public function render()
    {
        // Always add this class
        $this->addClass('autocomplete');

        // Make the hidden field.  Render it before we (might) set the value to
        // the title of the parent.
        $hidden = $this->renderHidden();

        // If there is a value and the field name matches a relationship on function
        // on the current item, then get and display the title text for the related
        // record
        if ($parent = $this->parentModel()) {
            $this->value = $parent->getAdminTitleAttribute();

        // Else, if there is no parent (it's a create page), set the value if a
        // title was set
        } elseif ($this->title) {
            $this->value = $this->title;
        }

        // Add the hidden field and return
        return parent::render().$hidden;
    }
1328206
public function input() {

		$data  = (array) $this->get_value();
		$input = '<div ' . $this->build_attributes() . '>';

		foreach ( $data as $item ) {
			$input .= $this->render_item( $item );
		}

		$input .= '</div>';

		$input .= '<div class="uix-post-relation-footer"><button class="button button-small uix-add-relation" type="button">' . esc_html( $this->struct['add_label'] ) . '</button></div>';
		$input .= '<div class="uix-post-relation-panel"><span class="uix-post-relation-spinner spinner"></span>';
		$input .= '<input type="search" class="uix-ajax" data-load-element="_parent" data-delay="250" data-method="POST" data-uix-id="' . esc_attr( $this->id() ) . '" data-event="input paginate" data-before="uix_related_post_before" data-callback="uix_related_post_handler" data-target="#' . esc_attr( $this->id() ) . '-search-results">';
		$input .= '<div class="uix-post-relation-results" id="' . esc_attr( $this->id() ) . '-search-results">';
		$input .= '</div></div>';

		return $input;
	}
99061
public function render()
    {
        $elementKey = $this->arguments['elementKey'];
        $fieldKey = $this->arguments['fieldKey'];
        $type = $this->arguments['type'];

        $this->fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        $formType = $this->fieldHelper->getFormType($fieldKey, $elementKey, $type);
        return $formType;
    }
908482
protected function getInput()
	{
		// Get the client id.
		$clientId = $this->element['client_id'];

		if (is_null($clientId) && $this->form instanceof Form)
		{
			$clientId = $this->form->getValue('client_id');
		}
		$clientId = (int) $clientId;

		$client = ClientManager::client($clientId);

		// Get the module.
		$module = (string) $this->element['module'];

		if (empty($module) && ($this->form instanceof Form))
		{
			$module = $this->form->getValue('module');
		}

		$module = preg_replace('#\W#', '', $module);

		// Get the template.
		$template = (string) $this->element['template'];
		$template = preg_replace('#\W#', '', $template);

		// Get the style.
		if ($this->form instanceof Form)
		{
			$template_style_id = $this->form->getValue('template_style_id');
		}

		$template_style_id = preg_replace('#\W#', '', $template_style_id);

		// If an extension and view are present build the options.
		if ($module && $client)
		{

			// Load language file
			$lang = App::get('language');
				$lang->load($module . '.sys', PATH_APP . '/modules/' . $module, null, false, true)
			||	$lang->load($module . '.sys', PATH_CORE . '/modules/' . $module, null, false, true);

			// Get the database object and a new query object.
			$db = App::get('db');

			// Build the query.
			$query = $db->getQuery()
				->select('e.element')
				->select('e.name')
				->from('#__extensions', 'e')
				->whereEquals('e.client_id', (int) $clientId)
				->whereEquals('e.type', 'template')
				->whereEquals('e.enabled', '1');

			if ($template)
			{
				$query->whereEquals('e.element', $template);
			}

			if ($template_style_id)
			{
				$query
					->join('#__template_styles as s', 's.template', 'e.element', 'left')
					->whereEquals('s.id', (int) $template_style_id);
			}

			// Set the query and load the templates.
			$db->setQuery($query->toString());
			$templates = $db->loadObjectList('element');

			// Check for a database error.
			if ($db->getErrorNum())
			{
				App::abort(500, $db->getErrorMsg());
			}

			$paths = array(PATH_APP, PATH_CORE);

			foreach ($paths as $path)
			{
				if (is_dir($path . '/modules/' . $module))
				{
					break;
				}
			}

			// Build the search paths for module layouts.
			$module_path = Util::normalizePath($path . '/modules/' . $module . '/tmpl');

			// Prepare array of component layouts
			$module_layouts = array();

			// Prepare the grouped list
			$groups = array();

			// Add the layout options from the module path.
			if (is_dir($module_path) && ($module_layouts = App::get('filesystem')->files($module_path, '^[^_]*\.php$')))
			{
				// Create the group for the module
				$groups['_'] = array();
				$groups['_']['id'] = $this->id . '__';
				$groups['_']['text'] = $lang->txt('JOPTION_FROM_MODULE');
				$groups['_']['items'] = array();

				foreach ($module_layouts as $file)
				{
					// Add an option to the module group
					$value = App::get('filesystem')->name(ltrim($file, DIRECTORY_SEPARATOR));
					$text = $lang->hasKey($key = strtoupper($module . '_LAYOUT_' . $value)) ? $lang->txt($key) : $value;
					$groups['_']['items'][] = Dropdown::option('_:' . $value, $text);
				}
			}

			// Loop on all templates
			if ($templates)
			{
				foreach ($templates as $template)
				{
					$template->path = '';

					foreach ($paths as $p)
					{
						if (is_dir($p . '/templates/' . $template->element))
						{
							$template->path = $p . '/templates/' . $template->element;
							break;
						}
					}

					if (!$template->path)
					{
						continue;
					}

					// Load language file
					$lang->load('tpl_' . $template->element . '.sys', $template->path, null, false, true);

					$template_path = Util::normalizePath($template->path . '/html/' . $module);

					// Add the layout options from the template path.
					if (is_dir($template_path) && ($files = App::get('filesystem')->files($template_path, '^[^_]*\.php$')))
					{
						foreach ($files as $i => $file)
						{
							// Remove layout that already exist in component ones
							if (in_array($file, $module_layouts))
							{
								unset($files[$i]);
							}
						}

						if (count($files))
						{
							// Create the group for the template
							$groups[$template->element] = array();
							$groups[$template->element]['id'] = $this->id . '_' . $template->element;
							$groups[$template->element]['text'] = $lang->txt('JOPTION_FROM_TEMPLATE', $template->name);
							$groups[$template->element]['items'] = array();

							foreach ($files as $file)
							{
								// Add an option to the template group
								$value = App::get('filesystem')->name(ltrim($file, DIRECTORY_SEPARATOR));
								$text = $lang->hasKey($key = strtoupper('TPL_' . $template->element . '_' . $module . '_LAYOUT_' . $value))
									? $lang->txt($key)
									: $value;
								$groups[$template->element]['items'][] = Dropdown::option($template->element . ':' . $value, $text);
							}
						}
					}
				}
			}
			// Compute attributes for the grouped list
			$attr = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';

			// Prepare HTML code
			$html = array();

			// Compute the current selected values
			$selected = array($this->value);

			// Add a grouped list
			$html[] = Dropdown::groupedlist(
				$groups,
				$this->name,
				array(
					'id'          => $this->id,
					'group.id'    => 'id',
					'list.attr'   => $attr,
					'list.select' => $selected
				)
			);

			return implode($html);
		}

		return '';
	}