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