mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Bootstrap3 tweaks
This commit is contained in:
@@ -200,6 +200,11 @@ class e_form
|
|||||||
$options['class'] = "tbox";
|
$options['class'] = "tbox";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(deftrue('BOOTSTRAP') == 3)
|
||||||
|
{
|
||||||
|
$options['class'] = 'form-control';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(!vartrue($options['class']))
|
if(!vartrue($options['class']))
|
||||||
{
|
{
|
||||||
@@ -824,6 +829,12 @@ class e_form
|
|||||||
$options['pattern'] = vartrue($options['pattern'],'[\S]{4,}');
|
$options['pattern'] = vartrue($options['pattern'],'[\S]{4,}');
|
||||||
$options['required'] = varset($options['required'], 1);
|
$options['required'] = varset($options['required'], 1);
|
||||||
$options['class'] = vartrue($options['class'],'e-password');
|
$options['class'] = vartrue($options['class'],'e-password');
|
||||||
|
|
||||||
|
if(deftrue('BOOTSTRAP') == 3)
|
||||||
|
{
|
||||||
|
$options['class'] .= ' form-control';
|
||||||
|
}
|
||||||
|
|
||||||
$options = $this->format_options('text', $name, $options);
|
$options = $this->format_options('text', $name, $options);
|
||||||
|
|
||||||
//never allow id in format name-value for text fields
|
//never allow id in format name-value for text fields
|
||||||
@@ -1926,13 +1937,15 @@ class e_form
|
|||||||
// 'multiple' => false, - see case 'select'
|
// 'multiple' => false, - see case 'select'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$form_control = (deftrue('BOOTSTRAP') == 3) ? ' form-control' : '';
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'hidden':
|
case 'hidden':
|
||||||
$def_options = array('id' => false, 'disabled' => false, 'other' => '');
|
$def_options = array('id' => false, 'disabled' => false, 'other' => '');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'text':
|
case 'text':
|
||||||
$def_options['class'] = 'tbox input-text';
|
$def_options['class'] = 'tbox input-text'.$form_control;
|
||||||
unset($def_options['selected'], $def_options['checked']);
|
unset($def_options['selected'], $def_options['checked']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1942,12 +1955,12 @@ class e_form
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
$def_options['class'] = 'tbox textarea';
|
$def_options['class'] = 'tbox textarea'.$form_control;
|
||||||
unset($def_options['selected'], $def_options['checked'], $def_options['size']);
|
unset($def_options['selected'], $def_options['checked'], $def_options['size']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
$def_options['class'] = 'tbox select';
|
$def_options['class'] = 'tbox select'.$form_control;
|
||||||
$def_options['multiple'] = false;
|
$def_options['multiple'] = false;
|
||||||
unset($def_options['checked']);
|
unset($def_options['checked']);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user