]> git.andy128k.dev Git - ipf.git/commitdiff
cleanup
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 29 Dec 2013 13:10:56 +0000 (15:10 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 29 Dec 2013 13:10:56 +0000 (15:10 +0200)
ipf/form/field/file.php
ipf/form/field/modelmultiplechoice.php
ipf/form/model.php

index f2464b52233c083ee4e8c68c12ca8abf68e4b1a5..e8b5bf0ccab197fb8f8165b9ce85ebcf1d4c0fc1 100644 (file)
@@ -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;
index 3a631a98f3225bd2224b68eb42c60cfab4f32570..f6844d7621f19aec19ca2b33a54fe6c0292f8d8f 100644 (file)
@@ -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'];
-    }
 }
 
index a63ae3d8839be196aad9ceed44e68b45132cae06..9ed750a58e2df9a9ec92402ac7c4891f6ea0eb12 100644 (file)
@@ -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(