form : fieldwidth is now functionnal

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2701 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-04-21 14:14:50 +00:00
parent 18a641ca87
commit 9f8d9ddc30

View File

@@ -321,7 +321,7 @@ class formfield
/** The Bootstrap width of the column of titles */
public $titlewidth = 2;
/** The Bootstrap width of the column of fields */
public $fieldswidth = 10;
public $fieldwidth = 10;
/** When adding a field, the name and the label are the minimum mandatory
@param string $name Name of the field
@param string $label Label of the field */
@@ -362,7 +362,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
if (count ($this->titles) === 0)
$this->titles = array ("");
foreach ($this->titles as $key=>$val)
@@ -485,7 +485,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
$res .= " <input type='password'";
$res .= " name='$this->formName"."[";
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."]'";
@@ -548,7 +548,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
if (is_string ($this->defaults))
$this->defaults = array ($this->defaults);
$res .= " <input type='hidden'";
@@ -623,7 +623,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
if (isset ($this->defaults) && is_array ($this->defaults))
{
if (isset ($this->readonly) && $this->readonly !== FALSE)
@@ -716,7 +716,7 @@ class formfield
// No $this->label, $this->multiple, $this->error, $this->rows,
// $this->cols $this->placeholder
$res .= "<div class='form-group'>\n";
$res .= " <div class='col-sm-".($this->titlewidth+$this->fieldswidth).
$res .= " <div class='col-sm-".($this->titlewidth+$this->fieldwidth).
"'>\n";
$res .= " <input type='submit'";
$res .= " name='$this->formName"."[";
@@ -760,7 +760,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
$res .= " <textarea";
$res .= " name='$this->formName"."[";
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."]'";
@@ -826,7 +826,7 @@ class formfield
else
$res .= " ";
$res .= "</label>\n";
$res .= " <div class='col-sm-$this->fieldswidth'>\n";
$res .= " <div class='col-sm-$this->fieldwidth'>\n";
$res .= " <input type='text'";
$res .= " name='$this->formName"."[";
$res .= htmlspecialchars ($this->name, ENT_QUOTES)."]'";