private function getForm() { $buttons = array('edit_board' => $this->module->lang('btn_edit_board'), 'delete_board' => $this->module->lang('btn_rem_board')); $data = array('groupid' => array(GWF_Form::SELECT, $this->module->getGroupSelect($this->board->getGroupID()), $this->module->lang('th_groupid')), 'title' => array(GWF_Form::STRING, $this->board->display('board_title'), $this->module->lang('th_title')), 'descr' => array(GWF_Form::STRING, $this->board->display('board_descr'), $this->module->lang('th_descr')), 'allow_threads' => array(GWF_Form::CHECKBOX, $this->board->isThreadAllowed(), $this->module->lang('th_thread_allowed')), 'guest_view' => array(GWF_Form::CHECKBOX, $this->board->isGuestView(), $this->module->lang('th_guest_view')), 'is_locked' => array(GWF_Form::CHECKBOX, $this->board->isLocked(), $this->module->lang('th_locked')), 'guests' => array(GWF_Form::CHECKBOX, $this->board->isGuestPostAllowed(), $this->module->lang('th_guests')), 'invisible' => array(GWF_Form::CHECKBOX, $this->board->isInvisible(), $this->module->lang('th_invisible'))); // if (!$this->board->isRoot()) { // $data['moveboard'] = array(GWF_Form::SELECT, $this->board->getBoardSelect(), $this->module->lang('th_move_board'), 0, 'GWF_ForumBoard'); // } $data['submit'] = array(GWF_Form::SUBMITS, $buttons, ''); return new GWF_Form($this, $data); }
private static function singleB(GWF_ForumBoard $board, &$back, $level, $selected) { $rep = '+' . str_repeat('=', $level * 2); $back .= sprintf('<option value="%s"%s>%s</option>', $board->getID(), GWF_HTML::selected($selected === $board->getID()), $rep . $board->display('board_title')); $childs = $board->getChilds(); if (count($childs) > 0) { foreach ($childs as $child) { self::singleB($child, $back, $level + 1, $selected); } } }
private function onMove(GWF_ForumThread $t, GWF_ForumBoard $b) { // if (false === ($b->isThreadAllowed())) { // $_POST['move'] = $t->getBoardID(); // return $this->module->error('err_no_thread_allowed'); // } $pc = $t->getPostCount(); if (false === $t->getBoard()->adjustCounters(-1, -$pc)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } if (false === $b->adjustCounters(1, $pc)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } if (false === $t->saveVars(array('thread_bid' => $b->getID(), 'thread_gid' => $b->getGroupID()))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } if (false === $t->saveVar('thread_bid', $b->getID())) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } return $this->module->message('msg_thread_moved', array($t->display('thread_title'), $b->display('board_title'))); }