From: Andrey Kutejko Date: Sun, 29 Dec 2013 13:10:56 +0000 (+0200) Subject: cleanup X-Git-Tag: 0.6~216 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=7d2d3e289d1889623ad8920ecf5faa323dfd12a1;p=ipf.git cleanup --- diff --git a/ipf/form/field/file.php b/ipf/form/field/file.php index f2464b5..e8b5bf0 100644 --- a/ipf/form/field/file.php +++ b/ipf/form/field/file.php @@ -47,7 +47,10 @@ class IPF_Form_Field_File extends IPF_Form_Field if ($oldname != $newname) return $this->renameFile($oldname, $newname); - if (UPLOAD_ERR_OK != ArrayTools::get($value['data'], 'error')) { + switch (ArrayTools::get($value['data'], 'error')) { + case UPLOAD_ERR_OK: + break; + default: if ($this->required && !$oldname) throw new IPF_Exception_Form(__('This field is required.')); return $oldname; diff --git a/ipf/form/field/modelmultiplechoice.php b/ipf/form/field/modelmultiplechoice.php index 3a631a9..f6844d7 100644 --- a/ipf/form/field/modelmultiplechoice.php +++ b/ipf/form/field/modelmultiplechoice.php @@ -2,14 +2,5 @@ class IPF_Form_Field_ModelMultipleChoice extends IPF_Form_Field_MultipleChoice { - public $widget = 'IPF_Form_Widget_SelectMultipleInput'; - - protected $_model; - - function __construct($params=array()) - { - parent::__construct($params); - $this->_model = $params['model']; - } } diff --git a/ipf/form/model.php b/ipf/form/model.php index a63ae3d..9ed750a 100644 --- a/ipf/form/model.php +++ b/ipf/form/model.php @@ -145,13 +145,6 @@ class IPF_Form_Model extends IPF_Form else $col = array(); - $defaults = array( - 'blank' => !isset($col['notblank']), - 'help_text' => '', - 'model' => $relation->getClass(), - 'verbose' => isset($col['verbose']) ? $col['verbose'] : $name, - ); - $table = IPF_ORM::getTable($relation->getClass()); $params = array(