/** * display method of Stats view * @return void **/ function display($tpl = null) { /* Load Javascript and CSS files */ RaidPlannerHelper::loadJSFramework(); /* Get state, and params */ $app = JFactory::getApplication(); $params = $app->getParams(); $state = $this->get('state'); $guild_id = $params->get('guild_id', '0'); $groups = $params->get('allowed_groups'); $by_chars = $params->get('stats_by_chars', 0); $show_rating = $params->get('show_rating', 0); /* Get the values from the state object that were inserted in the model's construct function */ $lists['filter_start_time'] = $state->get('filter_start_time'); $lists['filter_end_time'] = $state->get('filter_end_time'); $lists['filter_character_id'] = $state->get('filter_character_id'); $lists['filter_group_id'] = $state->get('filter_group_id'); $this->assign('guilds', RaidPlannerHelper::getGuilds()); $this->assign('groups', RaidPlannerHelper::getGroups(true, $groups)); $this->assign('characters', RaidPlannerHelper::getCharacters()); $this->assignRef('lists', $lists); $this->assignRef('by_chars', $by_chars); $this->assignRef('show_rating', $show_rating); $this->assignRef('guild_id', $guild_id); parent::display($tpl); }
function display($tpl = null) { $model = $this->getModel(); if (!$model->userIsOfficer(JRequest::getVar('id'))) { $app = JFactory::getApplication(); $app->redirect(JRoute::_('index.php?option=com_raidplanner&task=default&month=' . JRequest::getVar('month') . '&modalevent=' . JRequest::getVar('id'))); } else { $template_id = JRequest::getVar('template_id'); if (intval($template_id) > 0) { $event = $model->getEvent($template_id, true); } else { $event = $model->getEvent(JRequest::getVar('id')); } $this->assign('icons', $this->getIcons()); $this->assign('guilds', RaidPlannerHelper::getGuilds()); $this->assign('groups', RaidPlannerHelper::getGroups(false)); $this->assignRef('event', $event); $this->assign('templates', $model->getTemplates()); $this->assign('candelete', $model->canDelete($event->raid_id)); parent::display($tpl); /* display the event in detail */ $vName = 'event'; $mName = 'event'; $document = JFactory::getDocument(); $vType = $document->getType(); $vLayout = 'preview'; $controller = new RaidPlannerController(); $view = $controller->getView($vName, $vType); $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . '/views/' . strtolower($vName) . '/tmpl'); // Get/Create the model if ($model = $this->getModel($mName)) { // Push the model into the view (as default) $view->setModel($model, true); } // add event model to calendar view if ($vName == 'calendar') { $eventmodel = $this->getModel('event'); $view->setModel($eventmodel, false); } // Set the layout $view->setLayout($vLayout); // Display the view $view->display(); } }
/** * display method of Stats view * @return void **/ function display($tpl = null) { /* Load Javascript and CSS files */ RaidPlannerHelper::loadJSFramework(); JHTML::stylesheet('com_raidplanner/raidplanner_admin.css', false, true, false); //get the data JToolBarHelper::title(JText::_('COM_RAIDPLANNER_STATS')); RaidPlannerHelper::showToolbarButtons(); /* Call the state object */ $state = $this->get('state'); /* Get the values from the state object that were inserted in the model's construct function */ $lists['filter_start_time'] = $state->get('filter_start_time'); $lists['filter_end_time'] = $state->get('filter_end_time'); $lists['filter_character_id'] = $state->get('filter_character_id'); $lists['filter_group_id'] = $state->get('filter_group_id'); $this->assign('guilds', RaidPlannerHelper::getGuilds()); $this->assign('groups', RaidPlannerHelper::getGroups()); $this->assign('characters', RaidPlannerHelper::getCharacters()); $this->assignRef('lists', $lists); parent::display($tpl); }
/** * display method of Hello view * @return void **/ function display($tpl = null) { //get the raid $raid = $this->get('Data'); $isNew = $raid->raid_id < 1; $text = $isNew ? JText::_('JTOOLBAR_NEW') : JText::_('JTOOLBAR_EDIT'); JToolBarHelper::title(JText::_('COM_RAIDPLANNER_RAID') . ': ' . $text . ''); JToolBarHelper::apply(); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'JTOOLBAR_CLOSE'); } $this->assignRef('users', RaidPlannerHelper::getUsers()); $this->assignRef('guilds', RaidPlannerHelper::getGuilds()); $this->assignRef('groups', RaidPlannerHelper::getGroups()); $this->assignRef('icons', $this->getIcons()); $this->assignRef('raid', $raid); parent::display($tpl); }