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

source: OpenPNE3/plugins/opOpenSocialPlugin/trunk/apps/pc_backend/modules/application/actions/actions.class.php @ 9526

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

#3119:added pc_backend app and application module

File size: 2.0 KB
Line 
1<?php
2
3/**
4 * application actions.
5 *
6 * @package    OpenPNE
7 * @subpackage application
8 * @author     Shogo Kawahara<kawahara@tejimaya.net>
9 * @version    SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $
10 */
11class applicationActions extends sfActions
12{
13 /**
14  * Executes index action
15  *
16  * @param sfRequest $request A request object
17  */
18  public function executeIndex($request)
19  {
20    return sfView::SUCCESS;
21  }
22
23 /**
24  * Executes list action
25  *
26  * @param sfRequest $request A request object
27  */
28  public function executeList($request)
29  {
30    $criteria = new Criteria();
31    $criteria->addDescendingOrderByColumn(ApplicationPeer::ID);
32    $this->pager = new sfPropelPager('Application', 20);
33    $this->pager->setCriteria($criteria);
34    $this->pager->setPage($request->getParameter('page',1));
35    $this->pager->init();
36
37    $this->addform = new AddApplicationForm();
38    if (!$request->isMethod('post'))
39    {
40      return sfView::SUCCESS;
41    }
42
43    $this->addform->bind($request->getParameter('contact'));
44    if (!$this->addform->isValid())
45    {
46      return sfView::SUCCESS;
47    }
48
49    $contact = $this->addform->getValues();
50    try
51    {
52      $app = ApplicationPeer::addApplication($contact['application_url'], $this->getUser()->getCulture());     
53    }
54    catch (Exception $e)
55    {
56      //TODO : add error action
57      return sfView::SUCCESS;
58    }
59  }
60
61 /**
62  * Execute info action
63  *
64  * @param sfRequest $request A request object
65  */
66  public function executeInfo($request)
67  {
68    $application_id = $request->getParameter('id',false);
69    if (!$application_id)
70    {
71      return sfView::ERROR;
72    }
73
74    $application = ApplicationPeer::retrieveByPk($application_id);
75    if (!$application)
76    {
77      return sfView::ERROR;
78    }
79
80    $this->application = $application;
81    return sfView::SUCCESS;
82  }
83
84 /**
85  * Execute profileSetting action
86  *
87  * @param sfRequest $request A request object
88  */
89  public function executeProfileSetting($request)
90  {
91
92    return sfView::SUCCESS;
93  }
94}
Note: See TracBrowser for help on using the repository browser.