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;
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'];
- }
}
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(