|
@@ 718-734 (lines=17) @@
|
| 715 |
|
* @param boolean $required Specify if check is required |
| 716 |
|
* @param array $attributes Optional atributes not listened (in array). |
| 717 |
|
*/ |
| 718 |
|
public function addCheck($label = '', $name = '', $value = '', $required = false, $attributes = array()) { |
| 719 |
|
$data = array( |
| 720 |
|
'type' => 'checkbox', |
| 721 |
|
'name' => $name, |
| 722 |
|
'value' => $value |
| 723 |
|
); |
| 724 |
|
if ($required) $data['required'] = 'required'; |
| 725 |
|
if (!empty($attributes)) array_merge($data, $attributes); |
| 726 |
|
|
| 727 |
|
$content = array( |
| 728 |
|
'type' => 'input', |
| 729 |
|
'data' => $data |
| 730 |
|
); |
| 731 |
|
if ($label != '') $content['label'] = $label; |
| 732 |
|
|
| 733 |
|
$this->content[] = $content; |
| 734 |
|
} |
| 735 |
|
|
| 736 |
|
|
| 737 |
|
/** |
|
@@ 855-873 (lines=19) @@
|
| 852 |
|
* @param string $onClick Action to load when button is clicked |
| 853 |
|
* @param array $attributes Optional atributes not listened (in array). |
| 854 |
|
*/ |
| 855 |
|
public function addTextArea($label = '', $name = '', $value = '', $required = false, $attributes = array()) { |
| 856 |
|
// Creating main data |
| 857 |
|
$data = array( |
| 858 |
|
'name' => $name, |
| 859 |
|
); |
| 860 |
|
|
| 861 |
|
if ($required) $data['required'] = 'required'; |
| 862 |
|
if (!empty($attributes)) array_merge($data, $attributes); |
| 863 |
|
|
| 864 |
|
// Saving data to object |
| 865 |
|
$content = array( |
| 866 |
|
'type' => 'textarea', |
| 867 |
|
'text' => $value, |
| 868 |
|
'data' => $data |
| 869 |
|
); |
| 870 |
|
if ($label != '') $content['label'] = $label; |
| 871 |
|
|
| 872 |
|
$this->content[] = $content; |
| 873 |
|
} |
| 874 |
|
|
| 875 |
|
/* |
| 876 |
|
* OTHER |