Ejemplo n.º 1
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $project = $model->getProject();
     //no treeko !!!
     $config = $model->getTemplateConfig('tree');
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->node = $model->getTreetonode();
     $this->roundname = $model->getRoundName();
     $this->model = $model;
     // Set page title
     ///TODO: treeto name, no project name
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TREETO_PAGE_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig("player");
     // Get the type of persondata to be shown from the query string
     // pt==1 ==> as player // pt==2 ==> as staffmember  // pt==3 ==> as referee // pt==4 ==> as club-staffmember
     $showType = JRequest::getVar('pt', '1', 'default', 'int');
     if ($showType > 3) {
         $showType = 1;
     }
     $person = $model->getPerson();
     $this->showType = $showType;
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     //$extended = $this->getExtended($person->extended, 'person');
     //$this->extended = $extended;
     switch ($showType) {
         case '4':
             $titleStr = 'About %1$s %2$s as a Club staff';
             $this->historyClubStaff = $model->getPersonHistory('ASC');
             break;
         case '3':
             $titleStr = 'About %1$s %2$s as a Referee';
             $this->inprojectinfo = $model->getReferee();
             $this->historyReferee = $model->getRefereeHistory('ASC');
             break;
         case '2':
             $titleStr = 'About %1$s %2$s as a Staff member';
             $this->inprojectinfo = $model->getTeamStaff();
             $this->historyStaff = $model->getStaffHistory('ASC');
             break;
         case '1':
             $titleStr = 'About %1$s %2$s as a Player';
             $this->inprojectinfo = $model->getTeamPlayer();
             $this->historyPlayer = $model->getPlayerHistory('ASC');
             //$this->historyStaff = $model->getStaffHistory('ASC');
             $this->AllEvents = $model->getAllEvents();
             break;
         default:
             break;
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::sprintf($titleStr, $this->person->firstname, $this->person->lastname));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 public function display($tpl = null)
 {
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->teams = $model->getTeams();
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMS_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 4
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     if (!$config) {
         $config = $model->getTemplateConfig('players');
     }
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->rows = $model->getReferees();
     //		$this->positioneventtypes = $model->getPositionEventTypes( ) );
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_REFEREES_PAGE_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 5
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $eventsconfig = $model->getTemplateConfig("eventsranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $this->project = $model->getProject();
     if (isset($this->project)) {
         $highest_home = $model->getHighestHome();
         $highest_away = $model->getHighestAway();
         $this->division = $model->getDivision();
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->tableconfig = $tableconfig;
         $this->eventsconfig = $eventsconfig;
         $this->actualround = $model->getCurrentRoundNumber();
         $this->highest_home = $highest_home;
         $this->highest_away = $highest_away;
         $this->totals = $model->getSeasonTotals();
         $this->totalrounds = $model->getTotalRounds();
         $this->attendanceranking = $model->getAttendanceRanking();
         $this->bestavg = $model->getBestAvg();
         $this->bestavgteam = $model->getBestAvgTeam();
         $this->worstavg = $model->getWorstAvg();
         $this->worstavgteam = $model->getWorstAvgTeam();
         //hightest home
         $hhHomeTeaminfo = $model->getTeaminfo($highest_home->project_hometeam_id);
         $this->hhHomeTeaminfo = $hhHomeTeaminfo;
         $hhAwayTeaminfo = $model->getTeaminfo($highest_home->project_awayteam_id);
         $this->hhAwayTeaminfo = $hhAwayTeaminfo;
         //highest_away
         $haHomeTeaminfo = $model->getTeaminfo($highest_away->project_hometeam_id);
         $this->haHomeTeaminfo = $haHomeTeaminfo;
         $haAwayTeaminfo = $model->getTeaminfo($highest_away->project_awayteam_id);
         $this->haAwayTeaminfo = $haAwayTeaminfo;
         $limit = 3;
         $this->limit = $limit;
         $this->_setChartdata(array_merge($flashconfig, $config));
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_STATS_PAGE_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 6
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $eventsconfig = $model->getTemplateConfig("eventsranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $this->project = $model->getProject();
     if (isset($this->project)) {
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->tableconfig = $tableconfig;
         $this->eventsconfig = $eventsconfig;
         $this->actualround = $model->getCurrentRound();
         $this->team = $model->getTeam();
         $this->highest_home = $model->getHighestHome();
         $this->highest_away = $model->getHighestAway();
         $this->highestdef_home = $model->getHighestDefHome();
         $this->highestdef_away = $model->getHighestDefAway();
         $this->totalshome = $model->getSeasonTotalsHome();
         $this->totalsaway = $model->getSeasonTotalsAway();
         $this->matchdaytotals = $model->getMatchDayTotals();
         $this->totalrounds = $model->getTotalRounds();
         $this->totalattendance = $model->getTotalAttendance();
         $this->bestattendance = $model->getBestAttendance();
         $this->worstattendance = $model->getWorstAttendance();
         $this->averageattendance = $model->getAverageAttendance();
         $this->chart_url = $model->getChartURL();
         $this->nogoals_against = $model->getNoGoalsAgainst();
         $this->logo = $model->getLogo();
         $this->results = $model->getResults();
         $this->_setChartdata(array_merge($flashconfig, $config));
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMSTATS_PAGE_TITLE'));
     if (!empty($this->team)) {
         $titleInfo->team1Name = $this->team->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     // @todo check! (undefined function)
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 7
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     // read the config-data from template file
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->matchid = $model->matchid;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->teamid = $model->getTeamId();
     $this->teams = $model->getTeamsIndexedById();
     $this->favteams = $model->getFavTeams();
     $this->eventtypes = $model->getEventTypes();
     $this->limit = $model->getLimit();
     $this->limitstart = $model->getLimitStart();
     $this->pagination = $this->get('Pagination');
     $this->eventranking = $model->getEventRankings($this->limit);
     // @todo: check!
     $this->multiple_events = count($this->eventtypes) > 1;
     $prefix = JText::_('COM_JOOMLEAGUE_EVENTSRANKING_PAGE_TITLE');
     if ($this->multiple_events) {
         $prefix .= " - " . JText::_('COM_JOOMLEAGUE_EVENTSRANKING_TITLE');
     } else {
         // Next query will result in an array with exactly 1 statistic id
         $evid = array_keys($this->eventtypes);
         // @todo check! // 23-07-2015
         // Added if statement as it can happen that no eventtype was selected
         if ($evid) {
             // Selected one valid eventtype, so show its name
             $prefix .= " - " . JText::_($this->eventtypes[$evid[0]]->name);
         }
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo($prefix);
     if (!empty($this->teamid) && array_key_exists($this->teamid, $this->teams)) {
         $titleInfo->team1Name = $this->teams[$this->teamid]->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 8
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     // read the config-data from template file
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->teamid = $model->getTeamId();
     $teams = $model->getTeamsIndexedById();
     if ($this->teamid != 0) {
         foreach ($teams as $k => $v) {
             if ($k != $this->teamid) {
                 unset($teams[$k]);
             }
         }
     }
     $this->teams = $teams;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->favteams = $model->getFavTeams();
     $this->stats = $model->getProjectUniqueStats();
     $this->playersstats = $model->getPlayersStats();
     $this->limit = $model->getLimit();
     $this->limitstart = $model->getLimitStart();
     $this->multiple_stats = count($this->stats) > 1;
     $prefix = JText::_('COM_JOOMLEAGUE_STATSRANKING_PAGE_TITLE');
     if ($this->multiple_stats) {
         $prefix .= " - " . JText::_('COM_JOOMLEAGUE_STATSRANKING_TITLE');
     } else {
         if ($this->stats) {
             // Next query will result in an array with exactly 1 statistic id
             $sid = array_keys($this->stats);
             // Take the first result then.
             $prefix .= " - " . $this->stats[$sid[0]]->name;
         }
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo($prefix);
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 9
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $club = $model->getClub();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $overallconfig = $model->getOverallConfig();
     $teams = $model->getTeamsByClubId();
     $stadiums = $model->getStadiums();
     $playgrounds = $model->getPlaygrounds();
     $isEditor = $model->hasEditPermission('club.edit');
     $address_string = $model->getAddressString();
     $map_config = $model->getMapConfig();
     $this->project = $project;
     $this->overallconfig = $overallconfig;
     $this->config = $config;
     /* $this->showclubconfig = $showclubconfig; */
     $this->club = $club;
     // Do we have a club?
     if ($club) {
         $extended = $this->getExtended($club->extended, 'club');
         $this->extended = $extended;
     } else {
         $this->extended = false;
     }
     $this->teams = $teams;
     $this->stadiums = $stadiums;
     $this->playgrounds = $playgrounds;
     $this->showediticon = $isEditor;
     $this->address_string = $address_string;
     $this->mapconfig = $map_config;
     // Loads the project-template -settings for the GoogleMap
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_CLUBINFO_PAGE_TITLE'));
     if (!empty($this->club)) {
         $titleInfo->clubName = $this->club->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 10
0
 /**
  * @todo fix! // 24-07-2015
  * If a club is not attached to a project it will give problems
  */
 public function display($tpl = null)
 {
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $this->project = $project;
     $isEditor = $model->hasEditPermission('projectteam.edit');
     if (isset($this->project->id)) {
         $overallconfig = $model->getOverallConfig();
         $this->overallconfig = $overallconfig;
         $this->config = $config;
         $team = $model->getTeamByProject();
         $this->team = $team;
         $club = $model->getClub();
         $this->club = $club;
         $seasons = $model->getSeasons($config);
         $this->seasons = $seasons;
         $this->showediticon = $isEditor;
         $trainingData = $model->getTrainigData($this->project->id);
         $this->trainingData = $trainingData;
         $daysOfWeek = array(1 => JText::_('COM_JOOMLEAGUE_GLOBAL_MONDAY'), 2 => JText::_('COM_JOOMLEAGUE_GLOBAL_TUESDAY'), 3 => JText::_('COM_JOOMLEAGUE_GLOBAL_WEDNESDAY'), 4 => JText::_('COM_JOOMLEAGUE_GLOBAL_THURSDAY'), 5 => JText::_('COM_JOOMLEAGUE_GLOBAL_FRIDAY'), 6 => JText::_('COM_JOOMLEAGUE_GLOBAL_SATURDAY'), 7 => JText::_('COM_JOOMLEAGUE_GLOBAL_SUNDAY'));
         $this->daysOfWeek = $daysOfWeek;
         if ($team) {
             $extended = $this->getExtended($team->teamextended, 'team');
             $this->extended = $extended;
         } else {
             $this->extended = false;
         }
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMINFO_PAGE_TITLE'));
     if (!empty($this->team)) {
         $titleInfo->team1Name = $this->team->tname;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 11
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     // Set page title
     $document->setTitle(JText::_('COM_JOOMLEAGUE_PLAYGROUND_TITLE'));
     $model = $this->getModel();
     $address_string = $model->getAddressString();
     $map_config = $model->getMapConfig();
     $config = $model->getTemplateConfig($this->getName());
     $games = $model->getNextGames(0, $config['show_referee']);
     $gamesteams = $model->getTeamsFromMatches($games);
     $playground = $model->getPlayground();
     $teams = $model->getTeams();
     $project = $model->getProject();
     $overallconfig = $model->getOverallConfig();
     $this->project = $project;
     $this->overallconfig = $overallconfig;
     $this->config = $config;
     $this->playground = $playground;
     $this->teams = $teams;
     $this->games = $games;
     $this->gamesteams = $gamesteams;
     $this->address_string = $address_string;
     $this->mapconfig = $map_config;
     // Loads the project-template -settings for the GoogleMap
     $extended = $this->getExtended($this->playground->extended, 'playground');
     $this->extended = $extended;
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_PLAYGROUND_PAGE_TITLE'));
     if (!empty($this->playground->name)) {
         $titleInfo->playgroundName = $this->playground->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     $document->addCustomTag('<meta property="og:title" content="' . $this->playground->name . '"/>');
     $document->addCustomTag('<meta property="og:street-address" content="' . $this->address_string . '"/>');
     parent::display($tpl);
 }
Ejemplo n.º 12
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $project = $model->getProject();
     $current_round = $project->current_round;
     $personid = $model->personid;
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $staff = $model->getTeamStaffByRound($current_round, $personid);
     $this->teamStaff = $staff;
     $this->history = $model->getStaffHistory('ASC');
     $this->stats = $model->getStats($current_round, $personid);
     $this->staffstats = $model->getStaffStats($current_round, $personid);
     $this->historystats = $model->getHistoryStaffStats($current_round, $personid);
     $this->showediticon = $model->getAllowed($config['edit_own_player']);
     $extended = $this->getExtended($person->extended, 'staff');
     $this->extended = $extended;
     if (isset($person)) {
         $name = JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]);
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_STAFF_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 13
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $project = $model->getProject();
     $config = $model->getTemplateConfig($this->getName());
     $mdlRoster = JModelLegacy::getInstance("Roster", "JoomleagueModel");
     if (isset($project)) {
         $this->project = $project;
         $rounds = $model->getRounds($config['plan_order']);
         $this->overallconfig = $model->getOverallConfig();
         $this->config = array_merge($this->overallconfig, $config);
         $this->rounds = $rounds;
         $this->teams = $model->getTeamsIndexedByPtid();
         // @todo fix!
         /* $this->match = $match; */
         $this->favteams = $model->getFavTeams();
         $this->division = $model->getDivision();
         $this->ptid = $model->getProjectTeamId();
         $this->projectteam = $mdlRoster->getProjectTeam();
         $this->projectevents = $model->getProjectEvents();
         $this->matches = $model->getMatches($config);
         $this->matches_refering = $model->getMatchesRefering($config);
         $this->matchesperround = $model->getMatchesPerRound($config, $rounds);
         $this->model = $model;
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMPLAN_PAGE_TITLE'));
     $titleInfo->team1Name = !empty($this->ptid) ? $this->teams[$this->ptid]->name : JText::_("COM_JOOMLEAGUE_TEAMPLAN_ALL_TEAMS");
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 14
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $isEditor = $model->hasEditPermission('projectreferee.edit');
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $this->showediticon = $isEditor;
     $ref = $model->getReferee();
     $this->referee = $ref;
     $this->history = $model->getHistory('ASC');
     if ($config['show_gameshistory']) {
         $this->games = $model->getGames();
         $this->teams = $model->getTeamsIndexedByPtid();
     }
     if ($person) {
         $extended = $this->getExtended($person->extended, 'referee');
         $this->extended = $extended;
     }
     $name = !empty($person) ? JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]) : "";
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_REFEREE_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 15
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $this->model = $model;
     $this->project = $project;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->divisionid = $model->getDivisionID();
     $this->roundid = $model->getRoundID();
     $this->division = $model->getDivision();
     $this->round = $model->getRound();
     $this->teams = $model->getTeamsIndexedByPtid($model->getDivisionID());
     $this->results = $model->getMatrixResults($model->projectid);
     if ($project->project_type == 'DIVISIONS_LEAGUE' && !$this->divisionid) {
         $divisions = $model->getDivisions();
         $this->divisions = $divisions;
     }
     if (!is_null($project)) {
         $this->favteams = $model->getFavTeams();
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_MATRIX_PAGE_TITLE'));
     if (!empty($this->round)) {
         $titleInfo->roundName = $this->round->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 16
0
 function display($tpl = null)
 {
     JHtml::_('behavior.framework');
     $mainframe = JFactory::getApplication();
     $params =& $mainframe->getParams();
     // get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     // add the css files
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     // add some javascript
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JUri::base(true) . '/components/com_joomleague/assets/js/results.js?v=' . $version);
     // add the ranking model
     $rankingmodel = new JoomleagueModelRanking();
     $project = $rankingmodel->getProject();
     // add the ranking config file
     $rankingconfig = $rankingmodel->getTemplateConfig('ranking');
     $rankingmodel->computeRanking();
     // add the results model
     $resultsmodel = new JoomleagueModelResults();
     // add the results config file
     $mdlRound = JModelLegacy::getInstance("Round", "JoomleagueModel");
     $roundcode = $mdlRound->getRoundcode($rankingmodel->round);
     $rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
     $resultsconfig = $resultsmodel->getTemplateConfig('results');
     if (!isset($resultsconfig['switch_home_guest'])) {
         $resultsconfig['switch_home_guest'] = 0;
     }
     if (!isset($resultsconfig['show_dnp_teams_icons'])) {
         $resultsconfig['show_dnp_teams_icons'] = 0;
     }
     if (!isset($resultsconfig['show_results_ranking'])) {
         $resultsconfig['show_results_ranking'] = 0;
     }
     // merge the 2 config files
     $config = array_merge($rankingconfig, $resultsconfig);
     $this->model = $rankingmodel;
     $this->project = $resultsmodel->getProject();
     $this->overallconfig = $resultsmodel->getOverallConfig();
     $this->config = array_merge($this->overallconfig, $config);
     $this->tableconfig = $rankingconfig;
     $this->params = $params;
     $this->showediticon = $resultsmodel->getShowEditIcon();
     $this->division = $resultsmodel->getDivision();
     $this->divisions = $rankingmodel->getDivisions();
     $this->divLevel = $rankingmodel->divLevel;
     $this->matches = $resultsmodel->getMatches();
     $this->round = $resultsmodel->roundid;
     $this->roundid = $resultsmodel->roundid;
     $this->roundcode = $roundcode;
     $rounds = $resultsmodel->getRoundOptions();
     $options = $this->getRoundSelectNavigation($rounds);
     $this->matchdaysoptions = $options;
     $this->currenturl = JoomleagueHelperRoute::getResultsRankingRoute($resultsmodel->getProject()->slug, $this->round);
     $this->rounds = $resultsmodel->getRounds();
     $this->favteams = $resultsmodel->getFavTeams($this->project);
     $this->projectevents = $resultsmodel->getProjectEvents();
     $this->model = $resultsmodel;
     $this->isAllowed = $resultsmodel->isAllowed();
     $this->type = $rankingmodel->type;
     $this->from = $rankingmodel->from;
     $this->to = $rankingmodel->to;
     $this->currentRanking = $rankingmodel->currentRanking;
     $this->previousRanking = $rankingmodel->previousRanking;
     $this->homeRanking = $rankingmodel->homeRank;
     $this->awayRanking = $rankingmodel->awayRank;
     $this->current_round = $rankingmodel->current_round;
     $this->teams = $rankingmodel->getTeamsIndexedByPtid($resultsmodel->getDivisionID());
     $this->previousgames = $rankingmodel->getPreviousGames();
     $this->action = $uri->toString();
     //rankingcolors
     if (!isset($this->config['colors'])) {
         $this->config['colors'] = "";
     }
     $this->colors = $rankingmodel->getColors($this->config['colors']);
     // Set page title
     if ($this->params->get('what_to_show_first', 0) == 0) {
         $prefix = JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE');
         $pageTitleFormat = $resultsconfig["page_title_format"];
     } else {
         $prefix = JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE');
         $pageTitleFormat = $rankingconfig["page_title_format"];
     }
     $titleInfo = JoomleagueHelper::createTitleInfo($prefix);
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $pageTitleFormat);
     $document->setTitle($this->pagetitle);
     /*
     //build feed links
     $feed = 'index.php?option=com_joomleague&view=results&p='.$this->project->id.'&format=feed';
     $rss = array('type' => 'application/rss+xml', 'title' => JText::_('COM_JOOMLEAGUE_RESULTS_RSSFEED'));
     
     // add the links
     $document->addHeadLink(JRoute::_($feed.'&type=rss'), 'alternate', 'rel', $rss);
     */
     JLGView::display($tpl);
 }
Ejemplo n.º 17
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $match = $model->getMatch();
     $this->project = $project;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->match = $match;
     $ret = $model->getMatchText($match->new_match_id);
     if ($ret) {
         $this->newmatchtext = $ret->text;
     }
     $ret = $model->getMatchText($match->old_match_id);
     if ($ret) {
         $this->oldmatchtext = $ret->text;
     }
     $this->round = $model->getRound();
     $this->team1 = $model->getTeaminfo($this->match->projectteam1_id);
     $this->team2 = $model->getTeaminfo($this->match->projectteam2_id);
     $this->team1_club = $model->getClubinfo($this->team1->club_id);
     $this->team2_club = $model->getClubinfo($this->team2->club_id);
     $this->matchplayerpositions = $model->getMatchPlayerPositions();
     $this->matchplayers = $model->getMatchPlayers();
     $this->matchstaffpositions = $model->getMatchStaffPositions();
     $this->matchstaffs = $model->getMatchStaff();
     $this->matchrefereepositions = $model->getMatchRefereePositions();
     $this->matchreferees = $model->getMatchReferees();
     $this->substitutes = $model->getSubstitutes();
     $this->eventtypes = $model->getEventTypes();
     $sortEventsDesc = isset($this->config['sort_events_desc']) ? $this->config['sort_events_desc'] : '1';
     $this->matchevents = $model->getMatchEvents($this->match->id, 1, $sortEventsDesc);
     $this->playground = $model->getPlayground($this->match->playground_id);
     $this->stats = $model->getProjectStats();
     $this->playerstats = $model->getMatchStats();
     $this->staffstats = $model->getMatchStaffStats();
     $this->model = $model;
     $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . '/assets/extended/match.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($match->extended, 'ini');
     $extended = JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $this->extended = $extended;
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_MATCHREPORT_PAGE_TITLE'));
     if (!empty($this->team1)) {
         $titleInfo->team1Name = $this->team1->name;
     }
     if (!empty($this->team2)) {
         $titleInfo->team2Name = $this->team2->name;
     }
     if (!empty($this->round)) {
         $titleInfo->roundName = $this->round->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 18
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $project = $model->getProject();
     $overallconfig = $model->getOverallConfig();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $project;
     $this->overallconfig = $overallconfig;
     $this->config = $config;
     $this->favteams = $model->getFavTeams();
     $this->club = $model->getClub();
     switch ($config['type_matches']) {
         case 0:
         case 4:
             // all matches
             $this->allmatches = $model->getAllMatches($config['MatchesOrderBy']);
             break;
         case 1:
             // home matches
             $this->homematches = $model->getHomeMatches($config['MatchesOrderBy']);
             break;
         case 2:
             // away matches
             $this->awaymatches = $model->getAwayMatches($config['MatchesOrderBy']);
             break;
         default:
             // home+away matches
             $this->homematches = $model->getHomeMatches($config['MatchesOrderBy']);
             $this->awaymatches = $model->getAwayMatches($config['MatchesOrderBy']);
             break;
     }
     $this->startdate = $model->getStartDate();
     $this->enddate = $model->getEndDate();
     $this->teams = $model->getTeams();
     $this->model = $model;
     $this->action = $uri->toString();
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_CLUBPLAN_PAGE_TITLE'));
     if (!empty($this->club)) {
         $titleInfo->clubName = $this->club->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     //build feed links
     $project_id = !empty($this->project->id) ? '&p=' . $this->project->id : '';
     $club_id = !empty($this->club->id) ? '&cid=' . $this->club->id : '';
     $rssVar = !empty($this->club->id) ? $club_id : $project_id;
     //$feed='index.php?option=com_joomleague&view=clubplan&cid='.$this->club->id.'&format=feed';
     $feed = 'index.php?option=com_joomleague&view=clubplan' . $rssVar . '&format=feed';
     $rss = array('type' => 'application/rss+xml', 'title' => JText::_('COM_JOOMLEAGUE_CLUBPLAN_RSSFEED'));
     // add the links
     $document->addHeadLink(JRoute::_($feed . '&type=rss'), 'alternate', 'rel', $rss);
     parent::display($tpl);
 }
Ejemplo n.º 19
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
     $model->setProjectId($project->id);
     $this->project = $project;
     $this->overallconfig = $model->getOverallConfig();
     $this->tableconfig = $config;
     $this->config = $config;
     $model->computeRanking();
     $this->model = $model;
     $this->round = $model->round;
     $this->part = $model->part;
     $this->rounds = $rounds;
     $this->divisions = $model->getDivisions();
     $this->type = $model->type;
     $this->from = $model->from;
     $this->to = $model->to;
     $this->divLevel = $model->divLevel;
     $this->currentRanking = $model->currentRanking;
     $this->previousRanking = $model->previousRanking;
     $this->homeRanking = $model->homeRank;
     $this->awayRanking = $model->awayRank;
     $this->current_round = $model->current_round;
     $this->previousgames = $model->getPreviousGames();
     //$this->teams = $model->getTeamsIndexedByPtid());
     $this->action = $uri->toString();
     $frommatchday[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_RANKING_FROM_MATCHDAY'));
     $frommatchday = array_merge($frommatchday, $rounds);
     $lists['frommatchday'] = $frommatchday;
     $tomatchday[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_RANKING_TO_MATCHDAY'));
     $tomatchday = array_merge($tomatchday, $rounds);
     $lists['tomatchday'] = $tomatchday;
     $opp_arr = array();
     $opp_arr[] = JHtml::_('select.option', "0", JText::_('COM_JOOMLEAGUE_RANKING_FULL_RANKING'));
     $opp_arr[] = JHtml::_('select.option', "1", JText::_('COM_JOOMLEAGUE_RANKING_HOME_RANKING'));
     $opp_arr[] = JHtml::_('select.option', "2", JText::_('COM_JOOMLEAGUE_RANKING_AWAY_RANKING'));
     $lists['type'] = $opp_arr;
     $this->lists = $lists;
     if (!isset($config['colors'])) {
         $config['colors'] = "";
     }
     $this->colors = $model->getColors($config['colors']);
     //$this->result = $model->getTeamInfo();
     //		$this->pageNav = $model->pagenav( "ranking", count( $rounds ), $sr->to );
     //		$this->pageNav2 = $model->pagenav2( "ranking", count( $rounds ), $sr->to );
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 20
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $nickname = isset($person->nickname) ? $person->nickname : "";
     if (!empty($nickname)) {
         $nickname = "'" . $nickname . "'";
     }
     $this->isContactDataVisible = $model->isContactDataVisible($config['show_contact_team_member_only']);
     $project = $model->getProject();
     $this->project = $project;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     $this->nickname = $nickname;
     /*
     $this->teamPlayers = $model->getTeamPlayers();
     
     // Select the teamplayer that is currently published (in case the player played in multiple teams in the project)
     $teamPlayer = null;
     if (count($this->teamPlayers))
     {
     	$currentProjectTeamId=0;
     	foreach ($this->teamPlayers as $teamPlayer)
     	{
     		if ($teamPlayer->published == 1)
     		{
     			$currentProjectTeamId=$teamPlayer->projectteam_id;
     			break;
     		}
     	}
     	if ($currentProjectTeamId)
     	{
     		$teamPlayer = $this->teamPlayers[$currentProjectTeamId];
     	}
     }
     */
     $sportstype = $config['show_plcareer_sportstype'] ? $model->getSportsType() : 0;
     $current_round = $project->current_round;
     $personid = $model->personid;
     $teamPlayer = $model->getTeamPlayerByRound($current_round, $personid);
     $this->teamPlayer = $teamPlayer[0];
     $this->historyPlayer = $model->getPlayerHistory($sportstype, 'ASC');
     $this->historyPlayerStaff = $model->getPlayerHistoryStaff($sportstype, 'ASC');
     $this->AllEvents = $model->getAllEvents($sportstype);
     $this->showediticon = $model->getAllowed($config['edit_own_player']);
     $this->stats = $model->getProjectStats();
     // Get events and stats for current project
     if ($config['show_gameshistory']) {
         $this->games = $model->getGames();
         $this->teams = $model->getTeamsIndexedByPtid();
         $this->gamesevents = $model->getGamesEvents();
         $this->gamesstats = $model->getPlayerStatsByGame();
     }
     // Get events and stats for all projects where player played in (possibly restricted to sports type of current project)
     if ($config['show_career_stats']) {
         $this->stats = $model->getStats($current_round, $personid);
         $this->projectstats = $model->getPlayerStatsByProject($sportstype, $current_round, $personid);
     }
     $extended = $this->getExtended($person->extended, 'person');
     $this->extended = $extended;
     $name = !empty($person) ? JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $this->config["name_format"]) : "";
     $this->playername = $name;
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_PLAYER_PAGE_TITLE'));
     $titleInfo->personName = $name;
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 21
0
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $option = JRequest::getCmd('option');
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/' . $option . '/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     //add js file
     JHtml::_('behavior.framework');
     $model = $this->getModel();
     $division_id = $model->getDivisionID();
     $matches = $model->getMatches();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $mdlRound = JModelLegacy::getInstance("Round", "JoomleagueModel");
     $roundcode = $mdlRound->getRoundcode($model->roundid);
     $rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
     $this->roundsoptions = $rounds;
     $this->project = $project;
     $lists = array();
     if (isset($this->project)) {
         $this->overallconfig = $model->getOverallConfig();
         $this->config = array_merge($this->overallconfig, $config);
         $this->teams = $model->getTeamsIndexedByPtid($division_id);
         $this->showediticon = $model->getShowEditIcon();
         $this->division = $model->getDivision();
         $this->matches = $matches;
         $this->roundid = $model->roundid;
         $this->roundcode = $roundcode;
         $this->rounds = $model->getRounds();
         $this->favteams = $model->getFavTeams($project);
         $this->projectevents = $model->getProjectEvents();
         $this->model = $model;
         $this->isAllowed = $model->isAllowed();
         $lists['rounds'] = JHtml::_('select.genericlist', $rounds, 'current_round', 'class="inputbox" size="1" onchange="joomleague_changedoc(this);', 'value', 'text', $project->current_round);
         $this->lists = $lists;
         if (!isset($this->config['switch_home_guest'])) {
             $this->config['switch_home_guest'] = 0;
         }
         if (!isset($this->config['show_dnp_teams_icons'])) {
             $this->config['show_dnp_teams_icons'] = 0;
         }
         if (!isset($this->config['show_results_ranking'])) {
             $this->config['show_results_ranking'] = 0;
         }
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE'));
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division) && $this->division->id != 0) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     //build feed links
     $feed = 'index.php?option=' . $option . '&view=results&p=' . $this->project->id . '&format=feed';
     $rss = array('type' => 'application/rss+xml', 'title' => JText::_('COM_JOOMLEAGUE_RESULTS_RSSFEED'));
     // add the links
     $document->addHeadLink(JRoute::_($feed . '&type=rss'), 'alternate', 'rel', $rss);
     parent::display($tpl);
 }
Ejemplo n.º 22
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     //$this->staffconfig = $model->getTemplateConfig('teamstaff');
     $this->config = $config;
     $playerlayout = JRequest::getVar('playerlayout', '');
     $stafflayout = JRequest::getVar('stafflayout', '');
     if (!empty($playerlayout) && $playerlayout != $this->config['show_players_layout']) {
         $this->config['show_players_layout'] = $playerlayout;
     }
     if (!empty($stafflayout) && $stafflayout != $this->config['show_staff_layout']) {
         $this->config['show_staff_layout'] = $stafflayout;
     }
     $this->projectteam = $model->getProjectTeam();
     if ($this->projectteam) {
         $this->showediticon = $model->hasEditPermission('teamplayer.select');
         $team = $model->getTeam();
         $this->team = $team;
         $players = $model->getTeamPlayers();
         $this->rows = $players;
         // events
         if ($this->config['show_events_stats']) {
             $this->positioneventtypes = $model->getPositionEventTypes();
             $this->playereventstats = $model->getPlayerEventStats();
         }
         //stats
         if ($this->config['show_stats']) {
             $this->stats = $model->getProjectStats();
             $this->playerstats = $model->getRosterStats();
         }
         $this->stafflist = $model->getStaffList();
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_ROSTER_PAGE_TITLE'));
     if (!empty($this->team)) {
         if ($this->config['show_team_shortform'] == 1 && !empty($this->team->short_name)) {
             $titleInfo->team1Name = $this->team->name . " [" . $this->team->short_name . "]";
         } else {
             $titleInfo->team1Name = $this->team->name;
         }
     } else {
         $titleInfo->team1Name = "Project team does not exist";
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 23
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $js = $this->baseurl . '/components/' . $option . '/assets/js/json2.js';
     $document->addScript($js);
     $js = $this->baseurl . '/components/' . $option . '/assets/js/swfobject.js';
     $document->addScript($js);
     $division = JRequest::getInt('division', 0);
     $model = $this->getModel();
     $rankingconfig = $model->getTemplateConfig("ranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision($division);
     if (isset($this->project)) {
         $teamid1 = $model->teamid1;
         $teamid2 = $model->teamid2;
         $options = array(JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_CURVE_CHOOSE_TEAM')));
         $divisions = $model->getDivisions();
         if (count($divisions) > 0 && $division == 0) {
             foreach ($divisions as $d) {
                 $options = array();
                 $teams = $model->getTeams($d->id);
                 $i = 0;
                 foreach ((array) $teams as $t) {
                     $options[] = JHtml::_('select.option', $t->id, $t->name);
                     if ($i == 0) {
                         $teamid1 = $t->id;
                     }
                     if ($i == 1) {
                         $teamid2 = $t->id;
                     }
                     $i++;
                 }
                 $team1select[$d->id] = JHtml::_('select.genericlist', $options, 'tid1_' . $d->id, 'onchange="reload_curve_chart_' . $d->id . '()" class="inputbox" style="font-size:9px;"', 'value', 'text', $teamid1);
                 $team2select[$d->id] = JHtml::_('select.genericlist', $options, 'tid2_' . $d->id, 'onchange="reload_curve_chart_' . $d->id . '()" class="inputbox" style="font-size:9px;"', 'value', 'text', $teamid2);
             }
         } else {
             $divisions = array();
             $team1select = array();
             $team2select = array();
             $div = $model->getDivision($division);
             if (empty($div)) {
                 $div = new stdClass();
                 $div->id = 0;
                 $div->name = '';
             }
             $divisions[0] = $div;
             $teams = $model->getTeams($division);
             $i = 0;
             foreach ((array) $teams as $t) {
                 $options[] = JHtml::_('select.option', $t->id, $t->name);
                 if ($i == 0 && $teamid1 == 0) {
                     $teamid1 = $t->id;
                 }
                 if ($i == 1 && $teamid2 == 0) {
                     $teamid2 = $t->id;
                 }
                 $i++;
             }
             $team1select[$div->id] = JHtml::_('select.genericlist', $options, 'tid1_' . $div->id, 'onchange="reload_curve_chart_' . $div->id . '()" class="inputbox" style="font-size:9px;"', 'value', 'text', $teamid1);
             $team2select[$div->id] = JHtml::_('select.genericlist', $options, 'tid2_' . $div->id, 'onchange="reload_curve_chart_' . $div->id . '()" class="inputbox" style="font-size:9px;"', 'value', 'text', $teamid2);
         }
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->model = $model;
         $this->colors = $model->getColors($rankingconfig['colors']);
         $this->divisions = $divisions;
         $this->division = $model->getDivision($division);
         $this->favteams = $model->getFavTeams();
         $this->team1 = $model->getTeam1();
         $this->team2 = $model->getTeam2();
         $this->allteams = $model->getTeams($division);
         $this->team1select = $team1select;
         $this->team2select = $team2select;
         $this->_setChartdata(array_merge($flashconfig, $rankingconfig));
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_CURVE_PAGE_TITLE'));
     if (!empty($this->team1)) {
         $titleInfo->team1Name = $this->team1->name;
     }
     if (!empty($this->team2)) {
         $titleInfo->team2Name = $this->team2->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     if (!empty($this->division)) {
         $titleInfo->divisionName = $this->division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
Ejemplo n.º 24
0
 function display($tpl = null)
 {
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $match = $model->getMatch();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $this->project = $model->getProject();
     $this->config = $config;
     $this->tableconfig = $tableconfig;
     $this->overallconfig = $model->getOverallConfig();
     if (!isset($this->overallconfig['seperator'])) {
         $this->overallconfig['seperator'] = ":";
     }
     $this->match = $match;
     if ($match) {
         $newmatchtext = "";
         if ($match->new_match_id > 0) {
             $ret = $model->getMatchText($match->new_match_id);
             $matchDate = JoomleagueHelper::getMatchDate($ret, JText::_('COM_JOOMLEAGUE_NEXTMATCH_NEXT_MATCHDATE'));
             $matchTime = JoomleagueHelperHtml::showMatchTime($ret, $this->config, $this->overallconfig, $this->project);
             $newmatchtext = $matchDate . " " . $matchTime . ", " . $ret->t1name . " - " . $ret->t2name;
         }
         $this->newmatchtext = $newmatchtext;
         $prevmatchtext = "";
         if ($match->old_match_id > 0) {
             $ret = $model->getMatchText($match->old_match_id);
             $matchDate = JoomleagueHelper::getMatchDate($ret, JText::_('COM_JOOMLEAGUE_NEXTMATCH_PREVIOUS_MATCHDATE'));
             $matchTime = JoomleagueHelperHtml::showMatchTime($ret, $this->config, $this->overallconfig, $this->project);
             $prevmatchtext = $matchDate . " " . $matchTime . ", " . $ret->t1name . " - " . $ret->t2name;
         }
         $this->oldmatchtext = $prevmatchtext;
         $this->teams = $model->getMatchTeams();
         $this->referees = $model->getReferees();
         $this->playground = $model->getPlayground($this->match->playground_id);
         $this->homeranked = $model->getHomeRanked();
         $this->awayranked = $model->getAwayRanked();
         $this->chances = $model->getChances();
         $this->home_highest_home_win = $model->getHomeHighestHomeWin();
         $this->away_highest_home_win = $model->getAwayHighestHomeWin();
         $this->home_highest_home_def = $model->getHomeHighestHomeDef();
         $this->away_highest_home_def = $model->getAwayHighestHomeDef();
         $this->home_highest_away_win = $model->getHomeHighestAwayWin();
         $this->away_highest_away_win = $model->getAwayHighestAwayWin();
         $this->home_highest_away_def = $model->getHomeHighestAwayDef();
         $this->away_highest_away_def = $model->getAwayHighestAwayDef();
         $games = $model->getGames();
         $gamesteams = $model->getTeamsFromMatches($games);
         $this->games = $games;
         $this->gamesteams = $gamesteams;
         $previousx = $this->get('previousx');
         $teams = $this->get('TeamsIndexedByPtid');
         $this->previousx = $previousx;
         $this->allteams = $teams;
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_NEXTMATCH_PAGE_TITLE'));
     if (count($this->teams) == 2) {
         if (!empty($this->teams[0])) {
             $titleInfo->team1Name = $this->teams[0]->name;
         }
         if (!empty($this->teams[1])) {
             $titleInfo->team2Name = $this->teams[1]->name;
         }
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     $division = $model->getDivision(JRequest::getInt('division', 0));
     if (!empty($division) && $division->id != 0) {
         $titleInfo->divisionName = $division->name;
     }
     $this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }