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

Changeset 9164


Ignore:
Timestamp:
Nov 15, 2008, 6:47:22 PM (12 years ago)
Author:
ebihara
Message:

#3155:changed OpenPNEFormAutoGenerate::generateWidget() for symfony1.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/goto_1.2/lib/form/OpenPNEFormAutoGenerate.class.php

    r8704 r9164  
    1212  protected function generateWidget($field, $choices = array())
    1313  {
    14     if ($field['Caption']) {
    15       $this->widgetSchema->setLabel($field['Name'], $field['Caption']);
     14    $params = array();
     15
     16    if ($field['Caption'])
     17    {
     18      $params['label'] = $field['Caption'];
     19    }
     20
     21    if ($choices)
     22    {
     23      $params['choices'] = $choices;
    1624    }
    1725
    1826    switch ($field['FormType']) {
    1927      case 'checkbox':
    20         $obj = new sfWidgetFormInputCheckbox(array('choices' => $choices));
     28        $obj = new sfWidgetFormInputCheckbox($params);
    2129        break;
    2230      case 'select':
    23         $obj = new sfWidgetFormSelect(array('choices' => $choices));
     31        $obj = new sfWidgetFormSelect($params);
    2432        break;
    2533      case 'radio':
    26         $obj = new sfWidgetFormSelectRadio(array('choices' => $choices));
     34        $obj = new sfWidgetFormSelectRadio($params);
    2735        break;
    2836      case 'textarea':
Note: See TracChangeset for help on using the changeset viewer.