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

Changeset 11056


Ignore:
Timestamp:
Mar 18, 2009, 7:59:30 PM (13 years ago)
Author:
ShogoKawahara
Message:

#3329:added ability to edit member's photo on the mobile_frontend

Location:
OpenPNE3/trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/i18n/messages.ja.xml

    r11019 r11056  
    352352      </trans-unit>
    353353      <trans-unit id="">
     354        <source>Edit Photo</source>
     355        <target>写真編集</target>
     356      </trans-unit>
     357      <trans-unit id="">
     358        <source>Main Photo</source>
     359        <target>メイン写真</target>
     360      </trans-unit>
     361      <trans-unit id="">
    354362        <source>%1%'s Profile</source>
    355363        <target>%1%さんのプロフィール</target>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/profileSuccess.php

    r11013 r11056  
    1717<?php echo image_tag_sf_image($member->getImageFileName(), array('size' => '120x120', 'format' => 'jpg')) ?>
    1818<?php if ($relation->isSelf()) : ?>
    19 <?php //TODO: Add ability to edit image on mobile_frontend ?>
     19<br><?php echo link_to(__('Edit Photo'), 'member/configImage') ?>
    2020<?php elseif ($member->getImageFileName()) : ?>
    2121<br><?php echo link_to(__('Show Photo'), 'friend/showImage?id='.$member->getId()) ?>
  • OpenPNE3/trunk/apps/pc_frontend/i18n/messages.ja.xml

    r11044 r11056  
    284284      </trans-unit>
    285285      <trans-unit id="">
    286         <source>Main photo</source>
     286        <source>Main Photo</source>
    287287        <target>メイン写真</target>
    288288      </trans-unit>
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/actions/actions.class.php

    r11013 r11056  
    151151
    152152 /**
    153   * Executes deleteImage action
    154   *
    155   * @param sfRequest $request A request object
    156   */
    157   public function executeDeleteImage($request)
    158   {
    159     $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
    160     $this->forward404Unless($image);
    161     $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
    162 
    163     $image->delete();
    164 
    165     $this->redirect('member/configImage');
    166   }
    167 
    168  /**
    169   * Executes changeMainImage action
    170   *
    171   * @param sfRequest $request A request object
    172   */
    173   public function executeChangeMainImage($request)
    174   {
    175     $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
    176     $this->forward404Unless($image);
    177     $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
    178 
    179     $currentImage = $this->getUser()->getMember()->getImage();
    180     $currentImage->setIsPrimary(false);
    181     $currentImage->save();
    182     $image->setIsPrimary(true);
    183     $image->save();
    184 
    185     $this->redirect('member/configImage');
    186   }
    187 
    188  /**
    189153  * Executes registerMobileToRegisterEnd action
    190154  *
  • OpenPNE3/trunk/apps/pc_frontend/templates/_partsMemberImagesBox.php

    r11022 r11056  
    1010<?php echo link_to(__('Delete'), 'member/deleteImage?member_image_id='.$image->getId()) ?> |
    1111<?php if ($image->getIsPrimary()) : ?>
    12 <?php echo(__('メイン写真')) ?>
     12<?php echo(__('Main Photo')) ?>
    1313<?php else: ?>
    14 <?php echo link_to(__('メイン写真'), 'member/changeMainImage?member_image_id='.$image->getId()) ?>
     14<?php echo link_to(__('Main Photo'), 'member/changeMainImage?member_image_id='.$image->getId()) ?>
    1515<?php endif; ?>
    1616]
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r11013 r11056  
    334334  }
    335335
     336  public function executeConfigImage($request)
     337  {
     338    return sfView::SUCCESS;
     339  }
     340
     341  public function executeDeleteImage($request)
     342  {
     343    $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
     344    $this->forward404Unless($image);
     345    $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
     346
     347    $image->delete();
     348
     349    $this->redirect('member/configImage');
     350  }
     351
     352  public function executeChangeMainImage($request)
     353  {
     354    $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
     355    $this->forward404Unless($image);
     356    $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
     357
     358    $currentImage = $this->getUser()->getMember()->getImage();
     359    $currentImage->setIsPrimary(false);
     360    $currentImage->save();
     361    $image->setIsPrimary(true);
     362    $image->save();
     363
     364    $this->redirect('member/configImage');
     365  }
     366
     367
    336368  protected function sendDeleteAccountMail($member)
    337369  {
Note: See TracChangeset for help on using the changeset viewer.