예제 #1
0
파일: EditBoard.php 프로젝트: sinfocol/gwf3
 private function onEditBoard()
 {
     $form = $this->getForm();
     if (false !== ($error = $form->validate($this->module))) {
         return $error;
     }
     if (!$this->board->isRoot()) {
         $bid = $this->board->getID();
         if ($bid !== ($newpid = (int) $form->getVar('moveboard'))) {
             if ($this->board->getParentID() !== $newpid) {
                 if (false !== ($newparent = GWF_ForumBoard::getBoard($newpid))) {
                     if (false === $this->board->move($newparent)) {
                         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
                     }
                 }
             }
         }
     }
     $this->board->saveVars(array('board_gid' => $form->getVar('groupid'), 'board_title' => $form->getVar('title'), 'board_descr' => $form->getVar('descr')));
     # Options
     $this->board->saveOption(GWF_ForumBoard::ALLOW_THREADS, Common::getPost('allow_threads') !== false);
     $this->board->saveOption(GWF_ForumBoard::LOCKED, Common::getPost('is_locked') !== false);
     $this->board->saveOption(GWF_ForumBoard::GUEST_POSTS, Common::getPost('guests') !== false);
     $this->board->saveOption(GWF_ForumBoard::GUEST_VIEW, Common::getPost('guest_view') !== false);
     if (!$this->board->isRoot()) {
         $this->board->saveOption(GWF_ForumBoard::INVISIBLE, Common::getPost('invisible') !== false);
     }
     return $this->module->message('msg_edited_board', array($this->board->getShowBoardHREF()));
 }