1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Turn off auto-complete on admin -> users -> add new

This commit is contained in:
Cameron
2013-04-15 14:06:15 -07:00
parent 96e7f8e777
commit b1b5cf5808
2 changed files with 35 additions and 12 deletions

View File

@@ -1207,7 +1207,7 @@ class users_admin_ui extends e_admin_ui
$this->addTitle(LAN_USER_QUICKADD); $this->addTitle(LAN_USER_QUICKADD);
$text = "<div>".$frm->open("core-user-adduser-form")." $text = "<div>".$frm->open("core-user-adduser-form",null,null,'autocomplete=0')."
<fieldset id='core-user-adduser'> <fieldset id='core-user-adduser'>
<table class='table adminform'> <table class='table adminform'>
<colgroup> <colgroup>

View File

@@ -105,6 +105,7 @@ class e_form
} }
$class = ""; $class = "";
$autoComplete = "";
parse_str($options,$options); parse_str($options,$options);
@@ -115,7 +116,12 @@ class e_form
$class = "class='".$options['class']."'"; $class = "class='".$options['class']."'";
} }
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'>\n"; if(isset($options['autocomplete'])) // leave as isset()
{
$autoComplete = " autocomplete='".($options['autocomplete'] ? 'on' : 'off')."'";
}
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'{$autoComplete}>\n";
if($method == 'get' && strpos($target,'=')) if($method == 'get' && strpos($target,'='))
{ {
@@ -189,6 +195,11 @@ class e_form
parse_str($options,$options); parse_str($options,$options);
} }
if(!vartrue($options['class']))
{
$options['class'] = "tbox";
}
/* /*
if(!vartrue($options['class'])) if(!vartrue($options['class']))
{ {
@@ -1722,18 +1733,30 @@ class e_form
* @param array|string $user_options * @param array|string $user_options
* @return array merged options * @return array merged options
*/ */
function format_options($type, $name, $user_options) function format_options($type, $name, $user_options=null)
{ {
if(is_string($user_options)) parse_str($user_options, $user_options); if(is_string($user_options))
{
parse_str($user_options, $user_options);
}
$def_options = $this->_default_options($type); $def_options = $this->_default_options($type);
if(is_array($user_options))
{
$user_options['name'] = $name; //required for some of the automated tasks
foreach (array_keys($user_options) as $key) foreach (array_keys($user_options) as $key)
{ {
if(!isset($def_options[$key]) && substr($key,0,5)!='data-') unset($user_options[$key]); // data-xxxx exempt //remove it? if(!isset($def_options[$key]) && substr($key,0,5)!='data-') unset($user_options[$key]); // data-xxxx exempt //remove it?
} }
}
else
{
$user_options = array('name' => $name); //required for some of the automated tasks
}
$user_options['name'] = $name; //required for some of the automated tasks
return array_merge($def_options, $user_options); return array_merge($def_options, $user_options);
} }