コード例 #1
0
ファイル: ForumController.php プロジェクト: noikiy/PD
 private function getForm()
 {
     $request = $this->getRequest();
     $id = $request->getQuery('id');
     if ($id) {
         $info = Model_Forum::get($id);
     }
     if ($request->getPost('status')) {
         $this->view->status = $request->getPost('status');
     } elseif (isset($info)) {
         $this->view->status = $info['status'];
     } else {
         $this->view->status = 'false';
     }
     if ($request->getPost('name')) {
         $this->view->name = $request->getPost('name');
     } elseif (isset($info)) {
         $this->view->name = $info['name'];
     } else {
         $this->view->name = '';
     }
     if ($request->getPost('order_index')) {
         $this->view->order_index = $request->getPost('order_index');
     } elseif (isset($info)) {
         $this->view->order_index = $info['order_index'];
     } else {
         $this->view->order_index = Model_Forum::getMaxPosition();
     }
     $this->view->comments = Model_Forum::getReported();
 }