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

Changeset 10246


Ignore:
Timestamp:
Jan 20, 2009, 3:05:06 PM (11 years ago)
Author:
ogawa
Message:

パーツヘルパー変更途中

Location:
OpenPNE3/branches/ogawa_parts
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsBox.php

    r9644 r10246  
    22<div id="<?php echo $id ?>" class="dparts box"><div class="parts">
    33
    4 <?php if ($title) : ?>
     4<?php if ($title): ?>
    55<div class="partsHeading">
    66<?php include_customizes($id, 'headTop') ?>
     
    1111
    1212<div class="block">
    13 <?php if (empty($option['form'])) : ?>
     13<?php if (empty($options['form'])): ?>
    1414<div class="body">
    1515<?php include_customizes($id, 'bodyTop') ?>
     
    1919<?php endif; ?>
    2020
    21 <?php if (isset($option['form'])) : ?>
    22 <?php $option_raw = $sf_data->getRaw('option') ?>
    23 <form action="<?php echo url_for($option_raw['url']) ?>" method="post"<?php if (!empty($option['isMultipart'])) : ?> enctype="multipart/form-data"<?php endif; ?>>
     21<?php if (isset($options['form'])): ?>
     22<?php $options_raw = $sf_data->getRaw('options') ?>
     23<form action="<?php echo url_for($options_raw['url']) ?>" method="post"<?php if (!empty($options['isMultipart'])): ?> enctype="multipart/form-data"<?php endif; ?>>
    2424<?php include_customizes($id, 'formTop') ?>
    2525<table>
    26 <?php if ($option['form']  instanceof sfOutputEscaperArrayDecorator) : ?>
    27 <?php foreach ($option['form'] as $form) : ?>
     26<?php if ($options['form']  instanceof sfOutputEscaperArrayDecorator): ?>
     27<?php foreach ($options['form'] as $form): ?>
    2828<?php echo $form ?>
    2929<?php endforeach; ?>
    30 <?php else : ?>
    31 <?php echo $option['form'] ?>
     30<?php else: ?>
     31<?php echo $options['form'] ?>
    3232<?php endif; ?>
    33 <?php include_customizes($id, 'lastRaw') ?>
     33<?php include_customizes($id, 'lastRow') ?>
    3434</table>
    35 <?php if (!empty($option['moreInfo'])) : ?>
     35<?php if (!empty($options['moreInfo'])): ?>
    3636<div class="block moreInfo">
    3737<ul class="moreInfo">
    38 <?php foreach ($option['moreInfo'] as $key => $value) : ?>
    39 <li><?php echo $option['moreInfo']->getRaw($key); ?></li>
     38<?php foreach ($options['moreInfo'] as $key => $value): ?>
     39<li><?php echo $options['moreInfo']->getRaw($key) ?></li>
    4040<?php endforeach; ?>
    4141</ul>
     
    4545<ul class="moreInfo button">
    4646<li>
    47 <input class="input_submit" type="submit" value="<?php echo $option['button'] ?>" />
     47<input class="input_submit" type="submit" value="<?php echo $options['button'] ?>" />
    4848</li>
    4949</ul>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsForm.php

    r10206 r10246  
    11<?php include_customizes($id, 'headTop') ?>
    2 <?php if (isset($option['title'])) : ?>
     2<?php if (isset($options['title'])): ?>
    33<table id="<?php echo $id ?>" width="100%">
    44<tr><td bgcolor="#7ddadf">
    5 <font color="#000000"><?php echo $option['title'] ?></font><br>
     5<font color="#000000"><?php echo $options['title'] ?></font><br>
    66</td></tr>
    7 <?php else : ?>
     7<?php else: ?>
    88<tr><td bgcolor="#ffffff">
    99<hr color="#b3ceef">
     
    1313<?php include_customizes($id, 'headBottom') ?>
    1414
    15 <?php $option_raw = $sf_data->getRaw('option') ?>
    16 <form action="<?php echo url_for($option_raw['url']) ?>" method="post"<?php if (!empty($option['isMultipart'])) : ?> enctype="multipart/form-data"<?php endif; ?>>
     15<?php $options_raw = $sf_data->getRaw('options') ?>
     16<form action="<?php echo url_for($options_raw['url']) ?>" method="post"<?php if (!empty($options['isMultipart'])): ?> enctype="multipart/form-data"<?php endif; ?>>
    1717<?php include_customizes($id, 'formTop') ?>
    18 <?php if ($option['form']  instanceof sfOutputEscaperArrayDecorator) : ?>
    19 <?php foreach ($option['form'] as $form) : ?>
     18<?php if ($content instanceof sfOutputEscaperArrayDecorator): ?>
     19<?php foreach ($content as $form): ?>
    2020<?php echo $form ?>
    2121<?php endforeach; ?>
    22 <?php else : ?>
    23 <?php echo $option['form'] ?>
     22<?php else: ?>
     23<?php echo $content ?>
    2424<?php endif; ?>
    25 <?php include_customizes($id, 'lastRaw') ?>
     25<?php include_customizes($id, 'lastRow') ?>
    2626
    27 <?php if (!empty($option['align'])) : ?>
    28 <div align="<?php echo $option['align'] ?>">
    29 <?php else : ?>
     27<?php if (!empty($options['align'])): ?>
     28<div align="<?php echo $options['align'] ?>">
     29<?php else: ?>
    3030<div>
    3131<?php endif; ?>
    32 <input class="input_submit" type="submit" value="<?php echo $option['button'] ?>" />
     32<input class="input_submit" type="submit" value="<?php echo $options['button'] ?>" />
    3333</div>
    3434<?php include_customizes($id, 'formBottom') ?>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsInformationBox.php

    r8914 r10246  
    1 <?php include_customizes($id, 'before') ?>
    2 <?php include_customizes($id, 'top') ?>
    3 <?php echo $sf_data->getRaw('body') ?>
    4 <?php include_customizes($id, 'bottom') ?>
    5 <?php include_customizes($id, 'after') ?>
    6 <br>
     1<?php echo $sf_data->getRaw('content') ?><br>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsLayout.php

    r10206 r10246  
    11<?php
    2 include_customizes($parts_option['id'], 'before');
    3 include_customizes($parts_option['id'], 'top');
    4 include_partial('global/parts'.ucfirst($parts_name), $sf_data->getRaw('parts_option'));
    5 include_customizes($parts_option['id'], 'bottom');
    6 include_customizes($parts_option['id'], 'after')
     2include_customizes($id, 'before');
     3include_customizes($id, 'top');
     4echo $sf_data->getRaw('op_content');
     5include_customizes($id, 'bottom');
     6include_customizes($id, 'after')
    77 ?>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsList.php

    r10206 r10246  
    11<table id="<?php echo $id ?>" width="100%">
    2 <?php if (isset($option['title'])) : ?>
     2<?php if (isset($options['title'])): ?>
    33<tr><td bgcolor="#7ddadf">
    4 <font color="#000000"><?php echo $option['title'] ?></font><br>
     4<font color="#000000"><?php echo $options['title'] ?></font><br>
    55</td></tr>
    6 <?php else : ?>
     6<?php else: ?>
    77<tr><td bgcolor="#ffffff">
    88<hr color="#b3ceef">
     
    1010<?php endif; ?>
    1111
    12 <?php foreach ($contents as $key => $value) : ?>
     12<?php foreach ($content as $key => $value): ?>
    1313<tr><td bgcolor="<?php echo cycle_vars($id, '#e0eaef,#ffffff') ?>">
    14 <?php echo $contents->getRaw($key); ?><br>
     14<?php echo $content->getRaw($key) ?><br>
    1515</td></tr>
    16 <?php if (!empty($option['border'])) : ?>
     16<?php if (!empty($options['border'])): ?>
    1717<tr><td bgcolor="#ffffff">
    1818<hr color="#b3ceef">
     
    2121<?php endforeach; ?>
    2222
    23 <?php if (isset($option['moreInfo'])) : ?>
     23<?php if (isset($options['moreInfo'])): ?>
    2424<tr><td align="right">
    25 <?php foreach ($option['moreInfo'] as $key => $value) : ?>
    26 <?php echo $option['moreInfo']->getRaw($key); ?><br>
     25<?php foreach ($options['moreInfo'] as $key => $value): ?>
     26<?php echo $options['moreInfo']->getRaw($key) ?><br>
    2727<?php endforeach; ?>
    2828</td></tr>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsListBox.php

    r9943 r10246  
    1 <?php include_customizes($id, 'before') ?>
    21<table id="<?php echo $id ?>" width="100%">
    3 <?php if (isset($options['title'])) : ?>
     2<?php if (isset($options['title'])): ?>
    43<tr><td bgcolor="#7ddadf">
    54<font color="#000000"><?php echo $options['title'] ?></font><br>
    65</td></tr>
    7 <?php else : ?>
     6<?php else: ?>
    87<tr><td bgcolor="#ffffff">
    98<hr color="#b3ceef">
     
    1110<?php endif; ?>
    1211
    13 <?php foreach ($list as $key => $value) : ?>
     12<?php foreach ($content as $key => $value): ?>
    1413<tr><td bgcolor="<?php echo cycle_vars($id, '#e0eaef,#ffffff') ?>">
    15 <?php echo $list->getRaw($key); ?><br>
     14<?php echo $content->getRaw($key) ?><br>
    1615</td></tr>
    17 <?php if (!empty($options['border'])) : ?>
     16<?php if (!empty($options['border'])): ?>
    1817<tr><td bgcolor="#ffffff">
    1918<hr color="#b3ceef">
     
    2221<?php endforeach; ?>
    2322
    24 <?php if (isset($options['moreInfo'])) : ?>
     23<?php if (isset($options['moreInfo'])): ?>
    2524<tr><td align="right">
    26 <?php foreach ($options['moreInfo'] as $key => $value) : ?>
    27 <?php echo $options['moreInfo']->getRaw($key); ?><br>
     25<?php foreach ($options['moreInfo'] as $key => $value): ?>
     26<?php echo $options['moreInfo']->getRaw($key) ?><br>
    2827<?php endforeach; ?>
    2928</td></tr>
     
    3231</table>
    3332<br>
    34 <?php include_customizes($id, 'after') ?>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsLogin.php

    r10043 r10246  
    1212</form>
    1313
    14 <?php if ($form->getAuthAdapter()->getAuthConfig('invite_mode') == 2 && opToolkit::isEnabledRegistration('mobile')) : ?>
     14<?php if ($form->getAuthAdapter()->getAuthConfig('invite_mode') == 2 && opToolkit::isEnabledRegistration('mobile')): ?>
    1515<?php echo link_to('新規登録', $form->getAuthAdapter()->getAuthConfig('self_invite_action')) ?>
    1616<?php endif; ?>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsPageTitle.php

    r8874 r10246  
    33<font color="#EEEEEE"><a name="top"><?php echo $title ?></a></font><br>
    44</td></tr>
    5 <?php if (!empty($subtitle)) : ?>
     5<?php if (!empty($subtitle)): ?>
    66<tr><td align="center" bgcolor="#DDDDDD">
    77<font color="#000000"><a name="top"><?php echo $subtitle ?></a></font><br>
  • OpenPNE3/branches/ogawa_parts/apps/mobile_frontend/templates/_partsPlain.php

    r10206 r10246  
    1 <?php echo $contents ?>
     1<?php echo $content ?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/modules/default/templates/_informationBox.php

    r9582 r10246  
    11<?php
    2 include_information_box('information', $sf_data->getRaw('widget')->getConfig('value'))
     2op_include_parts('informationBox', 'information', $sf_data->getRaw('widget')->getConfig('value'), array('single' => true))
    33?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/modules/member/templates/profileSuccess.php

    r10234 r10246  
    3939<?php slot('op_top'); ?>
    4040<?php if ($relation->isSelf()): ?>
    41 <?php
    42 $option = array(
    43   'body' => '
     41<?php ob_start() ?>
    4442<p>※他のメンバーから見たあなたのページはこのようになります。</p>
    4543<p>他のメンバーにあなたのページを教える場合は、以下のURLを使ってください。<br />
    46 '.url_for('member/profile?id='.$member->getId(), true).'</p>
    47 <p>プロフィールを変更する場合は「'.link_to(__('プロフィール変更'), 'member/editProfile').'」よりおこなってください。</p>
    48 ');
    49 include_parts('descriptionBox', 'informationAboutThisIsYourProfilePage', $option);
    50 ?>
     44<?php echo url_for('member/profile?id='.$member->getId(), true) ?></p>
     45<p>プロフィールを変更する場合は「<?php echo link_to(__('プロフィール変更'), 'member/editProfile') ?>」よりおこなってください。</p>
     46<?php $content = ob_get_clean() ?>
     47<?php op_include_parts('descriptionBox', 'informationAboutThisIsYourProfilePage', $content) ?>
    5148<?php endif; ?>
    5249<?php end_slot(); ?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_layout.php

    r10225 r10246  
    1414</div><!-- Header -->
    1515
     16<div id="Layout<?php echo $layout ?>">
     17
     18<div id="Contents">
     19
    1620<?php if ($sf_user->hasFlash('error')): ?>
    1721<?php include_alert_box('flashError', __($sf_user->getFlash('error'))) ?>
     
    2024<?php include_alert_box('flashNotice', __($sf_user->getFlash('notice'))) ?>
    2125<?php endif; ?>
    22 
    23 <div id="Layout<?php echo $layout ?>">
    24 
    25 <div id="Contents">
    2626
    2727<?php if (has_slot('op_top')): ?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_partsAlertBox.php

    r9823 r10246  
    1 <?php include_customizes($id, 'before') ?>
    2 <div id="<?php echo $id ?>" class="dparts alertBox"><div class="parts">
    3 <table><tr>
     1<table>
     2<tr>
    43<th><img src="<?php echo public_path('images/icon_alert.gif') ?>" alt="" /></th>
    5 <td>
    6 <?php include_customizes($id, 'top') ?>
    7 <?php echo $sf_data->getRaw('body') ?>
    8 <?php include_customizes($id, 'bottom') ?>
    9 </td>
    10 </tr></table>
    11 </div></div>
    12 <?php include_customizes($id, 'after') ?>
     4<td><?php echo $sf_data->getRaw('content') ?></td>
     5</tr>
     6</table>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_partsBox.php

    r10213 r10246  
    5656}
    5757?>
    58 <?php include_customizes($id, 'lastRaw') ?>
     58<?php include_customizes($id, 'lastRow') ?>
    5959</table>
    6060
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_partsDescriptionBox.php

    r9949 r10246  
    1 <?php include_customizes($id, 'before') ?>
    2 <div id="<?php echo $id ?>" class="dparts descriptionBox"><div class="parts">
    3 <?php include_customizes($id, 'top') ?>
    4 <?php echo $sf_data->get('option')->getRaw('body') ?>
    5 <?php include_customizes($id, 'bottom') ?>
    6 </div></div>
    7 <?php include_customizes($id, 'after') ?>
     1<?php echo $sf_data->getRaw('content') ?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_partsInformationBox.php

    r8914 r10246  
    1 <?php include_customizes($id, 'before') ?>
    2 <div id="<?php echo $id ?>" class="parts informationBox">
    31<div class="body">
    4 <?php include_customizes($id, 'top') ?>
    5 <?php echo $sf_data->getRaw('body') ?>
    6 <?php include_customizes($id, 'bottom') ?>
     2<?php echo $sf_data->getRaw('content') ?>
    73</div>
    8 </div>
    9 <?php include_customizes($id, 'after') ?>
  • OpenPNE3/branches/ogawa_parts/apps/pc_frontend/templates/_partsListBox.php

    r9589 r10246  
    1 <?php include_customizes($id, 'before') ?>
    2 <div id="<?php echo $id ?>" class="dparts listBox"><div class="parts">
    3 
    4 <?php if (isset($options['title'])) : ?>
    5 <div class="partsHeading">
    6 <?php include_customizes($id, 'headTop') ?>
    7 <h3><?php echo $options['title'] ?></h3>
    8 <?php include_customizes($id, 'headBottom') ?>
    9 </div>
    10 <?php endif; ?>
    11 
    121<table>
    13 <?php foreach ($list as $key => $value): ?>
     2<?php foreach ($content as $key => $value): ?>
    143<tr>
    154<th><?php echo $key ?></th>
    16 <td><?php echo $list->getRaw($key) ?></td>
     5<td><?php echo $content->getRaw($key) ?></td>
    176</tr>
    187<?php endforeach; ?>
    19 <?php include_customizes($id, 'lastRaw') ?>
     8<?php include_customizes($id, 'lastRow') ?>
    209</table>
    2110
    22 <?php if(isset($options['moreInfo'])) : ?>
     11<?php if (isset($options['moreInfo'])): ?>
    2312<div class="block moreInfo">
    2413<ul class="moreInfo">
     
    2918</div>
    3019<?php endif; ?>
    31 
    32 </div>
    33 </div>
    34 <?php include_customizes($id, 'after') ?>
  • OpenPNE3/branches/ogawa_parts/lib/helper/PartsHelper.php

    r10206 r10246  
    1515 * @subpackage helper
    1616 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
    17  */
     17 * @author     Ogawa Rimpei <ogawa@tejimaya.com>
     18 */
     19
     20/**
     21 * Include parts
     22 *
     23 * @param string $name parts name
     24 * @param string $id
     25 * @param mixed  $content
     26 * @param array  $options
     27 */
     28function op_include_parts($name, $id, $content, $options = array())
     29{
     30  $params = array(
     31    'id'      => $id,
     32    'name'    => $name,
     33    'content' => $content,
     34    'options' => $options,
     35  );
     36
     37  if ($name)
     38  {
     39    $params['op_content'] = get_partial('global/parts'.ucfirst($name), $params);
     40  }
     41  else
     42  {
     43    $params['op_content'] = $content;
     44  }
     45
     46  include_partial('global/partsLayout', $params);
     47}
    1848
    1949/**
     
    4777function include_list_box($id, $list, $options = array())
    4878{
    49   $params = array(
    50     'id' => $id,
    51     'list' => $list,
    52     'options' => $options,
    53   );
    54   include_partial('global/partsListBox', $params);
     79  op_include_parts('listBox', $id, $list, $options);
    5580}
    5681
    5782function include_information_box($id, $body)
    5883{
    59   $params = array(
    60     'id' => $id,
    61     'body' => $body,
    62   );
    63   include_partial('global/partsInformationBox', $params);
     84  op_include_parts('informationBox', $id, $body);
    6485}
    6586
    6687function include_alert_box($id, $body)
    6788{
    68   $params = array(
    69     'id' => $id,
    70     'body' => $body,
    71   );
    72   include_partial('global/partsAlertBox', $params);
     89  op_include_parts('alertBox', $id, $body);
    7390}
    7491
     
    94111}
    95112
    96 function include_box($id, $title = '', $body = '', $option = array())
    97 {
    98   if (!empty($option['form']) && !isset($option['button'])) {
    99     $option['button'] = '変更';
    100   }
    101 
    102   if (!empty($option['form']) && !isset($option['url'])) {
    103     $request = sfContext::getInstance()->getRequest();
    104     $option['url'] = $request->getParameter('module').'/'.$request->getParameter('action');
    105   }
    106 
    107   $params = array(
    108     'id' => $id,
    109     'body' => $body,
    110     'option' => $option,
    111   );
    112   include_simple_box($id, $title, get_partial('global/partsBox', $params), array('class' => 'box'));
     113function include_box($id, $title = '', $body = '', $options = array())
     114{
     115  if (!empty($options['form']))
     116  {
     117    if (!isset($options['button']))
     118    {
     119      $options['button'] = '変更';
     120    }
     121
     122    if (!isset($options['url']))
     123    {
     124      $request = sfContext::getInstance()->getRequest();
     125      $options['url'] = $request->getParameter('module').'/'.$request->getParameter('action');
     126    }
     127
     128    op_include_parts('form', $id, $options['form'], $options);
     129  }
     130  else
     131  {
     132    $options['title'] = $title;
     133
     134    op_include_parts('box', $id, $body, $options);
     135  }
    113136}
    114137
     
    122145}
    123146
    124 function include_mobile_parts($parts_name, $id, $contents, $option = array())
    125 {
    126   $parts_option = array(
    127     'id'     => $id,
    128     'contents' => $contents,
    129     'option' => $option,
    130   );
    131   $params = array(
    132     'parts_name'     => $parts_name,
    133     'parts_option' => $parts_option,
    134   );
    135   include_partial('global/partsLayout', $params);
     147function include_mobile_parts($name, $id, $contents, $options = array())
     148{
     149  op_include_parts($name, $id, $contents, $options);
    136150}
    137151
Note: See TracChangeset for help on using the changeset viewer.