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

Changeset 9943


Ignore:
Timestamp:
Jan 6, 2009, 1:18:58 PM (11 years ago)
Author:
ebihara
Message:

#3330,#3331,#3332,#3333:added the member/config action to the mobile_frontend application

Location:
OpenPNE3/trunk
Files:
1 added
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/homeSuccess.php

    r9768 r9943  
    5151
    5252<?php
    53 $list = array(
    54   link_to('かんたんログイン設定', 'member/configUID'),
    55 );
     53$list = array();
     54foreach (sfConfig::get('openpne_member_category') as $key => $value)
     55{
     56  if (count($value))
     57  {
     58    $list[] = link_to($key, 'member/config?category='.$key);
     59  }
     60}
     61$list[] = link_to('かんたんログイン設定', 'member/configUID');
    5662include_list_box('configEdit', $list, array('title' => '設定変更'))
    5763?>
  • OpenPNE3/trunk/apps/mobile_frontend/templates/_partsListBox.php

    r9644 r9943  
    1212
    1313<?php foreach ($list as $key => $value) : ?>
    14 <tr><td bgcolor="#e0eaef">
     14<tr><td bgcolor="<?php echo cycle_vars($id, '#e0eaef,#ffffff') ?>">
    1515<?php echo $list->getRaw($key); ?><br>
    1616</td></tr>
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/actions/actions.class.php

    r9942 r9943  
    7777    $this->communities = CommunityPeer::retrievesByMemberId($this->getUser()->getMemberId(), 9);
    7878    return $result;
    79   }
    80 
    81  /**
    82   * Executes config action
    83   *
    84   * @param sfRequest $request A request object
    85   */
    86   public function executeConfig($request)
    87   {
    88     $this->categories = sfConfig::get('openpne_member_category');
    89     $this->categoryName = $request->getParameter('category', null);
    90     if ($this->categoryName)
    91     {
    92       $this->forward404Unless(array_key_exists($this->categoryName, $this->categories), 'Undefined category');
    93       $formClass = 'MemberConfig'.ucfirst($this->categoryName).'Form';
    94       $this->form = new $formClass($this->getUser()->getMember());
    95     }
    96 
    97     if ($request->isMethod('post'))
    98     {
    99       $this->form->bind($request->getParameter('member_config'));
    100       if ($this->form->isValid())
    101       {
    102         $this->form->save($this->getUser()->getMemberId());
    103         $this->redirect('member/config?category='.$this->categoryName);
    104       }
    105     }
    106 
    107     return sfView::SUCCESS;
    10879  }
    10980
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r9779 r9943  
    185185  }
    186186
     187 /**
     188  * Executes config action
     189  *
     190  * @param sfRequest $request A request object
     191  */
     192  public function executeConfig($request)
     193  {
     194    $this->categories = sfConfig::get('openpne_member_category');
     195    $this->categoryName = $request->getParameter('category', null);
     196    if ($this->categoryName)
     197    {
     198      $this->forward404Unless(array_key_exists($this->categoryName, $this->categories), 'Undefined category');
     199      $formClass = 'MemberConfig'.ucfirst($this->categoryName).'Form';
     200      $this->form = new $formClass($this->getUser()->getMember());
     201    }
     202
     203    if ($request->isMethod('post'))
     204    {
     205      $this->form->bind($request->getParameter('member_config'));
     206      if ($this->form->isValid())
     207      {
     208        $this->form->save($this->getUser()->getMemberId());
     209        $this->redirect('member/config?category='.$this->categoryName);
     210      }
     211    }
     212
     213    return sfView::SUCCESS;
     214  }
    187215}
  • OpenPNE3/trunk/lib/helper/opUtilHelper.php

    r9819 r9943  
    4343{
    4444  return sprintf('%d件~%d件を表示', $pager->getFirstIndice(), $pager->getLastIndice());
     45}
     46
     47function cycle_vars($name, $items, $delimiter = ',')
     48{
     49  static $cycles = array();
     50  if (!isset($cycles[$name]))
     51  {
     52    $cycles[$name] = array(
     53      'count' => 0,
     54      'items' => explode($delimiter, $items),
     55    );
     56  }
     57
     58  $items = $cycles[$name]['items'];
     59
     60  $result = $items[$cycles[$name]['count']];
     61  $cycles[$name]['count']++;
     62
     63  if ($cycles[$name]['count'] >= count($items))
     64  {
     65    $cycles[$name]['count'] = 0;
     66  }
     67
     68  return $result;
    4569}
    4670
Note: See TracChangeset for help on using the changeset viewer.