77class FormElement extends Container {
88
99 protected $ label ;
10+ protected $ isArray ;
1011 protected $ help ;
1112 protected $ group ;
1213 protected $ hidden ;
@@ -17,7 +18,8 @@ public function __construct($parent, $id) {
1718 $ this ->setId ($ id );
1819 $ this ->setName ($ id );
1920 }
20- $ this ->hidden = FALSE ;
21+ $ this ->hidden = FALSE ;
22+ $ this ->isArray = FALSE ;
2123 }
2224
2325 public function hide () {
@@ -50,6 +52,17 @@ public function setHelp($value) {
5052 return $ this ;
5153 }
5254
55+ public function isArray () {
56+ return $ this ->isArray ;
57+ }
58+
59+ public function setArray ($ value ) {
60+ $ this ->isArray = $ value ;
61+ foreach ($ this ->getChildren () AS $ child ) {
62+ if (method_exists ($ child , 'setArray ' )) $ child ->setArray ($ value );
63+ }
64+ }
65+
5366 public function getName () {
5467 return $ this ->getAttribute ('name ' , TRUE , $ this ->getId ());
5568 }
@@ -59,17 +72,9 @@ public function setName($name) {
5972 return $ this ;
6073 }
6174
62- public function getBaseName () {
63- $ rc = $ this ->getName ();
64- if (mb_strpos ($ this ->getName (), '[] ' ) > 0 ) {
65- $ rc = mb_substr ($ rc , 0 , mb_strlen ($ rc )-2 );
66- }
67- return $ rc ;
68- }
69-
70- public function isArray () {
71- return mb_strpos ($ this ->getName (), '[] ' ) > 0 ;
72- }
75+ //public function isArray() {
76+ // return mb_strpos($this->getName(), '[]') > 0;
77+ //}
7378
7479 public function isEnabled () {
7580 return $ this ->getAttribute ('disabled ' , TRUE ) != 'disabled ' ;
0 commit comments