| @@ 1964-1997 (lines=34) @@ | ||
| 1961 | $element = $this->decorate($element, $attr, $inputFilter); |
|
| 1962 | $form->add($element); |
|
| 1963 | } |
|
| 1964 | if (isset($element->line_radio)) { |
|
| 1965 | $attr = $this->getAttributes($element->line_radio[0]); |
|
| 1966 | $element = new Element\Radio($attr['name']); |
|
| 1967 | ||
| 1968 | $element->setLabel($attr['label']); |
|
| 1969 | $element->setAttributes( |
|
| 1970 | array( |
|
| 1971 | 'name' => $attr['name'], |
|
| 1972 | 'required' => $attr['required'], |
|
| 1973 | 'allowEmpty'=> !$attr['required'], |
|
| 1974 | 'class' => $attr['class'], |
|
| 1975 | 'id' => $attr['id'] |
|
| 1976 | ) |
|
| 1977 | ); |
|
| 1978 | $values = array(); |
|
| 1979 | foreach ($attr['innerData'] as $value) { |
|
| 1980 | $values[] = $value->label; |
|
| 1981 | } |
|
| 1982 | $element->setValueOptions($values); |
|
| 1983 | ||
| 1984 | $options = array(); |
|
| 1985 | $options['encoding'] = 'UTF-8'; |
|
| 1986 | $options['disable_inarray_validator'] = true; |
|
| 1987 | ||
| 1988 | $element->setOptions($options); |
|
| 1989 | ||
| 1990 | $form->add($element); |
|
| 1991 | ||
| 1992 | $inputFilter->add($factory->createInput(array( |
|
| 1993 | 'name' => $attr['name'], |
|
| 1994 | 'required' => $attr['required'], |
|
| 1995 | 'allowEmpty' => !$attr['required'], |
|
| 1996 | ))); |
|
| 1997 | } |
|
| 1998 | if (isset($element->line_checkbox)) { |
|
| 1999 | $attr = $this->getAttributes($element->line_checkbox[0]); |
|
| 2000 | $element = new Element\MultiCheckbox($attr['name']); |
|
| @@ 1998-2031 (lines=34) @@ | ||
| 1995 | 'allowEmpty' => !$attr['required'], |
|
| 1996 | ))); |
|
| 1997 | } |
|
| 1998 | if (isset($element->line_checkbox)) { |
|
| 1999 | $attr = $this->getAttributes($element->line_checkbox[0]); |
|
| 2000 | $element = new Element\MultiCheckbox($attr['name']); |
|
| 2001 | ||
| 2002 | $element->setLabel($attr['label']); |
|
| 2003 | $element->setAttributes( |
|
| 2004 | array( |
|
| 2005 | 'name' => $attr['name'], |
|
| 2006 | 'required' => $attr['required'], |
|
| 2007 | 'allowEmpty'=> !$attr['required'], |
|
| 2008 | 'class' => $attr['class'], |
|
| 2009 | 'id' => $attr['id'] |
|
| 2010 | ) |
|
| 2011 | ); |
|
| 2012 | ||
| 2013 | $values = array(); |
|
| 2014 | foreach ($attr['innerData'] as $value) { |
|
| 2015 | $values[] = $value->label; |
|
| 2016 | } |
|
| 2017 | $element->setValueOptions($values); |
|
| 2018 | $form->add($element); |
|
| 2019 | ||
| 2020 | $options = array(); |
|
| 2021 | $options['encoding'] = 'UTF-8'; |
|
| 2022 | $options['disable_inarray_validator'] = true; |
|
| 2023 | ||
| 2024 | $element->setOptions($options); |
|
| 2025 | ||
| 2026 | $inputFilter->add($factory->createInput(array( |
|
| 2027 | 'name' => $attr['name'], |
|
| 2028 | 'required' => $attr['required'], |
|
| 2029 | 'allowEmpty'=> !$attr['required'], |
|
| 2030 | ))); |
|
| 2031 | } |
|
| 2032 | if (isset($element->line_dropdown)) { |
|
| 2033 | $attr = $this->getAttributes($element->line_dropdown[0]); |
|
| 2034 | $element = new Element\Select($attr['name']); |
|
| @@ 2032-2064 (lines=33) @@ | ||
| 2029 | 'allowEmpty'=> !$attr['required'], |
|
| 2030 | ))); |
|
| 2031 | } |
|
| 2032 | if (isset($element->line_dropdown)) { |
|
| 2033 | $attr = $this->getAttributes($element->line_dropdown[0]); |
|
| 2034 | $element = new Element\Select($attr['name']); |
|
| 2035 | ||
| 2036 | $element->setLabel($attr['label']); |
|
| 2037 | $element->setAttributes( |
|
| 2038 | array( |
|
| 2039 | 'name' => $attr['name'], |
|
| 2040 | 'required' => $attr['required'], |
|
| 2041 | 'allowEmpty'=> !$attr['required'], |
|
| 2042 | 'class' => $attr['class'], |
|
| 2043 | 'id' => $attr['id'] |
|
| 2044 | ) |
|
| 2045 | ); |
|
| 2046 | $values = array(); |
|
| 2047 | foreach ($attr['dropdownValues'] as $value) { |
|
| 2048 | $values[] = $value->dropdown_label; |
|
| 2049 | } |
|
| 2050 | $element->setValueOptions($values); |
|
| 2051 | $form->add($element); |
|
| 2052 | ||
| 2053 | $options = array(); |
|
| 2054 | $options['encoding'] = 'UTF-8'; |
|
| 2055 | $options['disable_inarray_validator'] = true; |
|
| 2056 | ||
| 2057 | $element->setOptions($options); |
|
| 2058 | ||
| 2059 | $inputFilter->add($factory->createInput(array( |
|
| 2060 | 'name' => $attr['name'], |
|
| 2061 | 'required' => $attr['required'], |
|
| 2062 | 'allowEmpty' => !$attr['required'], |
|
| 2063 | ))); |
|
| 2064 | } |
|
| 2065 | if (isset($element->line_paragraph)) { |
|
| 2066 | $attr = $this->getAttributes($element->line_paragraph[0]); |
|
| 2067 | $element = new Element\Textarea($attr['name']); |
|