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

source: OpenPNE3/plugins/opCommunityTopicPlugin/tags/opCommunityTopicPlugin-0.9.7/apps/pc_backend/modules/communityTopic/actions/actions.class.php @ 13677

Last change on this file since 13677 was 13677, checked in by ShogoKawahara, 12 years ago

reverted error commit

File size: 6.5 KB
Line 
1<?php
2
3/**
4 * This file is part of the OpenPNE package.
5 * (c) OpenPNE Project (http://www.openpne.jp/)
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file and the NOTICE file that were distributed with this source code.
9 */
10
11/**
12 * community topic/event actions.
13 *
14 * @package    OpenPNE
15 * @subpackage communityTopic
16 * @author     Yoichiro SAKURAI <saku2saku@gmail.com>
17 */
18class communityTopicActions extends sfActions
19{
20  /**
21   * Executes index action
22   *
23   * @param sfWebRequest $request A request object
24   */
25  public function executeIndex(sfWebRequest $request)
26  {
27    $this->forward('communityTopic', 'topicList');
28  }
29
30  /**
31   * Executes topicList action
32   *
33   * @param sfWebRequest $request A request object
34   */
35  public function executeTopicList(sfWebRequest $request)
36  {
37    $this->form = new CommunityTopicSearchForm();
38    $this->form->bind($request->getParameter('communityTopic'), array());
39
40    $this->pager = new sfDoctrinePager('CommunityTopic', 20);
41    if ($request->hasParameter('communityTopic'))
42    {
43      $this->pager->setQuery($this->form->getQuery());
44    }
45    $this->pager->setPage($request->getParameter('page', 1));
46    $this->pager->init();
47    return sfView::SUCCESS;
48  }
49
50  /**
51   * Executes topicDelete action
52   *
53   * @param sfWebRequest $request A request object
54   */
55  public function executeTopicDelete(sfWebRequest $request)
56  {
57    $this->topic = Doctrine::getTable('CommunityTopic')->find($request->getParameter('id'));
58    $this->forward404Unless($this->topic);
59
60    if ($request->isMethod(sfRequest::POST))
61    {
62      $this->topic->delete();
63      $this->getUser()->setFlash('notice', 'Topic Deleted successfully.');
64      $this->redirect('communityTopic/topicList');
65    }
66    return sfView::SUCCESS;
67  }
68
69  /**
70   * Executes topicCommentList action
71   *
72   * @param sfWebRequest $request A request object
73   */
74  public function executeTopicCommentList(sfWebRequest $request)
75  {
76    $this->form = new CommunityTopicCommentSearchForm();
77    $this->form->bind($request->getParameter('communityTopicComment'), array());
78
79    $this->pager = new sfDoctrinePager('CommunityTopicComment', 20);
80    if ($request->hasParameter('communityTopicComment'))
81    {
82      $this->pager->setQuery($this->form->getQuery());
83    }
84    $this->pager->setPage($request->getParameter('page', 1));
85    $this->pager->init();
86    return sfView::SUCCESS;
87  }
88
89  /**
90   * Executes topicCommentDelete action
91   *
92   * @param sfWebRequest $request A request object
93   */
94  public function executeTopicCommentDelete(sfWebRequest $request)
95  {
96    $this->topicComment = Doctrine::getTable('CommunityTopicComment')->find($request->getParameter('id'));
97    $this->forward404Unless($this->topicComment);
98
99    if ($request->isMethod(sfRequest::POST))
100    {
101      $this->topicComment->delete();
102      $this->getUser()->setFlash('notice', 'Topic Comment Deleted successfully.');
103      $this->redirect('communityTopic/topicCommentList');
104    }
105    return sfView::SUCCESS;
106  }
107
108  /**
109   * Executes eventList action
110   *
111   * @param sfWebRequest $request A request object
112   */
113  public function executeEventList(sfWebRequest $request)
114  {
115    $this->form = new CommunityEventSearchForm();
116    $this->form->bind($request->getParameter('communityEvent'), array());
117
118    $this->pager = new sfDoctrinePager('CommunityEvent', 20);
119    if ($request->hasParameter('communityEvent'))
120    {
121      $this->pager->setQuery($this->form->getQuery());
122    }
123    $this->pager->setPage($request->getParameter('page', 1));
124    $this->pager->init();
125    return sfView::SUCCESS;
126  }
127
128  /**
129   * Executes eventDelete action
130   *
131   * @param sfWebRequest $request A request object
132   */
133  public function executeEventDelete(sfWebRequest $request)
134  {
135    $this->event = Doctrine::getTable('CommunityEvent')->find($request->getParameter('id'));
136    $this->forward404Unless($this->event);
137
138    if ($request->isMethod(sfRequest::POST))
139    {
140      $this->event->delete();
141      $this->getUser()->setFlash('notice', 'Event Deleted successfully.');
142      $this->redirect('communityTopic/eventList');
143    }
144    return sfView::SUCCESS;
145  }
146
147  /**
148   * Executes eventCommentList action
149   *
150   * @param sfWebRequest $request A request object
151   */
152  public function executeEventMemberList(sfWebRequest $request)
153  {
154    $this->form = new CommunityEventMemberSearchForm();
155    $this->form->bind($request->getParameter('communityEventMember'), array());
156
157    $this->pager = new sfDoctrinePager('CommunityEventMember', 20);
158    if ($request->hasParameter('communityEventMember'))
159    {
160      $this->pager->setQuery($this->form->getQuery());
161    }
162    $this->pager->setPage($request->getParameter('page', 1));
163    $this->pager->init();
164    return sfView::SUCCESS;
165  }
166
167  /**
168   * Executes eventMemberDelete action
169   *
170   * @param sfWebRequest $request A request object
171   */
172  public function executeEventMemberDelete(sfWebRequest $request)
173  {
174    $this->eventMember = Doctrine::getTable('CommunityEventMember')->find($request->getParameter('id'));
175    $this->forward404Unless($this->eventMember);
176
177    if ($request->isMethod(sfRequest::POST))
178    {
179      $this->eventMember->delete();
180      $this->getUser()->setFlash('notice', 'Event Member Deleted successfully.');
181      $this->redirect('communityTopic/eventMemberList');
182    }
183    return sfView::SUCCESS;
184  }
185
186  /**
187   * Executes eventCommentList action
188   *
189   * @param sfWebRequest $request A request object
190   */
191  public function executeEventCommentList(sfWebRequest $request)
192  {
193    $this->form = new CommunityEventCommentSearchForm();
194    $this->form->bind($request->getParameter('communityEventComment'), array());
195
196    $this->pager = new sfDoctrinePager('CommunityEventComment', 20);
197    if ($request->hasParameter('communityEventComment'))
198    {
199      $this->pager->setQuery($this->form->getQuery());
200    }
201    $this->pager->setPage($request->getParameter('page', 1));
202    $this->pager->init();
203    return sfView::SUCCESS;
204  }
205
206  /**
207   * Executes eventCommentDelete action
208   *
209   * @param sfWebRequest $request A request object
210   */
211  public function executeEventCommentDelete(sfWebRequest $request)
212  {
213    $this->eventComment = Doctrine::getTable('CommunityEventComment')->find($request->getParameter('id'));
214    $this->forward404Unless($this->eventComment);
215
216    if ($request->isMethod(sfRequest::POST))
217    {
218      $this->eventComment->delete();
219      $this->getUser()->setFlash('notice', 'Event Comment Deleted successfully.');
220      $this->redirect('communityTopic/eventCommentList');
221    }
222    return sfView::SUCCESS;
223  }
224}
Note: See TracBrowser for help on using the repository browser.