/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $params = $mainframe->getParams(); $ordering = $params->def('subround_order', 0); $ordering = $ordering ? 'DESC' : 'ASC'; $projectround_id = JRequest::getVar('id', 0, '', 'int'); $model = $this->getModel(); $subroundresults = $model->getSubrounds($projectround_id, 0, $ordering); $round = $model->getRound($projectround_id); $project = $model->getRoundProject($projectround_id); $projectparams = $model->getParams($project->id); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($round->name, TrackslibHelperRoute::getRoundResultRoute($projectround_id)); $document = JFactory::getDocument(); $document->setTitle($round->name . ' - ' . $project->name); //print_r($subroundresults);exit; // $this->assignRef('points_attrib', $points_attrib); $this->assignRef('results', $subroundresults); $this->assignRef('round', $round); $this->assignRef('project', $project); $this->assignRef('projectparams', $projectparams); $this->assignRef('params', $params); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $model = $this->getModel(); $projects = $model->getProjects(); $this->assignRef('projects', $projects); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $model = $this->getModel(); $rows = $model->getData(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_TRACKS_All_Teams')); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem(JText::_('COM_TRACKS_All_Teams'), TrackslibHelperRoute::getTeamsRoute()); $this->assignRef('rows', $rows); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $projectId = JFactory::getApplication()->input->getInt('p', 0); $model = $this->getModel(); $results = $model->getResults($projectId); $project = $model->getProject($projectId); $params = $model->getParams(); $document = JFactory::getDocument(); $document->setTitle($project->name); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($project->name, TrackslibHelperRoute::getProjectRoute($project->id)); $this->assignRef('results', $results); $this->assignRef('project', $project); $this->assignRef('params', $params); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $project_id = $mainframe->input->getInt('p', 0); $params = $mainframe->getParams(); $model = $this->getModel(); $individuals = $model->getIndividuals($project_id); $project = $model->getProject($project_id); $projectparams = $model->getParams($project_id); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($project->name . ' ' . JText::_('COM_TRACKS_Participants'), TrackslibHelperRoute::getParticipantsRoute($project_id)); $document = JFactory::getDocument(); $document->setTitle($project->name . ' ' . JText::_('COM_TRACKS_Participants')); $this->assignRef('params', $params); $this->assignRef('project', $project); $this->assignRef('projectparams', $projectparams); $this->assignRef('individuals', $individuals); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $params = $mainframe->getParams(); $round_id = $mainframe->input->getInt('id', 0); $model = $this->getModel(); $round = $model->getRound($round_id); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($round->name, 'index.php?view=round&r=' . $round_id); $document = JFactory::getDocument(); $document->setTitle($round->name); // parse description with content plugins $round->description = JHTML::_('content.prepare', $round->description); $picture = TrackslibHelperImage::modalimage($round->picture, $round->name, 150); $this->assignRef('round', $round); $this->assignRef('params', $params); $this->assignRef('picture', $picture); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $project_id = $mainframe->input->getInt('p', 0); $model = $this->getModel(); $rankings = $model->getRankings($project_id); $project = $model->getProject($project_id); $params = $model->getParams($project_id); $viewparams = $mainframe->getParams('com_tracks'); $params->merge($viewparams); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($project->name . ' ' . JText::_('COM_TRACKS_Rankings'), TrackslibHelperRoute::getRankingRoute($project_id)); $document = JFactory::getDocument(); $document->setTitle($project->name . ' ' . JText::_('COM_TRACKS_Rankings')); $this->assignRef('params', $params); $this->assignRef('project', $project); $this->assignRef('rankings', $rankings); parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { RHelperAsset::load('tracks.css'); $mainframe = JFactory::getApplication(); $project_id = $mainframe->input->getInt('p', 0); $data = $this->get('data'); $rounds = $this->get('rounds'); $project = $this->get('project'); $params = $this->get('Params'); $params->merge(JComponentHelper::getParams('com_tracks')); $title = JText::sprintf('COM_TRACKS_view_project_results', $project->name); $breadcrumbs = $mainframe->getPathWay(); $breadcrumbs->addItem($title, TrackslibHelperRoute::getProjectResultRoute($project_id)); $document = JFactory::getDocument(); $document->setTitle($title); $this->assignRef('params', $params); $this->assignRef('project', $project); $this->assignRef('rows', $data); $this->assignRef('rounds', $rounds); $this->assign('title', $title); parent::display($tpl); }
protected function displayForm($tpl) { RHelperAsset::load('tracks.css'); $user = JFactory::getUser(); $model = $this->getModel(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->user = $user; $this->canEdit = $user->get('id') && ($user->authorise('core.manage', 'com_tracks') || $user->get('id') == $this->item->admin_id); if (!$user->id || !$this->canEdit) { JFactory::getApplication()->redirect('index.php', 'not allowed !'); } $attribs['class'] = "pic"; if ($this->item->picture) { $this->item->picture = JHTML::image(JURI::root() . $this->item->picture, $this->item->name, $attribs); } else { $this->item->picture = JHTML::image(JURI::root() . 'media/com_tracks/images/misc/tnnophoto.jpg', $this->item->name, $attribs); } if ($this->item->picture_small) { $this->item->picture_small = JHTML::image(JURI::root() . $this->item->picture_small, $this->item->name, $attribs); } else { $this->item->picture_small = JHTML::image(JURI::root() . 'media/com_tracks/images/misc/tnnophoto.jpg', $this->item->name, $attribs); } if ($this->item->vehicle_picture) { $this->item->vehicle_picture = JHTML::image(JURI::root() . $this->item->vehicle_picture, $this->item->vehicle_picture, $attribs); } else { $this->item->vehicle_picture = JHTML::image(JURI::root() . 'media/com_tracks/images/misc/tnnophoto.jpg', '', $attribs); } $this->title = $this->item->id ? JText::_('COM_TRACKS_PAGETITLE_EDIT_TEAM') : JText::_('COM_TRACKS_PAGETITLE_CREATE_TEAM'); // Display the template parent::display($tpl); }
protected function displayForm($tpl) { $user = JFactory::getUser(); $model = $this->getModel(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->user = $user; $this->userIndividual = $this->get('UserIndividual'); $this->canEdit = $model->canEdit($this->item); if (!$user->id || !$this->canEdit) { JFactory::getApplication()->redirect('index.php', 'not allowed !'); } $attribs['class'] = "pic"; if ($this->item->picture != '') { $this->item->picture = JHTML::image(JURI::root() . $this->item->picture, $this->item->first_name . ' ' . $this->item->last_name, $attribs); } else { $this->item->picture = JHTML::image(JURI::root() . 'media/com_tracks/images/misc/tnnophoto.jpg', $this->item->first_name . ' ' . $this->item->last_name, $attribs); } if ($this->item->picture_small != '') { $this->item->picture_small = JHTML::image(JURI::root() . $this->item->picture_small, $this->item->first_name . ' ' . $this->item->last_name, $attribs); } else { $this->item->picture_small = JHTML::image(JURI::root() . 'media/com_tracks/images/misc/tnnophoto.jpg', $this->item->first_name . ' ' . $this->item->last_name, $attribs); } $this->title = $this->item->id ? JText::_('COM_TRACKS_PAGETITLE_EDIT_INDIVIDUAL') : JText::_('COM_TRACKS_PAGETITLE_CREATE_INDIVIDUAL'); // Display the template parent::display($tpl); }