コード例 #1
0
ファイル: Do.php プロジェクト: sdkawata/tutorial
 /**
  *  board_do action implementation.
  *
  *  @access public
  *  @return string  forward name.
  */
 public function perform()
 {
     if (!$this->session->isStart()) {
         $this->ae->addObject('boardError', Ethna::raiseNotice("you need to login to post", E_SAMPLE_AUTH));
         return 'board';
     }
     $bm = new BoardManager();
     $color = $this->af->get('color');
     if ($color === NULL) {
         $color = '#000000';
     }
     $fileid = $this->af->get('uploaded-fileid');
     $content = $this->af->get('content');
     //$content='hage';
     $res = $bm->post($this->backend, $this->session->get('username'), $content, $color, $fileid);
     if (Ethna::isError($res)) {
         $this->ae->addObject('PostError', $res);
     } else {
         $this->redirect('board');
     }
     return 'board';
 }