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

Changeset 10303


Ignore:
Timestamp:
Jan 21, 2009, 11:31:14 PM (11 years ago)
Author:
ogawa
Message:

#3448:replaced include_list_box() into op_include_parts()

Location:
OpenPNE3/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r10298 r10303  
    3232  '説明文'         => nl2br($community->getConfig('description')),
    3333);
    34 include_list_box('communityHome', $list, array('title' => 'コミュニティ'))
     34$options = array(
     35  'title' => __('コミュニティ'),
     36  'list' => $list,
     37);
     38op_include_parts('listBox', 'communityHome', $options);
    3539?>
    3640
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/templates/profileSuccess.php

    r10298 r10303  
    6363  $list[$caption] = $profile;
    6464}
    65 include_list_box('profile', $list, array('title' => 'プロフィール'))
     65$options = array(
     66  'title' => __('プロフィール'),
     67  'list' => $list,
     68);
     69op_include_parts('listBox', 'profile', $options);
    6670?>
  • OpenPNE3/trunk/apps/pc_frontend/templates/_layout.php

    r10260 r10303  
    1919
    2020<?php if ($sf_user->hasFlash('error')): ?>
    21 <?php include_alert_box('flashError', __($sf_user->getFlash('error'))) ?>
     21<?php op_include_parts('alertBox', 'flashError', array('body' => __($sf_user->getFlash('error')))) ?>
    2222<?php endif; ?>
    2323<?php if ($sf_user->hasFlash('notice')): ?>
    24 <?php include_alert_box('flashNotice', __($sf_user->getFlash('notice'))) ?>
     24<?php op_include_parts('alertBox', 'flashNotice', array('body' => __($sf_user->getFlash('notice')))) ?>
    2525<?php endif; ?>
    2626
  • OpenPNE3/trunk/apps/pc_frontend/templates/_partsLayout.php

    r10298 r10303  
    11<?php include_customizes($id, 'before') ?>
    22
     3<?php
     4$class = '';
     5if ($name) $class .= ' '.$name;
     6if (!empty($options['class'])) $class .= ' '.$options['class'];
     7?>
    38<?php if (empty($options['single'])): ?>
    4 <div id="<?php echo $id ?>" class="dparts<?php if ($name) echo ' '.$name ?>">
     9<div id="<?php echo $id ?>" class="dparts<?php echo $class ?>">
    510<div class="parts">
    611<?php else: ?>
    7 <div id="<?php echo $id ?>" class="parts<?php if ($name) echo ' '.$name ?>">
     12<div id="<?php echo $id ?>" class="parts<?php echo $class ?>">
    813<?php endif; ?>
    914
  • OpenPNE3/trunk/lib/helper/PartsHelper.php

    r10297 r10303  
    1515 * @subpackage helper
    1616 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
    17  * @author     Ogawa Rimpei <ogawa@tejimaya.com>
     17 * @author     Rimpei Ogawa <ogawa@tejimaya.com>
    1818 */
    1919
     
    4343}
    4444
     45/**
     46 * Include box parts
     47 *
     48 * @param string $id
     49 * @param string $body
     50 * @param array  $options
     51 *
     52 * @see op_include_parts
     53 */
    4554function op_include_box($id, $body, $options = array())
    4655{
     
    5059}
    5160
     61/**
     62 * Include form parts
     63 *
     64 * @param string $id
     65 * @param mixed  $form  a sfForm object or an array of sfForm objects
     66 * @param array  $options
     67 *
     68 * @see op_include_parts
     69 */
    5270function op_include_form($id, $form, $options = array())
    5371{
     
    5775}
    5876
     77/**
     78 * Include list parts
     79 *
     80 * @param string $id
     81 * @param array  $list
     82 * @param array  $options
     83 *
     84 * @see op_include_parts
     85 */
    5986function op_include_list($id, $list, $options = array())
    6087{
     
    6491}
    6592
     93/**
     94 * Include line parts
     95 *
     96 * @param string $id
     97 * @param string $line
     98 * @param array  $options
     99 *
     100 * @see op_include_parts
     101 */
    66102function op_include_line($id, $line, $options = array())
    67103{
     
    69105
    70106  op_include_parts('line', $id, $options);
    71 }
    72 
    73 /**
    74  * Includes a login parts.
    75  *
    76  * @param string $id
    77  * @param sfForm $form
    78  * @param string $link_to   A location of an action.
    79  *
    80  * @see    include_partial
    81  */
    82 function include_login_parts($id, $form, $link_to)
    83 {
    84   $params = array(
    85     'id' => $form->getAuthMode().$id,
    86     'form' => $form,
    87     'link_to' => url_for(sprintf($link_to.'?%s=%s', sfOpenPNEAuthForm::AUTH_MODE_FIELD_NAME, $form->getAuthMode())),
    88   );
    89   include_partial('global/partsLogin', $params);
    90 }
    91 
    92 function include_page_title($title, $subtitle = '')
    93 {
    94   $params = array(
    95     'title' => $title,
    96     'subtitle' => $subtitle,
    97   );
    98   include_partial('global/partsPageTitle', $params);
    99 }
    100 
    101 function include_list_box($id, $list, $options = array())
    102 {
    103   $options['list'] = $list;
    104 
    105   op_include_parts('listBox', $id, $options);
    106 }
    107 
    108 function include_alert_box($id, $body, $options = array())
    109 {
    110   $options['body'] = $body;
    111 
    112   op_include_parts('alertBox', $id, $options);
    113 }
    114 
    115 function include_simple_box($id, $title = '', $block = '', $option = array())
    116 {
    117   if(!isset($option['border']))
    118   {
    119     $option['border'] = true;
    120   }
    121   if(!isset($option['class']))
    122   {
    123     $option['class'] = '';
    124   }
    125 
    126   $params = array(
    127     'id' => $id,
    128     'title' => $title,
    129     'block' => $block,
    130     'option' => $option,
    131   );
    132 
    133   include_partial('global/partsSimpleBox', $params);
    134 }
    135 
    136 function include_box($id, $title = '', $body = '', $options = array())
    137 {
    138   $options['title'] = $title;
    139 
    140   if (!empty($options['form']))
    141   {
    142     if ($body)
    143     {
    144       $options['info'] = $body;
    145     }
    146 
    147     if (!isset($options['button']))
    148     {
    149       $options['button'] = '変更';
    150     }
    151 
    152     if (!isset($options['url']))
    153     {
    154       $request = sfContext::getInstance()->getRequest();
    155       $options['url'] = $request->getParameter('module').'/'.$request->getParameter('action');
    156     }
    157 
    158     op_include_form($id, $options['form'], $options);
    159   }
    160   else
    161   {
    162     op_include_box($id, $body, $options);
    163   }
    164 }
    165 
    166 function include_parts($parts_name, $id, $option = array())
    167 {
    168   $params = array(
    169     'id'      => $id,
    170     'options' => $option,
    171   );
    172   include_partial('global/parts'.ucfirst($parts_name), $params);
    173107}
    174108
     
    223157}
    224158
    225 function _is_disabled_plugin_dir($directory)
    226 {
    227   foreach (sfConfig::get('sf_'.sfConfig::get('sf_app').'_openpne_disabled_plugins', array()) as $pluginName) {
    228     if (0 === strpos($directory, sfConfig::get('sf_plugins_dir') . DIRECTORY_SEPARATOR . $pluginName)) {
    229       return true;
    230     }
    231   }
    232 
    233   return false;
     159/**
     160 * Includes a login parts.
     161 *
     162 * @param string $id
     163 * @param sfForm $form
     164 * @param string $link_to   A location of an action.
     165 *
     166 * @see    include_partial
     167 */
     168function include_login_parts($id, $form, $link_to)
     169{
     170  $params = array(
     171    'id' => $form->getAuthMode().$id,
     172    'form' => $form,
     173    'link_to' => url_for(sprintf($link_to.'?%s=%s', sfOpenPNEAuthForm::AUTH_MODE_FIELD_NAME, $form->getAuthMode())),
     174  );
     175  include_partial('global/partsLogin', $params);
     176}
     177
     178function include_page_title($title, $subtitle = '')
     179{
     180  $params = array(
     181    'title' => $title,
     182    'subtitle' => $subtitle,
     183  );
     184  include_partial('global/partsPageTitle', $params);
     185}
     186
     187/**
     188 * @deprecated since 3.0beta4
     189 */
     190function include_list_box($id, $list, $options = array())
     191{
     192  $options['list'] = $list;
     193
     194  op_include_parts('listBox', $id, $options);
     195}
     196
     197/**
     198 * @deprecated since 3.0beta4
     199 */
     200function include_simple_box($id, $title = '', $block = '', $option = array())
     201{
     202  if(!isset($option['border']))
     203  {
     204    $option['border'] = true;
     205  }
     206  if(!isset($option['class']))
     207  {
     208    $option['class'] = '';
     209  }
     210
     211  $params = array(
     212    'id' => $id,
     213    'title' => $title,
     214    'block' => $block,
     215    'option' => $option,
     216  );
     217
     218  include_partial('global/partsSimpleBox', $params);
     219}
     220
     221/**
     222 * @deprecated since 3.0beta4
     223 */
     224function include_box($id, $title = '', $body = '', $options = array())
     225{
     226  $options['title'] = $title;
     227
     228  if (!empty($options['form']))
     229  {
     230    if ($body)
     231    {
     232      $options['info'] = $body;
     233    }
     234
     235    if (!isset($options['button']))
     236    {
     237      $options['button'] = '変更';
     238    }
     239
     240    if (!isset($options['url']))
     241    {
     242      $request = sfContext::getInstance()->getRequest();
     243      $options['url'] = $request->getParameter('module').'/'.$request->getParameter('action');
     244    }
     245
     246    op_include_form($id, $options['form'], $options);
     247  }
     248  else
     249  {
     250    op_include_box($id, $body, $options);
     251  }
     252}
     253
     254/**
     255 * @deprecated since 3.0beta4
     256 */
     257function include_parts($parts_name, $id, $option = array())
     258{
     259  $params = array(
     260    'id'      => $id,
     261    'options' => $option,
     262  );
     263  include_partial('global/parts'.ucfirst($parts_name), $params);
    234264}
    235265
     
    237267 * Include news
    238268 *
     269 * @deprecated since 3.0beta4
    239270 */
    240271function include_news($id, $title = '', $list, $option = array())
     
    251282 * Include news pager
    252283 *
     284 * @deprecated since 3.0beta4
    253285 */
    254286function include_news_pager($id, $title = '', $pager, $list, $link_to_detail)
     
    264296 include_simple_box( $id, $title, get_partial('global/partsNewsPager', $params), array('class' => 'partsNewsPager'));
    265297}
    266 
Note: See TracChangeset for help on using the changeset viewer.