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

Changeset 9686


Ignore:
Timestamp:
Dec 26, 2008, 1:56:54 PM (11 years ago)
Author:
nagasawa
Message:

changed the layout of Delete and

Location:
OpenPNE3/plugins/opIntroEssayPlugin/trunk/apps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opIntroEssayPlugin/trunk/apps/mobile_frontend/modules/introessay/actions/actions.class.php

    r9672 r9686  
    99 * @version    SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $
    1010 */
    11 class introessayActions extends sfActions
     11class introessayActions extends opIntroEssayPluginIntroEssayActions
    1212{
    13   public function preExecute()
    14   {
    15     $this->id = $this->getRequestParameter('id', $this->getUser()->getMemberId());
    16 
    17     $this->relation = MemberRelationshipPeer::retrieveByFromAndTo($this->getUser()->getMemberId(), $this->id);
    18     if (!$this->relation) {
    19       $this->relation = new MemberRelationship();
    20       $this->relation->setMemberIdFrom($this->getUser()->getMemberId());
    21       $this->relation->setMemberIdTo($this->id);
    22     }
    23   }
    24 
    25  /**
    26   * Executes index action
    27   *
    28   * @param sfRequest $request A request object
    29   */
    30   public function executeIndex($request)
    31   {
    32     $this->introEssay = IntroEssayPeer::getByFromAndTo($this->getUser()->GetMemberId(), $this->id);
    33     $this->form = new IntroEssayForm($this->introEssay);
    34     if ($request->isMethod('post'))
    35     {
    36       $array = $request->getParameter('intro_essay');
    37       if (!$this->introEssay)
    38       {
    39         $array['from_id'] = $this->getUser()->GetMemberId();
    40         $array['to_id'] = $this->id;
    41       }
    42       $this->form->bind($array);
    43       if ($this->form->isValid())
    44       {
    45         if ($this->introEssay)
    46         {
    47           $this->introEssay->setContent($array['content']);
    48           $this->introEssay->save();
    49         }
    50         else
    51         {
    52           $this->form->save();
    53         }
    54         return sfView::SUCCESS;
    55       }
    56     }
    57     return sfView::INPUT;
    58   }
    59 
    60   public function executeDeleteInfo($request)
    61   {
    62   }
    63 
    64   public function executeDelete($request)
    65   {
    66     $this->introEssay = IntroEssayPeer::getByFromAndTo($this->getUser()->GetMemberId(), $this->id);
    67     $this->delete();
    68     redirect("member/?id=" . $this->id);
    69   }
    70 
    71   public function executeList($request)
    72   {
    73     $this->redirectIf($this->relation->isAccessBlocked(), '@error');
    74 
    75     $this->pager = IntroEssayPeer::getListPager($this->id, $request->getParameter('page', 1));
    76 
    77     if (!$this->pager->getNbResults()) {
    78       return sfView::ERROR;
    79     }
    80 
    81     return sfView::SUCCESS;
    82   }
    8313}
  • OpenPNE3/plugins/opIntroEssayPlugin/trunk/apps/pc_frontend/modules/introessay/actions/actions.class.php

    r9668 r9686  
    99 * @version    SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $
    1010 */
    11 class introessayActions extends sfActions
     11class introessayActions extends opIntroEssayPluginIntroEssayActions
    1212{
    1313 /**
    14   * Executes index action
     14  * Executes show action
    1515  *
    1616  * @param sfRequest $request A request object
    1717  */
    18   public function executeIndex($request)
    19   {
    20     $this->id = $request->getParameter('id');
    21     $this->introEssay = IntroEssayPeer::getByFromAndTo($this->getUser()->GetMemberId(), $this->id);
    22     $this->form = new IntroEssayForm($this->introEssay);
    23     if ($request->isMethod('post'))
    24     {
    25       $array = $request->getParameter('intro_essay');
    26       if (!$this->introEssay)
    27       {
    28         $array['from_id'] = $this->getUser()->GetMemberId();
    29         $array['to_id'] = $this->id;
    30       }
    31       $this->form->bind($array);
    32       if ($this->form->isValid())
    33       {
    34         if ($this->introEssay)
    35         {
    36           $this->introEssay->setContent($array['content']);
    37           $this->introEssay->save();
    38         }
    39         else
    40         {
    41           $this->form->save();
    42         }
    43         return sfView::SUCCESS;
    44       }
    45     }
    46     return sfView::INPUT;
    47   }
    48 
    49   public function executeDeleteInfo($request)
    50   {
    51     $this->id = $request->getParameter('id');
    52   }
    53 
    54   public function executeDelete($request)
    55   {
    56     $this->id = $request->getParameter('id');
    57     $this->introEssay = IntroEssayPeer::getByFromAndTo($this->getUser()->GetMemberId(), $this->id);
    58     $this->delete();
    59     redirect("member/?id=" . $this->id);
    60   }
    61 
    6218  public function executeShow($request)
    6319  {
    64     $this->id = $request->getParameter('id');
    6520  }
    6621}
  • OpenPNE3/plugins/opIntroEssayPlugin/trunk/apps/pc_frontend/modules/introessay/templates/deleteSuccess.php

    r9649 r9686  
    1 <?php include_box( 'infobox', '紹介文を作成する', '削除しました') ?>
     1<?php
     2$html = '<form style="width: 48%; float: left; text-align: right" action="" method="post"><input type="hidden" name="delete" value="1" /><input type="submit" value="はい" /></form>'
     3      . '<form style="width: 48%; float: right; text-align: left" action="" method="post"><input type="submit" value="いいえ" /></form>'
     4      . '<div style="clear: left"></div>';
     5include_box( 'infobox', '本当に削除しますか?', $html);
     6
Note: See TracChangeset for help on using the changeset viewer.