mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Turn off auto-complete on admin -> users -> add new
This commit is contained in:
@@ -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>
|
||||||
|
@@ -104,18 +104,24 @@ class e_form
|
|||||||
$method = "post";
|
$method = "post";
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = "";
|
$class = "";
|
||||||
|
$autoComplete = "";
|
||||||
|
|
||||||
parse_str($options,$options);
|
parse_str($options,$options);
|
||||||
|
|
||||||
$target = str_replace("&", "&", $target);
|
$target = str_replace("&", "&", $target);
|
||||||
|
|
||||||
if(vartrue($options['class']))
|
if(vartrue($options['class']))
|
||||||
{
|
{
|
||||||
$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))
|
||||||
|
|
||||||
$def_options = $this->_default_options($type);
|
|
||||||
|
|
||||||
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?
|
parse_str($user_options, $user_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_options['name'] = $name; //required for some of the automated tasks
|
$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)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
return array_merge($def_options, $user_options);
|
return array_merge($def_options, $user_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user