ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 9395


Ignore:
Timestamp:
Nov 27, 2008, 1:38:01 PM (12 years ago)
Author:
ShogoKawahara
Message:

#2906,#3160:fixed OpenPNEFormAutoGenerate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/form/OpenPNEFormAutoGenerate.class.php

    r9199 r9395  
    2626    switch ($field['FormType']) {
    2727      case 'checkbox':
    28         $obj = new sfWidgetFormInputCheckbox($params);
     28        $obj = new sfWidgetFormSelectCheckbox($params);
    2929        break;
    3030      case 'select':
     
    3535        break;
    3636      case 'textarea':
    37         $obj = new sfWidgetFormTextarea();
     37        $obj = new sfWidgetFormTextarea($params);
    3838        break;
    3939      case 'password':
    40         $obj = new sfWidgetFormInputPassword();
     40        $obj = new sfWidgetFormInputPassword($params);
    4141        break;
    4242      default:
    43         $obj = new sfWidgetFormInput();
     43        $obj = new sfWidgetFormInput($params);
    4444    }
    4545
     
    4949  protected function generateValidator($field, $choices = array())
    5050  {
    51     if ($field['FormType'] === 'checkbox' || $field['FormType'] === 'select' || $field['FormType'] === 'radio') {
     51    if ($field['FormType'] === 'checkbox')
     52    {
     53      $obj = new sfValidatorChoiceMany(array('choices' => $choices));
     54      return $obj;
     55    }
     56    if ($field['FormType'] === 'select' || $field['FormType'] === 'radio') {
    5257      $obj = new sfValidatorChoice(array('choices' => $choices));
    5358      return $obj;
Note: See TracChangeset for help on using the changeset viewer.