select area form
@param  string $name
@param  string $value
@param  array  $settings
@return string
506519
static public function area($name, $value=null, $settings=[])
    {
        $name || $name = 'row[area_id]';
        if (!isset($settings['modal_url'])) $settings['modal_url'] = Ioc::url('common/data/select/area');
        
        return static::select($name, $value, $settings);
    }
1136175
public function config($name, $value = null)
    {
        // Check for massive assignaments
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->config($key, $value);
            }
            return true;
        }

        // Assign a new value
        if (isset($value)) {
            $this->container['settings'][$name] = $value;
        }

        // Abort if the configuration key does not exist
        if (!isset($this->container['settings'][$name])) {
            throw new \Exception('Configuration key not defined: ' . $name, 500);
        }

        // Return value
        return $this->container['settings'][$name];
    }
1256594
public function setSetting( string $name, $value ): self
	{
		if (in_array($name, self::SETTINGS_INIT_ONLY))
			throw new SettingsException("Settings option '$name' can only be set on initialization of the library.");

		$this->settings[$name] = $value;
		return $this;
	}
758274
public function textarea($name, $value = null, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::textarea($name, $value, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }
957068
public function textarea($name, $value = '', $options = [])
    {
        if (!isset($options['id'])) {
            $options['id'] = $name;
        }

        $options['name'] = $name;

        return '<textarea'.$this->attributes($options).'>'.$value.'</textarea>';
    }
1351927
public static function combo($name, array $options, $value = null, array $attributes = array())
    {
        $input = self::setAttr($attributes, '<select{{attr}}>', $name, 'select');

        foreach ($options as $key => $val) {
            $input .= '<option value="' . self::entities($val) . '"';

            if ($value === $val) {
                $input .= ' selected';
            }

            $input .= '>' . $key . '</option>';
        }

        return $input . '</select>';
    }
495845
public static function selectTimestamp(string $name = '', $value = 0, array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'time-controll' => true];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $timeControll = $userAttributes['time-controll'];
        $isEnabled = !isset($userAttributes['disabled']);
        $userAttributes = static::clearAttributes($userAttributes, ['time-controll']);
        $timezone = \date_default_timezone_get();

        $nameY = \sprintf('%s_y', $name);
        $nameM = \sprintf('%s_m', $name);
        $nameD = \sprintf('%s_d', $name);
        $nameH = \sprintf('%s_h', $name);
        $nameI = \sprintf('%s_i', $name);
        $nameS = \sprintf('%s_s', $name);
        $maxD = 31;

        $valY = $valM = $valD = $valH = $valI = $valS = -1;

        if (\is_array($value)) {
            $valY = $value['y'];
            $valM = $value['m'];
            $valD = $value['d'];
            $valH = \intval(0 + $value['h']);
            $valI = \intval(0 + $value['i']);
            $valS = \intval(0 + $value['s']);
        } elseif ($value != 0) {
            $valY = (new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('Y');
            $valM = (new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('n');
            $valD = (new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('j');
            $valH = \intval((new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('H'));
            $valI = \intval((new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('i'));
            $valS = \intval((new \DateTime('@'.$value))->setTimezone(new \DateTimeZone($timezone))->format('s'));
        }

        if ($valY > 0 && $valM > 0) {
            $format = \sprintf('%04s-%02s-01 00:00:00', $valY, $valM);
            $maxD = (int)(new \DateTime($format))->format('t');
        }

        $userAttributes['id'] = $nameY;
        $userAttributes['wrapper-class'] = 'year';
        $selectY = Choice::select($nameY, static::getYears(), [$valY], $userAttributes);

        $userAttributes['id'] = $nameM;
        $userAttributes['wrapper-class'] = 'month';
        $selectM = Choice::select($nameM, static::getMonths(), [$valM], $userAttributes);

        $userAttributes['id'] = $nameD;
        $userAttributes['wrapper-class'] = 'day';
        $selectD = Choice::select($nameD, static::getDays($maxD), [$valD], $userAttributes);

        $selectH = Text::inputHidden($nameH, '00', $userAttributes);
        $selectI = Text::inputHidden($nameI, '00', $userAttributes);
        $selectS = Text::inputHidden($nameS, '00', $userAttributes);

        if ($timeControll === true) {
            $userAttributes['id'] = $nameH;
            $userAttributes['wrapper-class'] = 'hour';
            $selectH = Choice::select($nameH, static::getHours(), [$valH], $userAttributes);

            $userAttributes['id'] = $nameI;
            $userAttributes['wrapper-class'] = 'minute';
            $selectI = Choice::select($nameI, static::getMinutes(), [$valI], $userAttributes);

            $userAttributes['id'] = $nameS;
            $userAttributes['wrapper-class'] = 'second';
            $selectS = Choice::select($nameS, static::getSeconds(), [$valS], $userAttributes);
        }

        $btnTitle = static::getConstant(
            'TXT_PANEL_DATA_FORM_TIMESTAMP_CONTROLL_RESET',
            'TXT_PANEL_DATA_FORM_TIMESTAMP_CONTROLL_RESET'
        );
        $resetBtn = $isEnabled ? Tags::span('', ['class' => 'timestamp-reset', 'title' => $btnTitle]) : '';
        $controll = $selectY.$selectM.$selectD.$selectH.$selectI.$selectS.$resetBtn;

        return Tags::div($controll, ['class' => 'timestamp-controll cf']);
    }
85119
public function checkbox($name = null, $value = null, $items = array()) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'array', 'null')
			->test(3, 'string', 'array');
		
		$field = Checkbox::i()->setItems($items);
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}
864746
public function textarea($name, $value = null, $options = [])
    {
        return parent::textarea($name, $value, $this->appendErrors($name, $options));
    }
209375
public function hidden($name = NULL, String $value = NULL)
    {
        $name  = $this->settings['attr']['name' ] ?? $name ;
        $value = $this->settings['attr']['value'] ?? $value;

        $this->settings['attr'] = [];

        $hiddens = NULL;
        
        if( is_array($name) ) foreach( $name as $key => $val )
        {
            $hiddens .= $this->createHiddenElement($key, $val);
        }
        else
        {
            $hiddens =  $this->createHiddenElement($name, $value);
        }

        $this->outputElement .= $hiddens;

        return $this;
    }
292495
public function getAreasByName($name)
    {
        if (!isset($this->areas[$name])) {
            return null;
        }

        return $this->areas[$name];
    }
640904
public function set($name, $value) {
        $setting = &$this->settings;
        $names   = explode('.', $name);
        $lname   = array_pop($names);
        if ($names) {
            foreach ($names as $n) {
                if (!isset($setting[ $n ])) {
                    $setting[ $n ] = [];
                }
                $setting = &$setting[ $n ];
            }
        }
        $setting[ $lname ] = $value;
    }
819200
public function button($value, $name = null) 
	{
		Argument::i()
			->test(1, 'string')
			->test(2, 'string', 'null')
			->test(3, 'bool');
		
		$field = Button::i()->setValue($value);
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		return $field;
	}
614820
static public function radio_gender($name, $value=null, $settings=[])
    {
        if (!isset($settings['data_source'])) {
            $settings['data_source'] = Constants::getGenders();
        }
        $settings['class'] = (isset($settings['class']) ? $settings['class'] : '' ) . ' list-inline';
        $value = Constants::getGenderValue($value);
        
        return static::radio_group($name, $value, $settings);
    }
463062
static public function ueditor($name, $value=null, $settings=array())
    {
        if (empty($value)) {
            $value = "编辑内容";
        }
        
        $defultSettings = array(
            'width'     => "100%",
            'height'    => "400",
            'type'      => "simple",
            'js_mode'   => false
        );
        $settings = array_merge($defultSettings, $settings);
        
        $pluginFile = rtrim(Config::getWebRootPath(), '/') . '/lib/ueditor-1.4.3/use/ueditor.php';
        require_once($pluginFile);
        $UEditor = new \UEditor();
        $UEditor->basePath = Config::getRootUrl() . '/lib/ueditor-1.4.3/';
        
        $config = $events = array();
        if (isset($GLOBALS['editor_toolbar'])) {
            $config['toolbars'] = $GLOBALS['editor_toolbar'][$settings['type']];
        }
        $config['minFrameHeight']       = $settings['height'];
        $config['initialFrameHeight']   = $settings['height'];
        $config['initialFrameWidth']    = $settings['width'];
        $config['autoHeightEnabled']    = false;
        
        if (!$settings['js_mode']) {
            $code = $UEditor->editor($name, $value, $config, $events);
        } else {
            $code = $UEditor->jseditor($name, $value, $config, $events);
        }
        return $code;
    }
900616
public static function searchQueryField($name, $value = '', $htmlOptions = array())
    {
        self::addCssClass('search-query', $htmlOptions);
        return self::textField($name, $value, $htmlOptions);
    }
1156754
public function wysiwyg($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Wysiwyg::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}