From 31fa498b19bc2ddc47bdcd1a15a33c26205dd079 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 14 Apr 2024 23:16:22 +0900 Subject: [PATCH] Implement default extravar skin to replace hardcoded HTML in ExtraItem class --- classes/extravar/Extravar.class.php | 592 +----------------- modules/extravar/models/Value.php | 301 +++++++++ modules/extravar/models/ValueCollection.php | 66 ++ modules/extravar/skins/default/form.blade.php | 50 ++ .../default/form_types/checkbox.blade.php | 18 + .../default/form_types/datetime.blade.php | 32 + .../skins/default/form_types/kr_zip.blade.php | 5 + .../skins/default/form_types/locale.blade.php | 53 ++ .../default/form_types/password.blade.php | 7 + .../skins/default/form_types/select.blade.php | 9 + .../skins/default/form_types/tel.blade.php | 30 + .../skins/default/form_types/text.blade.php | 25 + .../default/form_types/textarea.blade.php | 6 + .../extravar/skins/default/index.blade.php | 0 14 files changed, 604 insertions(+), 590 deletions(-) create mode 100644 modules/extravar/models/Value.php create mode 100644 modules/extravar/models/ValueCollection.php create mode 100644 modules/extravar/skins/default/form.blade.php create mode 100644 modules/extravar/skins/default/form_types/checkbox.blade.php create mode 100644 modules/extravar/skins/default/form_types/datetime.blade.php create mode 100644 modules/extravar/skins/default/form_types/kr_zip.blade.php create mode 100644 modules/extravar/skins/default/form_types/locale.blade.php create mode 100644 modules/extravar/skins/default/form_types/password.blade.php create mode 100644 modules/extravar/skins/default/form_types/select.blade.php create mode 100644 modules/extravar/skins/default/form_types/tel.blade.php create mode 100644 modules/extravar/skins/default/form_types/text.blade.php create mode 100644 modules/extravar/skins/default/form_types/textarea.blade.php delete mode 100644 modules/extravar/skins/default/index.blade.php diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index dda3d237c..d937798c8 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -1,592 +1,4 @@ module_srl = $module_srl; - } - - /** - * Register a key of extra variable - * - * @param object[] $extra_keys Array of extra variable. A value of array is object that contains module_srl, idx, name, default, desc, is_required, search, value, eid. - * @return void - */ - function setExtraVarKeys($extra_keys) - { - if(!is_array($extra_keys) || count($extra_keys) < 1) - { - return; - } - - foreach($extra_keys as $val) - { - $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value ?? null, $val->eid); - $this->keys[$val->idx] = $obj; - } - } - - /** - * Returns an array of ExtraItem - * - * @return ExtraItem[] - */ - function getExtraVars() - { - return $this->keys; - } - -} - -/** - * Each value of the extra vars - * - * @author NAVER (developers@xpressengine.com) - */ -class ExtraItem -{ - - /** - * Sequence of module - * @var int - */ - var $module_srl = 0; - - /** - * Index of extra variable - * @var int - */ - var $idx = 0; - - /** - * Name of extra variable - * @var string - */ - var $name = 0; - - /** - * Type of extra variable - * @var string text, homepage, email_address, tel, textarea, checkbox, date, select, radio, kr_zip - */ - var $type = 'text'; - - /** - * Default values - * @var string[] - */ - var $default = null; - - /** - * Description - * @var string - */ - var $desc = ''; - - /** - * Whether required or not requred this extra variable - * @var string Y, N - */ - var $is_required = 'N'; - - /** - * Whether can or can not search this extra variable - * @var string Y, N - */ - var $search = 'N'; - - /** - * Value - * @var string - */ - var $value = null; - - /** - * Unique id of extra variable in module - * @var string - */ - var $eid = ''; - - /** - * Constructor - * - * @param int $module_srl Sequence of module - * @param int $idx Index of extra variable - * @param string $type Type of extra variable. text, homepage, email_address, tel, textarea, checkbox, date, sleect, radio, kr_zip - * @param string[] $default Default values - * @param string $desc Description - * @param string $is_required Whether required or not requred this extra variable. Y, N - * @param string $search Whether can or can not search this extra variable - * @param string $value Value - * @param string $eid Unique id of extra variable in module - * @return void - */ - function __construct($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') - { - if(!$idx) - { - return; - } - - $this->module_srl = $module_srl; - $this->idx = $idx; - $this->name = $name; - $this->type = $type; - $this->default = $default; - $this->desc = $desc; - $this->is_required = $is_required; - $this->search = $search; - $this->value = $value; - $this->eid = $eid; - } - - /** - * Sets Value - * - * @param string $value The value to set - * @return void - */ - function setValue($value) - { - $this->value = $value; - } - - /** - * Returns a given value converted based on its type - * - * @param string $type Type of variable - * @param string $value Value - * @return string|array Returns a converted value - */ - function _getTypeValue($type, $value) - { - $value = trim($value ?? ''); - if($value === '') - { - return; - } - - switch($type) - { - case 'homepage' : - if($value && !preg_match('/^([a-z]+):\/\//i', $value)) - { - $value = 'http://' . $value; - } - return escape($value, false); - - case 'tel': - case 'tel_v2': - case 'tel_intl': - case 'tel_intl_v2': - if(is_array($value)) - { - $values = $value; - } - elseif(strpos($value, '|@|') !== FALSE) - { - $values = explode('|@|', $value); - } - elseif(strpos($value, ',') !== FALSE) - { - $values = explode(',', $value); - } - else - { - $values = array($value); - } - - $values = array_values($values); - for($i = 0, $c = count($values); $i < $c; $i++) - { - $values[$i] = trim(escape($values[$i], false)); - } - return $values; - case 'checkbox' : - case 'radio' : - case 'select' : - if(is_array($value)) - { - $values = $value; - } - elseif(strpos($value, '|@|') !== FALSE) - { - $values = explode('|@|', $value); - } - elseif(strpos($value, ',') !== FALSE) - { - $values = explode(',', $value); - } - else - { - $values = array($value); - } - - $values = array_values($values); - for($i = 0, $c = count($values); $i < $c; $i++) - { - $values[$i] = trim(escape($values[$i], false)); - } - return $values; - - case 'kr_zip' : - if(is_array($value)) - { - $values = $value; - } - elseif(strpos($value, '|@|') !== false) - { - $values = explode('|@|', $value); - } - else - { - $values = array($value); - } - - $values = array_values($values); - for($i = 0, $c = count($values); $i < $c; $i++) - { - $values[$i] = trim(escape($values[$i], false)); - } - return $values; - - //case 'date' : - //case 'time' : - //case 'email_address' : - //case 'text' : - //case 'textarea' : - //case 'password' : - default : - return escape($value, false); - } - } - - /** - * Returns a value for HTML - * - * @return string|array Returns filtered value - */ - function getValue() - { - return $this->_getTypeValue($this->type, $this->value); - } - - /** - * Returns a value for HTML - * - * @return string Returns a value expressed in HTML. - */ - function getValueHTML() - { - $value = $this->_getTypeValue($this->type, $this->value); - - switch($this->type) - { - case 'homepage' : - return ($value) ? (sprintf('%s', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : ""; - - case 'email_address' : - return ($value) ? sprintf('%s', $value, $value) : ""; - - case 'tel' : - case 'tel_v2' : - return $value ? implode('-', $value) : ''; - case 'tel_intl' : - case 'tel_intl_v2' : - $country_number = $value[0] ?? ''; - $array_slice = $value ? array_slice($value, 1) : []; - $phone_number = implode('-', $array_slice); - return $value ? "+{$country_number}){$phone_number}": ''; - case 'country': - $country_info = Rhymix\Framework\i18n::listCountries()[$value]; - $lang_type = Context::get('lang_type'); - $country_name = $lang_type === 'ko' ? $country_info->name_korean : $country_info->name_english; - return $country_name; - case 'textarea' : - return nl2br($value); - - case 'date' : - return $value ? sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2)) : ''; - - case 'language': - return Rhymix\Framework\Lang::getSupportedList()[$value]['name']; - - case 'timezone': - return Rhymix\Framework\DateTime::getTimezoneList()[$value]; - case 'checkbox' : - case 'select' : - case 'radio' : - if(is_array($value)) - { - return implode(',', $value); - } - return $value; - - case 'kr_zip' : - if(is_array($value)) - { - return implode(' ', $value); - } - return $value; - - // case 'text' : - // case 'password' : - // case 'time' : - default : - return $value; - } - } - - /** - * Returns a form based on its type - * - * @return string Returns a form html. - */ - function getFormHTML() - { - static $id_num = 1000; - - $type = $this->type; - $name = $this->name; - $value = $this->_getTypeValue($this->type, $this->value); - $default = $this->_getTypeValue($this->type, $this->default); - $column_name = 'extra_vars' . $this->idx; - $tmp_id = $column_name . '-' . $id_num++; - - $buff = array(); - switch($type) - { - // Homepage - case 'homepage' : - $buff[] = ''; - break; - // Email Address - case 'email_address' : - $buff[] = ''; - break; - // Phone Number - case 'tel' : - $buff[] = ''; - $buff[] = ''; - $buff[] = ''; - break; - // Phone Number v2 (single input) - case 'tel_v2' : - $buff[] = ''; - break; - // Select Country Number - case 'tel_intl' : - case 'tel_intl_v2' : - $lang_type = Context::get('lang_type'); - $country_list = Rhymix\Framework\i18n::listCountries($lang_type === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH); - $buff[] = ''; - if ($type === 'tel_intl_v2') - { - $buff[] = ''; - } - else - { - $buff[] = ''; - $buff[] = ''; - $buff[] = ''; - } - break; - // Select Country - case 'country': - $lang_type = Context::get('lang_type'); - $country_list = Rhymix\Framework\i18n::listCountries($lang_type === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH); - $buff[] = ''; - break; - // Select language - case 'language': - $enable_language = Rhymix\Framework\Config::get('locale.enabled_lang'); - $supported_lang = Rhymix\Framework\Lang::getSupportedList(); - $buff[] = ''; - break; - // Select timezone - case 'timezone': - $timezone_list = Rhymix\Framework\DateTime::getTimezoneList(); - $buff[] = ''; - break; - // textarea - case 'textarea' : - $buff[] = ''; - break; - // multiple choice - case 'checkbox' : - $buff[] = ''; - break; - // single choice - case 'select' : - $buff[] = ''; - break; - // radio - case 'radio' : - $buff[] = ''; - break; - // date - case 'date' : - $formatted_value = $value ? sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2)) : ''; - $buff[] = ''; - $buff[] = ' '; - $buff[] = ''; - break; - // time - case 'time' : - $buff[] = ''; - $buff[] = ''; - break; - // address - case "kr_zip" : - if(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' )) - { - $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); - } - break; - // Password - case "password" : - $buff[] =' '; - break; - // General text - default : - $buff[] =' '; - } - if($this->desc) - { - $buff[] = '

' . nl2br(trim(escape(Context::replaceUserLang($this->desc), false))) . '

'; - } - - return join("\n", $buff); - } - -} +class_alias('Rhymix\Modules\Extravar\Models\ValueCollection', 'ExtraVar'); +class_alias('Rhymix\Modules\Extravar\Models\Value', 'ExtraItem'); diff --git a/modules/extravar/models/Value.php b/modules/extravar/models/Value.php new file mode 100644 index 000000000..8df933909 --- /dev/null +++ b/modules/extravar/models/Value.php @@ -0,0 +1,301 @@ + true, + 'tel_v2' => true, + 'tel_intl' => true, + 'tel_intl_v2' => true, + 'checkbox' => true, + 'radio' => true, + 'select' => true, + 'kr_zip' => true, + ]; + + /** + * Constructor for compatibility with legacy ExtraItem class. + * + * @param int $module_srl + * @param int $idx + * @param string $name + * @param string $type + * @param mixed $default + * @param string $desc + * @param string $is_required (Y, N) + * @param string $search (Y, N) + * @param string $value + * @param string $eid + */ + function __construct(int $module_srl, int $idx, string $name, string $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, string $eid = '') + { + if (!$idx) + { + return; + } + + $this->module_srl = $module_srl; + $this->idx = $idx; + $this->eid = $eid; + $this->type = $type; + $this->value = $value; + $this->name = $name; + $this->desc = $desc; + $this->default = $default; + $this->is_required = $is_required; + $this->search = $search; + } + + /** + * Set the raw value. + * + * @param mixed $value + * @return void + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * Get the raw value. + * + * @return string|array|null + */ + public function getValue() + { + return self::_getTypeValue($this->type, $this->value); + } + + /** + * Get the value formatted as HTML. + * + * @return string + */ + public function getValueHTML(): string + { + return self::_getTypeValueHTML($this->type, $this->value); + } + + /** + * Get the HTML form for an extra input field. + * + * @return string + */ + public function getFormHTML(): string + { + $template = new Template(self::_getSkinPath(), 'form.blade.php'); + $template->setVars([ + 'definition' => $this, + 'parent_type' => $this->parent_type, + 'type' => $this->type, + 'value' => self::_getTypeValue($this->type, $this->value), + 'default' => self::_getTypeValue($this->type, $this->default), + 'input_name' => $this->parent_type === 'document' ? ('extra_vars' . $this->idx) : ($this->input_name ?: $this->eid), + 'input_id' => $this->input_id ?: '', + ]); + return $template->compile(); + } + + /** + * Get the next temporary ID. + * + * @return string + */ + public static function getNextTempID(): string + { + return sprintf('rx_tempid_%d', self::$_temp_id++); + } + + /** + * Get the normalized value. + * + * This method is public for compatibility with legacy ExtraItem class. + * It should not be called from outside of this class. + * + * @param string $type + * @param string|array $value + * @return string|array|null + */ + public static function _getTypeValue(string $type, $value) + { + // Return if the value is empty. + if (is_array($value)) + { + if (!count($value)) + { + return; + } + } + else + { + $value = trim(strval($value ?? '')); + if ($value === '') + { + return; + } + } + + // Process array types. + if (isset(self::ARRAY_TYPES[$type])) + { + if (is_array($value)) + { + $values = $value; + } + elseif (str_contains($value, '|@|')) + { + $values = explode('|@|', $value); + } + elseif (str_contains($value, ',') && $type !== 'kr_zip') + { + $values = explode(',', $value); + } + else + { + $values = [$value]; + } + + return array_map(function($str) { + return trim(escape($str, false)); + }, array_values($values)); + } + + // Process the URL type. + if ($type === 'homepage' || $type === 'url') + { + if ($value && !preg_match('!^[a-z]+://!i', $value)) + { + $value = 'http://' . $value; + } + return escape($value, false); + } + + // Escape and return all other types. + return escape($value, false); + } + + /** + * Get the normalized value in HTML format. + * + * @param string $type + * @param string|array $value + * @return string + */ + protected static function _getTypeValueHTML(string $type, $value): string + { + // Return if the value is empty. + $value = self::_getTypeValue($type, $value); + if ($value === null || $value === '' || (is_array($value) && !count($value))) + { + return ''; + } + + // Apply formatting appropriate for each type. + switch ($type) + { + case 'textarea': + return nl2br($value); + case 'select': + case 'radio': + case 'checkbox': + return is_array($value) ? implode(',', $value) : $value; + case 'tel': + case 'tel_v2': + return is_array($value) ? implode('-', $value) : $value; + case 'tel_intl': + case 'tel_intl_v2': + $country_code = $value[0] ?? ''; + $phone_number = implode('-', array_slice((array)$value, 1)); + return $value ? "(+{$country_code}) {$phone_number}": ''; + case 'homepage': + case 'url': + $display = mb_strlen($value, 'UTF-8') > 60 ? mb_substr($value, 0, 40, 'UTF-8') . '...' . mb_substr($value, -10, 10, 'UTF-8') : $value; + return sprintf('%s', $value, $display); + case 'email_address': + case 'email': + return sprintf('%s', $value, $value); + case 'kr_zip': + return is_array($value) ? implode(' ', $value) : $value; + case 'country': + $country = i18n::listCountries()[$value]; + $lang_type = \Context::getLangType(); + return $lang_type === 'ko' ? $country->name_korean : $country->name_english; + case 'language': + return Lang::getSupportedList()[$value]['name'] ?? ''; + case 'date': + return sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2)); + case 'timezone': + return DateTime::getTimezoneList()[$value] ?? ''; + default: + return $value; + } + } + + /** + * Get the currently configured skin path. + * + * @return string + */ + protected static function _getSkinPath(): string + { + if (self::$_skin_path !== null) + { + return self::$_skin_path; + } + + $config = ModuleModel::getModuleConfig('extravar') ?: new \stdClass; + $skin = $config->skin ?? 'default'; + if (Storage::isDirectory(\RX_BASEDIR . 'modules/extravar/skins/' . $skin)) + { + self::$_skin_path = \RX_BASEDIR . 'modules/extravar/skins/' . $skin; + } + else + { + self::$_skin_path = \RX_BASEDIR . 'modules/extravar/skins/default'; + } + + return self::$_skin_path; + } +} diff --git a/modules/extravar/models/ValueCollection.php b/modules/extravar/models/ValueCollection.php new file mode 100644 index 000000000..dd9183c6b --- /dev/null +++ b/modules/extravar/models/ValueCollection.php @@ -0,0 +1,66 @@ +module_srl = $module_srl; + $this->setExtraVarKeys($keys); + } + + /** + * Set the list of extra keys for this module. + * + * @param array $keys + * @return void + */ + public function setExtraVarKeys($keys) + { + if (!is_array($keys) || !count($keys)) + { + return; + } + + foreach ($keys as $val) + { + $this->keys[$val->idx] = new Value($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value ?? null, $val->eid, $val->parent_type ?? 'document'); + } + } + + /** + * Returns an array of Value. + * + * @return array + */ + public function getExtraVars(): array + { + return $this->keys; + } +} diff --git a/modules/extravar/skins/default/form.blade.php b/modules/extravar/skins/default/form.blade.php new file mode 100644 index 000000000..0fb80bd12 --- /dev/null +++ b/modules/extravar/skins/default/form.blade.php @@ -0,0 +1,50 @@ +@switch ($type) + @case ('text') + @include ('form_types/text') + @break + @case ('textarea') + @include ('form_types/textarea') + @break + @case ('password') + @include ('form_types/password') + @break + @case ('select') + @include ('form_types/select') + @break + @case ('radio') + @case ('checkbox') + @include ('form_types/checkbox') + @break + @case ('tel') + @case ('tel_v2') + @case ('tel_intl') + @case ('tel_intl_v2') + @include ('form_types/tel') + @break + @case ('homepage') + @case ('url') + @include ('form_types/text') + @break + @case ('email_address') + @case ('email') + @include ('form_types/text') + @break + @case ('kr_zip') + @include ('form_types/kr_zip') + @break + @case ('country') + @case ('language') + @case ('timezone') + @include ('form_types/locale') + @break + @case ('date') + @case ('time') + @include ('form_types/datetime') + @break + @default + @include ('form_types/text') +@endswitch + +@if ($desc) +

{{ nl2br(escape(Context::replaceUserLang($definition->desc), false)) }}

+@endif diff --git a/modules/extravar/skins/default/form_types/checkbox.blade.php b/modules/extravar/skins/default/form_types/checkbox.blade.php new file mode 100644 index 000000000..4806ae871 --- /dev/null +++ b/modules/extravar/skins/default/form_types/checkbox.blade.php @@ -0,0 +1,18 @@ + diff --git a/modules/extravar/skins/default/form_types/datetime.blade.php b/modules/extravar/skins/default/form_types/datetime.blade.php new file mode 100644 index 000000000..029501c47 --- /dev/null +++ b/modules/extravar/skins/default/form_types/datetime.blade.php @@ -0,0 +1,32 @@ +@if ($type === 'date') + @php + $formatted_value = $value ? sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2)) : ''; + @endphp + + is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) + /> + +@else + is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) + /> + +@endif diff --git a/modules/extravar/skins/default/form_types/kr_zip.blade.php b/modules/extravar/skins/default/form_types/kr_zip.blade.php new file mode 100644 index 000000000..6db235a7b --- /dev/null +++ b/modules/extravar/skins/default/form_types/kr_zip.blade.php @@ -0,0 +1,5 @@ +@php + $oKrzipModel = KrzipModel::getInstance(); +@endphp + +{!! $oKrzipModel->getKrzipCodeSearchHtml($input_name, $value) !!} diff --git a/modules/extravar/skins/default/form_types/locale.blade.php b/modules/extravar/skins/default/form_types/locale.blade.php new file mode 100644 index 000000000..9a9238b40 --- /dev/null +++ b/modules/extravar/skins/default/form_types/locale.blade.php @@ -0,0 +1,53 @@ +@if ($type === 'country') + @php + $lang_type = Context::getLangType(); + $lang_sort = $lang_type === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH; + $countries = Rhymix\Framework\i18n::listCountries($lang_sort); + @endphp + +@elseif ($type === 'language') + @php + $enabled_languages = Rhymix\Framework\Config::get('locale.enabled_lang'); + $supported_languages = Rhymix\Framework\Lang::getSupportedList(); + @endphp + +@elseif ($type === 'timezone') + @php + $timezones = Rhymix\Framework\DateTime::getTimezoneList(); + @endphp + +@endif diff --git a/modules/extravar/skins/default/form_types/password.blade.php b/modules/extravar/skins/default/form_types/password.blade.php new file mode 100644 index 000000000..907b13b6d --- /dev/null +++ b/modules/extravar/skins/default/form_types/password.blade.php @@ -0,0 +1,7 @@ +is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) +/> diff --git a/modules/extravar/skins/default/form_types/select.blade.php b/modules/extravar/skins/default/form_types/select.blade.php new file mode 100644 index 000000000..a8eaccc13 --- /dev/null +++ b/modules/extravar/skins/default/form_types/select.blade.php @@ -0,0 +1,9 @@ + diff --git a/modules/extravar/skins/default/form_types/tel.blade.php b/modules/extravar/skins/default/form_types/tel.blade.php new file mode 100644 index 000000000..ceb18c701 --- /dev/null +++ b/modules/extravar/skins/default/form_types/tel.blade.php @@ -0,0 +1,30 @@ +@if ($type === 'tel') + + + +@elseif ($type === 'tel_v2') + +@elseif ($type === 'tel_intl' || $type === 'tel_intl_v2') + @php + $lang_type = Context::getLangType(); + $lang_sort = $lang_type === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH; + $countries = Rhymix\Framework\i18n::listCountries($lang_sort); + @endphp + + @if ($type === 'tel_intl') + + + + @else + + @endif +@endif diff --git a/modules/extravar/skins/default/form_types/text.blade.php b/modules/extravar/skins/default/form_types/text.blade.php new file mode 100644 index 000000000..33bbe1338 --- /dev/null +++ b/modules/extravar/skins/default/form_types/text.blade.php @@ -0,0 +1,25 @@ +@if ($type === 'homepage' || $type === 'url') + is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) + /> +@elseif ($type === 'email_address' || $type === 'email') + is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) + /> +@else + is_required)) + @disabled(toBool($definition->is_disabled)) + @readonly(toBool($definition->is_readonly)) + /> +@endif diff --git a/modules/extravar/skins/default/form_types/textarea.blade.php b/modules/extravar/skins/default/form_types/textarea.blade.php new file mode 100644 index 000000000..c94924d24 --- /dev/null +++ b/modules/extravar/skins/default/form_types/textarea.blade.php @@ -0,0 +1,6 @@ + diff --git a/modules/extravar/skins/default/index.blade.php b/modules/extravar/skins/default/index.blade.php deleted file mode 100644 index e69de29bb..000000000