1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 08:06:38 +02:00

Issue #684 Disabled drop-down restyling due to validation alert issues.

This commit is contained in:
Cameron
2014-10-16 17:31:38 -07:00
parent 7a7a98cb5d
commit 28db46022b
3 changed files with 30 additions and 19 deletions

View File

@@ -5559,8 +5559,9 @@ class e_admin_form_ui extends e_form
// TODO - core ui-batch-option class!!! REMOVE INLINE STYLE! // TODO - core ui-batch-option class!!! REMOVE INLINE STYLE!
// XXX Quick Fix for styling - correct. // XXX Quick Fix for styling - correct.
$text = " $text = "
<div class='navbar navbar-inner left' style='padding-left:30px; padding-top:6px; margin-top:-20px;border-top:0px'> <div class='navbar navbar-inner left' style='padding-left:15px; padding-top:8px; margin-top:-20px;border-top:0px'>
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' /> <div class='input-append'>
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' style='padding-top:5px' />
".$this->select_open('etrigger_batch', array('class' => 'tbox select batch e-autosubmit reset', 'id' => false))." ".$this->select_open('etrigger_batch', array('class' => 'tbox select batch e-autosubmit reset', 'id' => false))."
".$this->option(LAN_BATCH_LABEL_SELECTED, '', false)." ".$this->option(LAN_BATCH_LABEL_SELECTED, '', false)."
".($allow_copy ? $this->option(LAN_COPY, 'copy', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '')." ".($allow_copy ? $this->option(LAN_COPY, 'copy', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '')."
@@ -5572,6 +5573,7 @@ class e_admin_form_ui extends e_form
".$this->select_close()." ".$this->select_close()."
".$this->admin_button('e__execute_batch', 'e__execute_batch', 'batch e-hide-if-js', LAN_GO, array('id' => false))." ".$this->admin_button('e__execute_batch', 'e__execute_batch', 'batch e-hide-if-js', LAN_GO, array('id' => false))."
</div> </div>
</div>
"; ";
return $text; return $text;

View File

@@ -410,11 +410,13 @@ class e_form
$mlength = vartrue($maxlength) ? "maxlength=".$maxlength : ""; $mlength = vartrue($maxlength) ? "maxlength=".$maxlength : "";
$type = varset($options['type']) == 'email' ? 'email' : 'text'; // used by $this->email();
$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
return "<input type='text' name='{$name}' value='{$value}' {$mlength} ".$this->get_attributes($options, $name)." />"; return "<input type='".$type."' name='{$name}' value='{$value}' {$mlength} ".$this->get_attributes($options, $name)." />";
} }
@@ -450,11 +452,8 @@ class e_form
function email($name, $value, $maxlength = 200, $options = array()) function email($name, $value, $maxlength = 200, $options = array())
{ {
$options = $this->format_options('text', $name, $options); $options['type'] = 'email';
return $this->text($name,$value,$maxlength,$options);
//never allow id in format name-value for text fields
return "<input type='email' name='{$name}' value='{$value}' maxlength='{$maxlength}' ".$this->get_attributes($options, $name)." />
";
} }
@@ -1573,7 +1572,11 @@ class e_form
if(isset($options['default'])) if(isset($options['default']))
{ {
$text .= $this->option($options['default'], varset($options['defaultValue'])); if($options['default'] === 'blank')
{
$options['default'] = '&nbsp;';
}
$text .= $this->option($options['default'], varset($options['defaultValue'],''));
} }
elseif($defaultBlank) elseif($defaultBlank)
{ {
@@ -3419,8 +3422,14 @@ class e_form
$ret = $this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms); $ret = $this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms);
break; break;
case 'url':
case 'email': case 'email':
$maxlength = vartrue($parms['maxlength'], 255);
unset($parms['maxlength']);
$ret = vartrue($parms['pre']).$this->email($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
break;
case 'url':
// case 'email':
case 'text': case 'text':
case 'password': // encrypts to md5 when saved. case 'password': // encrypts to md5 when saved.
$maxlength = vartrue($parms['maxlength'], 255); $maxlength = vartrue($parms['maxlength'], 255);

View File

@@ -39,15 +39,15 @@ $(document).ready(function()
var id = $(this).closest('form').attr('id'); var id = $(this).closest('form').attr('id');
var found = false; var found = false;
$('#'+id).find(':invalid').each(function(index, node) { $('#'+id).find('input:invalid,select:invalid,textarea:invalid').each(function(index, node) {
var tab = $('#'+node.id).closest('.tab-pane').attr('id'); var tab = $('#'+node.id).closest('.tab-pane').attr('id');
if(tab && (found == false)) if(tab && (found === false))
{ {
$('a[href="#'+tab+'"]').tab('show'); $('a[href="#'+tab+'"]').tab('show');
found = true; found = true;
//alert(node.id+' : '+tab); // alert(node.id+' : '+tab + ' '.index);
} }
// var label = $('label[for=' + node.id + ']'); // var label = $('label[for=' + node.id + ']');
}); });
@@ -57,7 +57,6 @@ $(document).ready(function()
// run tips on title attribute. // run tips on title attribute.
$(".e-tip").each(function() { $(".e-tip").each(function() {
@@ -319,7 +318,8 @@ $(document).ready(function()
if(multi === undefined) if(multi === undefined)
{ {
$(this).selectpicker(); // $(this).selectpicker(); // causes HTML5 validation alert to be hidden.
return;
} }
else else
{ {