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

Changeset 12310


Ignore:
Timestamp:
Jul 19, 2009, 9:02:23 PM (14 years ago)
Author:
ebihara
Message:

#4088:added support for adding and deleting community's image from the mobile_frontend application

Location:
OpenPNE3/trunk/apps
Files:
7 added
3 edited

Legend:

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

    r12288 r12310  
    111111    return sfView::SUCCESS;
    112112  }
     113
     114  /**
     115   * Executes configImage action
     116   *
     117   * @param sfWebRequest $request a request object
     118   */
     119  public function executeConfigImage(sfWebRequest $request)
     120  {
     121    $this->forward404Unless($this->id && $this->isEditCommunity);
     122    $this->community = Doctrine::getTable('Community')->find($this->id);
     123  }
     124
     125  /**
     126   * Executes deleteImage action
     127   *
     128   * @param sfWebRequest $request a request object
     129   */
     130  public function executeDeleteImage($request)
     131  {
     132    $this->forward404Unless($this->id && $this->isEditCommunity);
     133
     134    $this->community = Doctrine::getTable('Community')->find($this->id);
     135    $this->forward404Unless($this->community->getImageFileName());
     136
     137    $this->form = new sfForm();
     138    if ($request->isMethod(sfWebRequest::POST))
     139    {
     140      $request->checkCSRFProtection();
     141
     142      $this->community->getFile()->delete();
     143      $this->redirect('community/configImage?id='.$this->id);
     144    }
     145  }
    113146}
  • OpenPNE3/trunk/apps/mobile_frontend/modules/community/templates/homeSuccess.php

    r12300 r12310  
    1010<?php echo image_tag_sf_image($community->getImageFileName(), array('size' => '120x120', 'format' => 'jpg')) ?>
    1111<?php if ($isAdmin) : ?>
    12 <br><?php echo link_to(__('Edit Photo'), 'community/edit?id='.$community->getId()) ?>
     12<br><?php echo link_to(__('Edit Photo'), 'community/configImage?id='.$community->getId()) ?>
    1313<?php endif; ?>
    1414</td>
  • OpenPNE3/trunk/apps/mobile_mail_frontend/config/routing.yml

    r11786 r12310  
    33  class: opMailRoute
    44  param: { module: member, action: image }
     5
     6community_add_image:
     7  url: c.:id
     8  class: opMailRoute
     9  param: { module: community, action: image }
     10  required: { id: \d+ }
    511
    612# default rules
Note: See TracChangeset for help on using the changeset viewer.