]> git.andy128k.dev Git - ipf.git/commitdiff
cleanup
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 14 Sep 2013 15:41:46 +0000 (18:41 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 14 Sep 2013 15:41:46 +0000 (18:41 +0300)
ipf/form/field/choice.php
ipf/form/field/multiplechoice.php
ipf/form/widget/selectmultipleinput.php

index a96babef9be63c84a4eb3df77834a99950ee6bf7..2359581dd11de15f55046d8126b6759159941103 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-class IPF_Form_Field_Choice extends IPF_Form_Field{
+class IPF_Form_Field_Choice extends IPF_Form_Field
+{
     public $widget = 'IPF_Form_Widget_SelectInput';
     protected $_choices = array();
 
@@ -11,7 +12,8 @@ class IPF_Form_Field_Choice extends IPF_Form_Field{
             $this->setChoices($params['choices']);
     }
 
-    public function clean($value){
+    public function clean($value)
+    {
         parent::clean($value);
         if (in_array($value, $this->empty_values)) {
             return '';
@@ -20,15 +22,17 @@ class IPF_Form_Field_Choice extends IPF_Form_Field{
             throw new IPF_Exception_Form(__('Invalid choice'));
         return $value;
     }
-    
-    public function setChoices($choices){
+
+    public function setChoices($choices)
+    {
         $this->_choices = $choices;
         $this->widget->choices = $choices;
     }
-    
-    public function validValue($value){
-        foreach($this->_choices as $name=>$val)
-            if ($value==$val)
+
+    public function validValue($value)
+    {
+        foreach ($this->_choices as $name => $val)
+            if ($value == $val)
                 return true;
         return false;
     }
index b6da5b81fd0e77699a8d5427bed83ff727fa15e6..d4900e9d1f756301cfec50f06dffe9a65bc8a4dd 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 
-class IPF_Form_Field_MultipleChoice extends IPF_Form_Field_Choice{
+class IPF_Form_Field_MultipleChoice extends IPF_Form_Field_Choice
+{
     public $widget = 'IPF_Form_Widget_SelectMultipleInput';
 
-    public function validValue($value){
-        foreach($value as $v){
+    public function validValue($value)
+    {
+        foreach ($value as $v) {
             $find = false;
-            foreach($this->_choices as $name=>$val){
-                if ($v==$val){
+            foreach ($this->_choices as $name => $val) {
+                if ($v==$val) {
                     $find = true;
                     break;
                 }
@@ -18,7 +20,8 @@ class IPF_Form_Field_MultipleChoice extends IPF_Form_Field_Choice{
         return true;
     }
 
-    public function clean($value){
+    public function clean($value)
+    {
         parent::clean($value);
         if (in_array($value, $this->empty_values)) {
             return '';
@@ -27,6 +30,5 @@ class IPF_Form_Field_MultipleChoice extends IPF_Form_Field_Choice{
             throw new IPF_Exception_Form(__('Invalid choice'));
         return $value;
     }
-
 }
 
index 43133c20873ce9803b1bfcf48c4cf25efbdb3177..1ebc46d43735878811a1bb7a011169ec63990b42 100644 (file)
@@ -13,8 +13,7 @@ class IPF_Form_Widget_SelectMultipleInput extends IPF_Form_Widget
         parent::__construct($attrs);
     }
 
-    public function render($name, $value, $extra_attrs=array(),
-                           $choices=array())
+    public function render($name, $value, $extra_attrs=array(), $choices=array())
     {
         $output = array();
         if ($value === null) {