示例#1
0
 public function adjustFlags(GWF_Group $group)
 {
     if (false === ($mod_forum = GWF_Module::getModule('Forum'))) {
         return false;
     }
     $mod_forum->onInclude();
     if (false === ($board = GWF_ForumBoard::getByID($group->getBoardID()))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     # Adjust Board and Thread Flags
     $gid = 0;
     $guestview = true;
     switch ($group->getVisibleMode()) {
         case GWF_Group::VISIBLE:
             //				$board->saveVar('board_gid', 0);
             //				$board->saveGuestView(true);
             //				$board->saveOption(GWF_ForumBoard::GUEST_VIEW, true);
             //				$this->adjustThreads($board, 0, true);
             //				return false;
             break;
         case GWF_Group::COMUNITY:
             //				$board->saveVar('board_gid', 0);
             //				$board->saveGuestView(false);
             //				$board->saveOption(GWF_ForumBoard::GUEST_VIEW, false);
             $guestview = false;
             break;
         case GWF_Group::HIDDEN:
         case GWF_Group::SCRIPT:
             //				$board->saveVar('board_gid', $group->getID());
             //				$board->saveGuestView(false);
             //				$board->saveOption(GWF_ForumBoard::GUEST_VIEW, false);
             $gid = $group->getID();
             $guestview = false;
             break;
         default:
             return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     $board->saveGroupID($gid);
     $board->saveGuestView($guestview);
 }
示例#2
0
文件: Edit.php 项目: sinfocol/gwf3
 private function getForm(GWF_Group $group)
 {
     $buttons = array('edit' => $this->module->lang('btn_edit'), 'delete' => $this->module->lang('btn_delete'));
     $data = array('name' => array(GWF_Form::STRING, $group->getVar('group_name'), $this->module->lang('th_name')), 'join' => array(GWF_Form::SELECT, $this->module->selectJoinType($group->getJoinMode()), $this->module->lang('th_join')), 'view' => array(GWF_Form::SELECT, $this->module->selectViewType($group->getVisibleMode()), $this->module->lang('th_view')), 'vis_grp' => array(GWF_Form::CHECKBOX, $group->isOptionEnabled(GWF_Group::VISIBLE_GROUP), $this->module->lang('th_vis_grp'), $this->module->lang('tt_vis_grp')), 'vis_mem' => array(GWF_Form::CHECKBOX, $group->isOptionEnabled(GWF_Group::VISIBLE_MEMBERS), $this->module->lang('th_vis_mem'), $this->module->lang('tt_vis_mem')), 'cmd' => array(GWF_Form::SUBMITS, $buttons));
     return new GWF_Form($this, $data);
 }