From 609f32fe1b7273ee9928aff91395ee96ebede8ba Mon Sep 17 00:00:00 2001 From: Matthieu Guffroy <mattgu74@gmail.com> Date: Wed, 18 Jun 2014 22:20:42 +0200 Subject: [PATCH] use label for form --- class/boolfield.php | 2 +- class/datefield.php | 2 +- class/field.php | 2 +- class/foreignfield.php | 2 +- class/phonefield.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/class/boolfield.php b/class/boolfield.php index 9b038b9..f479231 100644 --- a/class/boolfield.php +++ b/class/boolfield.php @@ -6,7 +6,7 @@ class BoolField extends Field public function html($form) { if($this->value) { $checked="checked"; } else { $checked = false; } - $html = '<div class="checkbox"> <label> <input type="checkbox" name="'.$this->name.'" '.$checked.'>'.ucfirst($this->name).'</label> </div>'; + $html = '<div class="checkbox"> <label> <input type="checkbox" name="'.$this->name.'" '.$checked.'>'.$this->label.'</label> </div>'; return $html; } diff --git a/class/datefield.php b/class/datefield.php index b2fe5a7..19667dc 100644 --- a/class/datefield.php +++ b/class/datefield.php @@ -3,7 +3,7 @@ public function html() { $html = '<div class = "form-group"> <label for = "form'.$this->name.'"> - <input type = "date" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + <input type = "date" name = "'.$this->name.'" value ="'.$this->value.'"> '.$this->label.' </label> </div>'; return $html; diff --git a/class/field.php b/class/field.php index 32a3036..5d6b245 100644 --- a/class/field.php +++ b/class/field.php @@ -22,7 +22,7 @@ class Field { if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } return '<div class="form-group"> - <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> + <label for="form'.$this->name.'">'.$this->label.'</label> <input type="text" class="form-control" name="'.$this->name.'" value="'.$this->value.'" '.$disabled.'> </div>'; } diff --git a/class/foreignfield.php b/class/foreignfield.php index 4015ff9..70c6160 100644 --- a/class/foreignfield.php +++ b/class/foreignfield.php @@ -22,7 +22,7 @@ class ForeignField { if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; } $html = '<div class="form-group"> - <label for="form'.$this->name.'">'.ucfirst($this->name).'</label> + <label for="form'.$this->name.'">'.$this->label.'</label> <select class="form-control" name="'.$this->name.'">'; foreach ($this->choices as $value) { if($this->value == $value->{$value->_primaryAttr}()) { $selected = "selected"; } else { $selected = ""; } diff --git a/class/phonefield.php b/class/phonefield.php index 350bf02..838b2e1 100644 --- a/class/phonefield.php +++ b/class/phonefield.php @@ -5,7 +5,7 @@ class PhoneField extends Field public function html() { $html = '<div class = "form-group"> <label for = "form'.$this->name.'"> - <input type = "tel" name = "'.$this->name.'" value ="'.$this->value.'"> '.ucfirst($this->name).' + <input type = "tel" name = "'.$this->name.'" value ="'.$this->value.'"> '.$this->label.' </label> </div>'; return $html; -- GitLab