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

Changeset 10211


Ignore:
Timestamp:
Jan 18, 2009, 9:37:25 PM (13 years ago)
Author:
ogawa
Message:

#3448:assigned input_xxx class to input fileds of formTable

Location:
OpenPNE3/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/templates/_partsBox.php

    r10184 r10211  
    1818<form action="<?php echo url_for($option_raw['url']) ?>" method="post"<?php if (!empty($option['isMultipart'])) : ?> enctype="multipart/form-data"<?php endif; ?>>
    1919<?php include_customizes($id, 'formTop') ?>
    20 <table>
    21 <?php if ($option['form']  instanceof sfOutputEscaperArrayDecorator) : ?>
    22 <?php foreach ($option['form'] as $form) : ?>
    23 <?php echo $form ?>
    24 <?php endforeach; ?>
    25 <?php else : ?>
    26 <?php echo $option['form'] ?>
    27 <?php endif; ?>
     20
     21<table class="formTable">
     22<?php
     23$forms = ($option['form'] instanceof sfForm) ? array($option['form']) : $option['form'];
     24foreach ($forms as $form)
     25{
     26  foreach ($form as $field)
     27  {
     28    if ($field->isHidden()) continue;
     29
     30    $widget = $field->getWidget();
     31    if ($widget instanceof sfWidgetFormInput)
     32    {
     33      $widget->setAttribute('class', sprintf('input_%s', $widget->getOption('type')));
     34    }
     35    elseif ($widget instanceof sfWidgetFormChoice)
     36    {
     37      if ($widget->getRenderer() instanceof sfWidgetFormSelectRadio)
     38      {
     39        echo '<tr>'."\n"
     40           . '  <th>'.$field->renderLabel().'</th>'."\n"
     41           . '  <td><div id="'.$field->renderId().'">'.$field->render(array('class' => 'input_radio')).'</div></td>'."\n"
     42           . '</tr>'."\n";
     43        continue;
     44      }
     45    }
     46    elseif ($widget instanceof opWidgetFormDate)
     47    {
     48      echo '<tr>'."\n"
     49         . '  <th>'.$field->renderLabel().'</th>'."\n"
     50         . '  <td><div id="'.$field->renderId().'">'.$field->render().'</div></td>'."\n"
     51         . '</tr>'."\n";
     52      continue;
     53    }
     54    echo $field->renderRow();
     55  }
     56}
     57?>
    2858<?php include_customizes($id, 'lastRaw') ?>
    2959</table>
     60
    3061<?php if (!empty($option['moreInfo'])) : ?>
    3162<div class="block moreInfo">
     
    4071<ul class="moreInfo button">
    4172<li>
    42 <input class="input_submit" type="submit" value="<?php echo $option['button'] ?>" />
     73<?php foreach ($forms as $form) echo $form->renderHiddenFields() ?><input class="input_submit" type="submit" value="<?php echo $option['button'] ?>" />
    4374</li>
    4475</ul>
  • OpenPNE3/trunk/lib/widget/opWidgetFormDate.class.php

    r10078 r10211  
    7777    // years
    7878    $attributes['size'] = '5';
    79     $widget = new sfWidgetFormInput(array(), array_merge($this->attributes, $attributes));
     79    $widget = new sfWidgetFormInput(array(), array_merge(array('class' => 'input_text'), $this->attributes, $attributes));
    8080    $date['%input_year%'] = $widget->render($name.'[year]', $year);
    8181
  • OpenPNE3/trunk/lib/widget/opWidgetFormInputIncreased.class.php

    r10003 r10211  
    1818class opWidgetFormInputIncreased extends sfWidgetForm
    1919{
     20  public function __construct($options = array(), $attributes = array())
     21  {
     22    $this->addOption('type', 'text');
     23
     24    parent::__construct($options, $attributes);
     25  }
     26
    2027  /**
    2128   * Renders this widget
     
    5158        'name'  => $name.'['.$key.']',
    5259        'value' => $item,
     60        'class' => 'input_'.$this->getOption('type'),
    5361      );
    5462      $input_tag = $this->renderTag('input', array_merge($params, $attributes));
  • OpenPNE3/trunk/web/css/main.css

    r10203 r10211  
    520520}
    521521
     522/*----------------------------------------------
     523 * Form Table
     524 *--------------------------------------------*/
     525.formTable textarea {
     526  width: 98%;
     527}
     528
    522529/*==============================================================================
    523530 * descriptionBox
Note: See TracChangeset for help on using the changeset viewer.