Creates form fields and JavaScript includes to add a color picker widget.
<code>
$dh->output('background-color', '#f00');
</code>.

@param string $inputName
@param value  $string
@param array  $options
18991
public function output($inputName, $value = null, $options = array())
    {
        $view = View::getInstance();
        $view->requireAsset('core/colorpicker');
        $form = Loader::helper('form');
        $r = Request::getInstance();
        if ($r->request->has($inputName)) {
            $value = h($r->request->get($inputName));
        }
        $strOptions = '';
        $i = 0;
        $defaults = array();
        $defaults['value'] = $value;
        $defaults['className'] = 'ccm-widget-colorpicker';
        $defaults['showInitial'] = true;
        $defaults['showInput'] = true;
        $defaults['allowEmpty'] = true;
        $defaults['cancelText'] = t('Cancel');
        $defaults['chooseText'] = t('Choose');
        $defaults['preferredFormat'] = 'rgb';
        $defaults['showAlpha'] = false;
        $defaults['clearText'] = t('Clear Color Selection');
        $defaults['appendTo'] = '.ui-dialog';
        $strOptions = json_encode(array_merge($defaults, $options));

        $identifier = new \Concrete\Core\Utility\Service\Identifier();
        $identifier = $identifier->getString(32);

        echo "<input type=\"text\" data-color-picker=\"{$identifier}\" name=\"{$inputName}\" value=\"{$value}\" id=\"ccm-colorpicker-{$inputName}\" />";
        echo "<script type=\"text/javascript\">";
        echo "$(function () { $('[data-color-picker={$identifier}]').spectrum({$strOptions}); })";
        echo "</script>";
    }
1316353
public function input($fieldName, array $options = [])
    {
        if ($fieldName instanceof \Field\Model\Entity\Field) {
            if (!$this->_isRendering) {
                $this->_isRendering = true;
                $result = $fieldName->edit($this->_View);
                $this->_isRendering = false;

                return $result;
            } else {
                $options += ['value' => $fieldName->value, 'label' => $fieldName->label];
                if ($fieldName->metadata->required) {
                    $options['label'] .= ' *';
                    $options['required'] = 'required';
                }
                $fieldName = $fieldName->get('name');
            }
        }

        return parent::input($fieldName, $options);
    }
368796
function(options) {
      
      this.options = {};
      this.options.id = lang.isString(options.id) ? options.id  : Dom.generateId();
      this.options.className = options.className || "inputEx-Button";
      this.options.parentEl = lang.isString(options.parentEl) ? Dom.get(options.parentEl) : options.parentEl;
      
      // default type === "submit"
      this.options.type = (options.type === "link" || options.type === "submit-link") ? options.type : "submit";
      
      // value is the text displayed inside the button (<input type="submit" value="Submit" /> convention...)
      this.options.value = options.value;
      
      this.options.disabled = !!options.disabled;
      
      if (lang.isFunction(options.onClick)) {
         this.options.onClick = {fn: options.onClick, scope:this};
         
      } else if (lang.isObject(options.onClick)) {
         this.options.onClick = {fn: options.onClick.fn, scope: options.onClick.scope || this};
      }
      
   }
312213
public static function email($name, $value = null, array $options = [])
    {
        self::exclure($options);

        return self::input('email', $name, $value, $options);
    }
374735
public static function addName(string $name, string $handlerClass, array $option = [])
    {
        static::$handlers[$name] = BeanFactory::newInstance($handlerClass, $option);
    }
1091464
public function clockpicker($fieldName, array $options = [])
    {
        $defaults = [
            'div' => [
                'class' => 'form-group',
            ],
            'label' => [
                'class' => 'control-label form-control-label',
            ],
            'class' => 'form-control form-control-clockpicker',
            'type' => 'text',
        ];
        $options = Hash::merge($defaults, $options);
        return parent::input($fieldName, $options);
    }
825491
protected function generateTextinput($options, $currentValue = null)
    {
        $value = is_null($currentValue) ? $options['value'] : $currentValue;

        if (!is_string($value)) {
            $value = "";
        }

        if (!array_key_exists("type", $options)) {
            $options["type"] = "text";
        }

        unset($options["value"]);

        return sprintf('<input %s value="%s">', $this->arrayToHtmlAttributes($options), $value);
    }
112489
public static function submit($value, array $options = [])
    {
        self::exclure($options, ['type', 'value']);

        return self::input('submit', 'null', $value, $options);
    }
617730
function(element, options) {
    this.element = $(element).addClass('colorpicker-element');
    this.options = $.extend(true, {}, defaults, this.element.data(), options);
    this.component = this.options.component;
    this.component = (this.component !== false) ? this.element.find(this.component) : false;
    if (this.component && (this.component.length === 0)) {
      this.component = false;
    }
    this.container = (this.options.container === true) ? this.element : this.options.container;
    this.container = (this.container !== false) ? $(this.container) : false;

    // Is the element an input? Should we search inside for any input?
    this.input = this.element.is('input') ? this.element : (this.options.input ?
      this.element.find(this.options.input) : false);
    if (this.input && (this.input.length === 0)) {
      this.input = false;
    }
    // Set HSB color
    this.color = this.createColor(this.options.color !== false ? this.options.color : this.getValue());

    this.format = this.options.format !== false ? this.options.format : this.color.origFormat;

    if (this.options.color !== false) {
      this.updateInput(this.color);
      this.updateData(this.color);
    }

    this.disabled = false;

    // Setup picker
    var $picker = this.picker = $(this.options.template);
    if (this.options.customClass) {
      $picker.addClass(this.options.customClass);
    }
    if (this.options.inline) {
      $picker.addClass('colorpicker-inline colorpicker-visible');
    } else {
      $picker.addClass('colorpicker-hidden');
    }
    if (this.options.horizontal) {
      $picker.addClass('colorpicker-horizontal');
    }
    if (
      (['rgba', 'hsla', 'alias'].indexOf(this.format) !== -1) ||
      this.options.format === false ||
      this.getValue() === 'transparent'
    ) {
      $picker.addClass('colorpicker-with-alpha');
    }
    if (this.options.align === 'right') {
      $picker.addClass('colorpicker-right');
    }
    if (this.options.inline === true) {
      $picker.addClass('colorpicker-no-arrow');
    }
    if (this.options.colorSelectors) {
      var colorpicker = this,
        selectorsContainer = colorpicker.picker.find('.colorpicker-selectors');

      if (selectorsContainer.length > 0) {
        $.each(this.options.colorSelectors, function(name, color) {
          var $btn = $('<i />')
            .addClass('colorpicker-selectors-color')
            .css('background-color', color)
            .data('class', name).data('alias', name);

          $btn.on('mousedown.colorpicker touchstart.colorpicker', function(event) {
            event.preventDefault();
            colorpicker.setValue(
              colorpicker.format === 'alias' ? $(this).data('alias') : $(this).css('background-color')
            );
          });
          selectorsContainer.append($btn);
        });
        selectorsContainer.show().addClass('colorpicker-visible');
      }
    }

    // Prevent closing the colorpicker when clicking on itself
    $picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(function(e) {
      if (e.target === e.currentTarget) {
        e.preventDefault();
      }
    }, this));

    // Bind click/tap events on the sliders
    $picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha')
      .on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));

    $picker.appendTo(this.container ? this.container : $('body'));

    // Bind other events
    if (this.input !== false) {
      this.input.on({
        'keyup.colorpicker': $.proxy(this.keyup, this)
      });
      this.input.on({
        'input.colorpicker': $.proxy(this.change, this)
      });
      if (this.component === false) {
        this.element.on({
          'focus.colorpicker': $.proxy(this.show, this)
        });
      }
      if (this.options.inline === false) {
        this.element.on({
          'focusout.colorpicker': $.proxy(this.hide, this)
        });
      }
    }

    if (this.component !== false) {
      this.component.on({
        'click.colorpicker': $.proxy(this.show, this)
      });
    }

    if ((this.input === false) && (this.component === false)) {
      this.element.on({
        'click.colorpicker': $.proxy(this.show, this)
      });
    }

    // for HTML5 input[type='color']
    if ((this.input !== false) && (this.component !== false) && (this.input.attr('type') === 'color')) {

      this.input.on({
        'click.colorpicker': $.proxy(this.show, this),
        'focus.colorpicker': $.proxy(this.show, this)
      });
    }
    this.update();

    $($.proxy(function() {
      this.element.trigger('create');
    }, this));
  }
563274
public function outputHtml($html, $options = array())
    {
        $this->addHeader('Content-Type', 'text/html; charset=utf-8')
            ->addOptionalHeaders($options)
            ->sendHeaders();

        echo $html;
        exit;
    }
656072
public static function getColoredString($string, $foreground_color = '', $background_color = '')
    {
        $colored_string = '';

        // Check if given foreground color exists
        if (isset(static::$foreground_colors[$foreground_color])) {
            $colored_string .= "\033[".static::$foreground_colors[$foreground_color].'m';
        }

        // Check if given background color exists
        if (isset(static::$background_colors[$background_color])) {
            $colored_string .= "\033[".static::$background_colors[$background_color].'m';
        }

        if ($colored_string) {
            // Add string and end coloring
            $colored_string .= $string."\033[0m";
        } else {
            $colored_string = $string;
        }

        return $colored_string;
    }
1313791
public static function input($type, $name, $value = null, $options = array())
	{
		//if (!isset($options['name'])) $options['name'] = $name;

		// We will get the appropriate value for the given field. We will look for the
		// value in the session for the value in the old input data then we'll look
		// in the model instance if one is set. Otherwise we will just use empty.
		$id = self::getIdAttribute($name, $options);

		// Once we have the type, value, and ID we can merge them into the rest of the
		// attributes array so we can convert them into their HTML attribute format
		// when creating the HTML element. Then, we will return the entire input.
		$merge = compact('type', 'name', 'value', 'id');

		$options = array_merge($options, $merge);

		return '<input' . self::attributes($options) . ' />';
	}
1235943
public function datepickerInput(string $field, array $options = []): string
    {
        $options = Hash::merge([
            'type' => 'date',
        ], $options);

        return $this->Form->input($field, $options);
    }
504174
function(options) {
   	inputEx.ColorField.superclass.setOptions.call(this, options);
   	
   	// Overwrite options
   	this.options.className = options.className ? options.className : 'inputEx-Field inputEx-ColorField inputEx-PickerField';
   	
   	// Added options
   	this.options.palette = options.palette;
   	this.options.colors = options.colors;
   	
   	if (options.ratio) { this.options.ratio = options.ratio;}
   	if (options.cellPerLine) { this.options.cellPerLine = options.cellPerLine;}
   }
1373491
public function inputer($name, $value = null, $options = array())
    {
        $data = [
            'input_name' => $name,
            'input_id' => $name,
            'input_value' => $value
        ];
        
        // Check for class
        if (array_key_exists('class', $options)) {
            $data['wrapper_classes'] = $options['class']; // Save value
            unset($options['class']); // Remove key from array
        }
        
        // Check for ID
        if (array_key_exists('id', $options)) {
            $data['input_id'] = $options['id']; // Save value
            unset($options['id']); // Remove key from array
        }
        
        // Check for Label
        if (array_key_exists('label', $options)) {
            $data['label'] = $options['label']; // Save value
            unset($options['label']); // Remove key from array
        }
        
        // Check for Label Class
        if (array_key_exists('label_classes', $options)) {
            $data['label_classes'] = $options['label_classes']; // Save value
            unset($options['label_classes']); // Remove key from array
        }
        
        // Check for Help Text
        if (array_key_exists('help_text', $options)) {
            $data['help_text'] = $options['help_text']; // Save value
            unset($options['help_text']); // Remove key from array
        }
        
        $data['input_options'] = $options; // Remaining options
                
        return view('redminportal::partials.form-input', $data);
    }
11623
public function input($fieldName, $options = [])
    {
        //** we need to make the input combine with <span class="input-group-addon">@</span>
        if (isset($options['icon'])) {
            $icon = $this->Html->icon($options['icon']);

            $between = '<div class="input-group">' . '<span class="input-group-addon">' . $icon . '</span>';

            $after = '</div>';
            $options = [
                'between' => $between,
                'after' => $after,
            ];
        }
        if (!isset($options['placeholder'])) {
            $options['placeholder'] = __(Inflector::humanize(Inflector::underscore($fieldName)));
        }
        return parent::input($fieldName, $options);
    }
780812
protected function setInput($inputType, array $inputOptions)
	{
		$className   = __NAMESPACE__ . '\\Input\\' . $inputType;
		$this->input = new $className($inputOptions);
	}