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

Changeset 8889


Ignore:
Timestamp:
Oct 30, 2008, 4:13:28 PM (11 years ago)
Author:
ebihara
Message:

#2885:added friend/link for mobile phone

Location:
OpenPNE3/trunk/apps/mobile_frontend/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/modules/friend/actions/actions.class.php

    r8818 r8889  
    3232    return sfView::SUCCESS;
    3333  }
     34
     35 /**
     36  * Executes link action
     37  *
     38  * @param sfRequest $request A request object
     39  */
     40  public function executeLink($request)
     41  {
     42    if ($this->isFriend)
     43    {
     44      return sfView::ERROR;
     45    }
     46    $this->redirectToHomeIfIdIsNotValid();
     47    FriendPeer::link($this->getUser()->getMemberId(), $this->id);
     48    $this->redirect('member/profile?id='.$this->id);
     49  }
     50
     51 /**
     52  * Redirects to your home if ID is yours or it is empty.
     53  */
     54  private function redirectToHomeIfIdIsNotValid()
     55  {
     56    $this->redirectUnless($this->id, 'member/home');
     57    $this->redirectIf(($this->id == $this->getUser()->getMemberId()), 'member/home');
     58  }
    3459}
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/profileSuccess.php

    r8816 r8889  
    2929</table>
    3030
    31 <br>
     31<?php if ($member != $sf_user->getMember()) : ?>
     32<?php if (!FriendPeer::isFriend($sf_user->getMemberId(), $member->getId())) : ?>
     33<?php echo link_to('フレンドに加える', 'friend/link?id='.$member->getId()) ?><br>
     34<?php endif; ?>
     35<?php endif; ?>
    3236
    3337<?php
Note: See TracChangeset for help on using the changeset viewer.