From 7d2d3e289d1889623ad8920ecf5faa323dfd12a1 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 29 Dec 2013 15:10:56 +0200 Subject: [PATCH] cleanup --- ipf/form/field/file.php | 5 ++++- ipf/form/field/modelmultiplechoice.php | 9 --------- ipf/form/model.php | 7 ------- 3 files changed, 4 insertions(+), 17 deletions(-) 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( -- 2.49.0