mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Admin-UI: Improved rendering of required fields.
This commit is contained in:
parent
df8ff0f5c0
commit
0df3fa4672
@ -81,7 +81,7 @@ class e_form
|
||||
e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_form_handler.php");
|
||||
$this->_tabindex_enabled = $enable_tabindex;
|
||||
$this->_uc = e107::getUserClass();
|
||||
$this->setRequiredString('<span class="required">* </span>');
|
||||
$this->setRequiredString('<span class="required text-warning"> *</span>');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -6922,12 +6922,14 @@ class e_form
|
||||
{
|
||||
$required = '';
|
||||
$required_class = '';
|
||||
if(isset($model_required[$key]) || vartrue($att['validate']))
|
||||
if(isset($model_required[$key]) || vartrue($att['validate']) || !empty($att['writeParms']['required']))
|
||||
{
|
||||
|
||||
$required = $this->getRequiredString();
|
||||
$required_class = ' class="required-label"'; // TODO - add 'required-label' to the core CSS definitions
|
||||
$required_class = ' class="required-label" title="'.LAN_REQUIRED.'"';
|
||||
$required_help = true;
|
||||
if(vartrue($att['validate']))
|
||||
|
||||
if(!empty($att['validate']))
|
||||
{
|
||||
// override
|
||||
$model_required[$key] = array();
|
||||
@ -6963,7 +6965,7 @@ class e_form
|
||||
|
||||
}
|
||||
|
||||
$leftCell = $required."<span{$required_class}>".defset(vartrue($att['title']), vartrue($att['title']))."</span>".$label;
|
||||
$leftCell = "<span{$required_class}>".defset(vartrue($att['title']), vartrue($att['title']))."</span>".$required.$label;
|
||||
$rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId())." {$help}";
|
||||
|
||||
if(vartrue($att['type']) == 'bbarea' || !empty($writeParms['nolabel']))
|
||||
|
@ -142,4 +142,5 @@ define("LAN_SUMMARY", "Summary"); // TODO more files use summary replace
|
||||
define("LAN_REQUIRED_BLANK", "Required field(s) were left blank.");
|
||||
define("LAN_PLEASEWAIT", "Please Wait");
|
||||
define("LAN_CHOOSE_FILE", "Choose a file");
|
||||
?>
|
||||
|
||||
define("LAN_REQUIRED", "Required");
|
||||
|
Loading…
x
Reference in New Issue
Block a user