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

Changeset 12209


Ignore:
Timestamp:
Jul 9, 2009, 2:41:56 PM (14 years ago)
Author:
ShogoKawahara
Message:

#4106:fixed partsForm design on the mobile

Location:
OpenPNE3/trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/modules/community/templates/editSuccess.php

    r11635 r12209  
    1616<?php op_mobile_page_title($title, $subtitle) ?>
    1717
    18 <form action="<?php echo url_for($url) ?>" method="post">
    19 <table>
    20 <?php echo $communityForm ?>
    21 <?php echo $communityConfigForm ?>
    22 <tr>
    23 <td colspan="2"><input type="submit" value="<?php echo __('Save') ?>" /></td>
    24 </tr>
    25 </table>
    26 </form>
     18<?php op_include_form('communityForm', array($communityForm, $communityConfigForm), array(
     19  'url' => url_for($url),
     20  'button' => __('Save'),
     21  'align' => 'center',
     22)) ?>
    2723
    2824<?php
  • OpenPNE3/trunk/apps/mobile_frontend/modules/friend/templates/linkInput.php

    r11584 r12209  
    11<?php op_mobile_page_title($member->getName(), __('Add friends')); ?>
    2 <?php echo $form->renderFormTag(url_for('friend/link?id='.$id)) ?>
    3 <?php echo $form ?>
    4 <input type="submit" value="<?php echo __('Submit') ?>">
    5 </form>
     2
     3<?php op_include_form('linkForm', $form, array(
     4  'url'    => url_for('friend/link?id='.$id),
     5  'button' => __('Submit'),
     6  'align'  => 'center'
     7)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/configCompleteSuccess.php

    r10304 r12209  
    11<?php op_mobile_page_title(__('Settings')) ?>
    22
    3 <form action="<?php echo url_for(sprintf('member/configComplete?token=%s&id=%s&type=%s', $sf_params->get('token'), $sf_params->get('id'), $sf_params->get('type'))) ?>" method="post">
    4 <?php echo $form ?>
    5 <br><br>
    6 <center><input type="submit" value="<?php echo __('Send') ?>"></center>
    7 </form>
     3<?php op_include_form('configComplateForm', $form, array(
     4  'url'    => url_for(sprintf('member/configComplete?token=%s&id=%s&type=%s', $sf_params->get('token'), $sf_params->get('id'), $sf_params->get('type'))),
     5  'button' => __('Send'),
     6  'align'  => 'center'
     7)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/configSuccess.php

    r10455 r12209  
    66
    77<?php if ($categoryName): ?>
    8 <form action="<?php echo url_for('member/config?category='.$categoryName) ?>" method="post">
    9 <?php echo $form ?>
    10 <br>
    11 <center><input type="submit" value="<?php echo __('Save') ?>"></center>
    12 </form>
     8<?php op_include_form('configForm', $form, array(
     9  'url'    => url_for('member/config?category='.$categoryName),
     10  'align'  => 'center',
     11  'button' => __('Save')
     12)) ?>
    1313<?php else: ?>
    1414<?php echo __('Please select the item from the menu.'); ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/deleteInput.php

    r10348 r12209  
    33<?php echo __('Please input your password if you want to delete your account.') ?>
    44
    5 <form action="<?php echo url_for('member/delete') ?>" method="post">
    6 <?php echo $form ?>
    7 <br>
    8 <input type="submit" value="<?php echo __('Send') ?>" />
    9 </form>
     5<?php op_include_form('deleteForm', $form, array(
     6  'url'    => url_for('member/delete'),
     7  'button' => __('Send'),
     8  'align'  => 'center'
     9)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/editProfileSuccess.php

    r10304 r12209  
    11<?php op_mobile_page_title(__('Edit profile')) ?>
    22
    3 <form action="<?php echo url_for('member/editProfile') ?>" method="post">
    4 <?php echo $memberForm ?>
    5 <?php echo $profileForm ?>
    6 <br><br>
    7 <center><input type="submit" value="<?php echo __('Save') ?>"></center>
    8 </form>
     3<?php op_include_form('profileForm', array($memberForm, $profileForm), array(
     4    'url'    => url_for('member/editProfile'),
     5    'align'  => 'center',
     6    'button' => __('Save')
     7)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/inviteInput.php

    r10304 r12209  
    11<?php op_mobile_page_title(__('Invite friends for %1%', array('%1%' => $op_config['sns_name']))) ?>
    22
    3 <form action="<?php echo url_for('member/invite') ?>" method="post">
    4 <?php echo $form ?>
    5 <br>
    6 <input type="submit" value="<?php echo __('Send') ?>" />
    7 </form>
     3<?php op_include_form('inviteForm', $form, array(
     4  'url'    => url_for('member/invite'),
     5  'button' => __('Send'),
     6  'align'  => 'center',
     7)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/registerInputSuccess.php

    r10267 r12209  
    1 <?php echo $form->renderFormTag(url_for('member/registerInput')) ?>
    2 <table>
    3 <?php echo $form ?>
    4 <tr>
    5 <td colspan="2"><input type="submit" value="<?php echo __('Register') ?>" /></td>
    6 </tr>
    7 </table>
    8 </form>
     1<?php op_include_form('registerForm', $form, array(
     2  'url'    => url_for('member/registerInput'),
     3  'button' => __('Register'),
     4  'align'  => 'center'
     5)) ?>
  • OpenPNE3/trunk/apps/mobile_frontend/templates/_partsForm.php

    r11882 r12209  
    11<?php
    2 $options->setDefault('method', 'post');
     2$options->setDefault('button', __('Send'));
     3$options->setDefault('url', url_for(sfContext::getInstance()->getRouting()->getCurrentInternalUri()));
     4$options->setDefault('method','post');
    35?>
    46
     
    79<?php $forms = ($options['form'] instanceof sfForm) ? array($options['form']): $options['form'] ?>
    810<?php foreach ($forms as $form): ?>
    9 <?php echo $form ?>
     11<?php if ($form->hasGlobalErrors()): ?>
     12<?php echo $form->renderGlobalErrors(); ?>
     13<?php endif; ?>
     14<?php echo $form->renderHiddenFields() ?>
     15<?php
     16foreach ($form as $field)
     17{
     18  if ($field->isHidden()) continue;
     19
     20  $attributes = array();
     21  $widget = $field->getWidget();
     22
     23  if ($widget instanceof opWidgetFormProfile)
     24  {
     25    $widget = $widget->getOption('widget');
     26  }
     27
     28  if ($widget instanceof sfWidgetFormChoice)
     29  {
     30    if ($widget->getRenderer() instanceof sfWidgetFormSelectRadio || $widget->getRenderer() instanceof sfWidgetFormSelectCheckbox)
     31    {
     32      $widget->setOption('renderer_options',
     33        array_merge(array(
     34          'formatter' => array('opWidgetFormSelectFormatterMobile', 'formatter'),
     35          'separator' => "<br>\n"
     36        ), $widget->getOption('renderer_options'))
     37      );
     38    }
     39  }
     40  elseif ($widget instanceof sfWidgetFormSelectRadio || $widget instanceof sfWidgetFormSelectCheckbox)
     41  {
     42    $widget->setOption('formatter', array('opWidgetFormSelectFormatterMobile', 'formatter'));
     43    $widget->setOption('separator', "<br>\n");
     44  }
     45
     46  echo $field->renderRow($attributes);
     47}
     48?>
    1049<?php endforeach; ?>
    1150<?php include_customizes($id, 'lastRow') ?>
    12 
    1351<?php if (!empty($options['align'])): ?>
    1452<div align="<?php echo $options['align'] ?>">
  • OpenPNE3/trunk/apps/mobile_frontend/templates/_partsLayout.php

    r12098 r12209  
    2121</div>
    2222<?php endif; ?>
    23 <br>
    2423</div>
    2524<?php include_customizes($id, 'after') ?>
Note: See TracChangeset for help on using the changeset viewer.