function __construct(\bbdkp\views\viewNavigation $Navigation) { //constructor is called from blockfactory and viewplanner //blockfactory passes viewnavigation object $this->game_id = $Navigation->getGameId(); $this->guild_id = $Navigation->getGuildId(); $this->dkpsys_id = $Navigation->getDkpsysId(); $events = new \bbdkp\controller\raidplanner\rpevents($this->dkpsys_id); $this->eventlist = $events->events; }
/** * Build the page * @param viewNavigation $Navigation */ public function buildpage(viewNavigation $Navigation) { global $template, $phpbb_root_path, $phpEx, $auth, $user; $user->add_lang(array('mods/raidplanner')); $this->game_id = $Navigation->getGameId(); $this->guild_id = $Navigation->getGuildId(); $this->dkpsys_id = $Navigation->getDkpsysId(); //get permissions if (!$auth->acl_get('u_raidplanner_view_raidplans')) { trigger_error('USER_CANNOT_VIEW_RAIDPLAN'); } $raidplan_id = request_var('hidden_raidplanid', request_var('raidplanid', 0)); $valid_viewsmodes = array('day', 'week', 'month', 'raidplan'); if (!in_array($this->view_mode, $valid_viewsmodes)) { trigger_error($user->lang['USER_INVALID_RAIDPLANVIEW'] . ' "' . $this->view_mode . '" '); } $action = request_var('action', 'display'); // display header $this->cal = new DisplayFrame($this, $this->view_mode); $this->cal->display(); switch ($this->view_mode) { case "raidplan": // display a raidplan $this->ViewRaidplan($raidplan_id, $action); break; case "day": case "week": case "month": // show the calendar $this->ViewCalendar(); break; default: trigger_error($user->lang['USER_INVALIDVIEW']); break; } $blocks = new \bbdkp\raidplanner\rpblocks($Navigation); $blocks->display(); // breadcrumbs $navlinks_array = array(array('DKPPAGE' => $user->lang['MENU_PLANNER'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", '&page=planner&guild_id=' . $Navigation->getGuildId()))); foreach ($navlinks_array as $name) { $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $name['DKPPAGE'], 'U_DKPPAGE' => $name['U_DKPPAGE'])); } // Output the page page_header($user->lang['PAGE_TITLE']); }