form : display the help with the error if both are defined
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2212 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
86
form.php
86
form.php
@@ -272,6 +272,8 @@ class formfield
|
||||
$res .= " <div class='col-sm-10'>\n";
|
||||
if (is_string ($this->defaults))
|
||||
$this->defaults = array ($this->defaults);
|
||||
if (count ($this->titles) === 0)
|
||||
$this->titles = array ("");
|
||||
foreach ($this->titles as $key=>$val)
|
||||
{
|
||||
$res .= "<div class='checkbox'>";
|
||||
@@ -305,17 +307,13 @@ class formfield
|
||||
$res .= "</div>\n";
|
||||
}
|
||||
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help.
|
||||
"</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
$res .= " </div>\n"; // End controls
|
||||
$res .= " </div>\n"; // End form-group
|
||||
@@ -387,17 +385,13 @@ class formfield
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'";
|
||||
}
|
||||
$res .= "/>\n";
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help.
|
||||
"</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
$res .= " </div>\n"; // End controls
|
||||
$res .= " </div>\n"; // End form-group
|
||||
@@ -464,17 +458,13 @@ class formfield
|
||||
$res .= "</div>";
|
||||
}
|
||||
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help.
|
||||
"</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
$res .= " </div>\n"; // End controls
|
||||
$res .= " </div>\n"; // End form-group
|
||||
@@ -568,17 +558,13 @@ class formfield
|
||||
}
|
||||
|
||||
$res .= " </select>\n";
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help
|
||||
."</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -669,17 +655,13 @@ class formfield
|
||||
else
|
||||
$res .= htmlspecialchars ($this->defaults, ENT_QUOTES);
|
||||
$res .= "</textarea>\n";
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help
|
||||
."</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
$res .= " </div>\n"; // End controls
|
||||
$res .= " </div>\n"; // End form-group
|
||||
@@ -732,17 +714,13 @@ class formfield
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'";
|
||||
}
|
||||
$res .= "/>\n";
|
||||
if (isset ($this->errors))
|
||||
if (isset ($this->errors) || isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".
|
||||
$this->errors[1]."</span>\n";
|
||||
}
|
||||
elseif (isset ($this->help))
|
||||
{
|
||||
$res .= " <span class='help-block' id='$this->formName"."_";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>".$this->help
|
||||
."</span>\n";
|
||||
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."_help'>";
|
||||
if (isset ($this->help)) $res .= $this->help."<br/>\n";
|
||||
if (isset ($this->errors)) $res .= $this->errors[1];
|
||||
$res .= "</span>\n";
|
||||
}
|
||||
$res .= " </div>\n"; // End controls
|
||||
$res .= " </div>\n"; // End form-group
|
||||
|
||||
Reference in New Issue
Block a user