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);
     // Joomleague model
     $model = $this->getModel();
     $user = JFactory::getUser();
     $rankingconfig = $model->getTemplateConfig("ranking");
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getTemplateConfig('overall'));
     $this->assignRef('rankingconfig', $rankingconfig);
     $this->assignRef('playgrounds', $model->getPlaygrounds());
     $this->assignRef('match', $model->getMatch());
     $this->assignRef('team1', $model->getTeaminfo($this->match->projectteam1_id));
     $this->assignRef('team2', $model->getTeaminfo($this->match->projectteam2_id));
     $isAllowed = $model->isAllowed() || $model->isMatchAdmin($this->match->id, $user->id);
     $this->assignRef('showediticon', $isAllowed);
     //echo '<br /><pre>~' . print_r( $this->match, true ) . '~</pre><br />';
     // extended match data
     $xmlfile = JLG_PATH_ADMIN . DS . 'assets' . DS . 'extended' . DS . 'match.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($this->match->extended, 'ini');
     $extended =& JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $lists = array();
     // build the html select booleanlist for cancel
     $lists['cancel'] = JHTML::_('select.booleanlist', 'cancel', 'class="inputbox"', $this->match->cancel);
     $playgrounds[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYGROUND'));
     if (!empty($this->playgrounds)) {
         $playgrounds = array_merge($playgrounds, $this->playgrounds);
     }
     $lists['playgrounds'] = JHTML::_('select.genericlist', $playgrounds, 'playground_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->playground_id);
     //match relation lists
     //$mdlMatch = $model->getMatch();
     $oldmatches[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_EDITMATCH_SELECT_PREV_MATCH'));
     $res = array();
     $new_match_id = $this->match->new_match_id ? $this->match->new_match_id : 0;
     if ($res =& $model->getMatchRelationsOptions($this->project->id, $this->match->id . "," . $new_match_id)) {
         $oldmatches = array_merge($oldmatches, $res);
     }
     unset($res);
     $lists['old_match'] = JHTML::_('select.genericlist', $oldmatches, 'old_match_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->old_match_id);
     $newmatches[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_EDITMATCH_SELECT_NEW_MATCH'));
     $res = array();
     $old_match_id = $this->match->old_match_id ? $this->match->old_match_id : 0;
     if ($res =& $model->getMatchRelationsOptions($this->project->id, $this->match->id . "," . $old_match_id)) {
         $newmatches = array_merge($newmatches, $res);
     }
     unset($res);
     $lists['new_match'] = JHTML::_('select.genericlist', $newmatches, 'new_match_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->new_match_id);
     $this->assignRef('form', $this->get('form'));
     $this->assignRef('extended', $extended);
     $this->assignRef('lists', $lists);
     $pageTitle = JText::_('COM_JOOMLEAGUE_EDITMATCH_MATCHDETAILS');
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     $model = $this->getModel();
     $this->assignRef('club', $model->getClub());
     $lists = array();
     $this->club->merge_teams = explode(",", $this->club->merge_teams);
     $this->assignRef('form', $this->get('Form'));
     // extended club data
     $xmlfile = JLG_PATH_ADMIN . DS . 'assets' . DS . 'extended' . DS . 'club.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($this->club->extended, 'ini');
     $extended =& JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $this->assignRef('extended', $extended);
     $this->assignRef('lists', $lists);
     $this->assign('cfg_which_media_tool', JComponentHelper::getParams('com_joomleague')->get('cfg_which_media_tool', 0));
     $this->assign('cfg_be_show_merge_teams', JComponentHelper::getParams('com_joomleague')->get('cfg_be_show_merge_teams', 0));
     parent::display($tpl);
 }
 function getAbout()
 {
     $about = new stdClass();
     //Translations Hosted by
     $about->translations = '<a href="https://opentranslators.transifex.com/projects/p/joomleague/">https://opentranslators.transifex.com/projects/p/joomleague/</a>';
     //Repository Hosted by
     $about->repository = '<a href="http://gitorious.org/joomleague">http://gitorious.org/joomleague</a>';
     //version
     $version = JoomleagueHelper::getVersion();
     $revision = explode('.', $version);
     $about->version = '<a href="http://gitorious.org/joomleague/joomleague/commits/' . $revision[0] . '.' . $revision[1] . '.0/">' . $version . '</a>';
     //author
     $about->author = '<a href="http://stats.joomleague.net/authors.html">Joomleague-Team</a>';
     //page
     $about->page = 'http://www.joomleague.net';
     //e-mail
     $about->email = 'http://www.JoomLeague.net/forum/index.php?action=contact';
     //forum
     $about->forum = 'http://forum.joomleague.net';
     //bugtracker
     $about->bugs = 'http://bugtracker.joomleague.net';
     //wiki
     $about->wiki = 'http://wiki.joomleague.net';
     //date
     $about->date = '2013-01-07';
     //developer
     $about->developer = '<a href="http://stats.joomleague.net/authors.html" target="_blank">JoomLeague-Team</a>';
     /*
     		//designer
     		$about->designer = 'Kasi';
     		$about->designer .= ', <a href="http://www.cg-design.net" target="_blank">cg design</a>&nbsp;(Carsten Grob) ';
     */
     //designer
     $about->designer = 'DonClumsy';
     $about->designer .= ', (Tim Keller) ';
     //icons
     $about->icons = '<a href="http://www.hollandsevelden.nl/iconset/" target="_blank">Jersey Icons</a> (Hollandsevelden.nl)';
     $about->icons .= ', <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">Silk / Flags Icons</a> (Mark James)';
     $about->icons .= ', Panel images (Kasi)';
     //flash
     $about->flash = '<a href="http://teethgrinder.co.uk/open-flash-chart-2/" target="_blank">Open Flash Chart 2.x</a>';
     //graphoc library
     $about->graphic_library = '<a href="http://www.walterzorn.com" target="_blank">www.walterzorn.com</a>';
     //phpthumb class
     $about->phpthumb = '<a href="http://phpthumb.gxdlabs.com/" target="_blank">phpthumb.gxdlabs.com</a>';
     //page
     $about->github = 'https://github.com/diddipoeler/joomleague-2-komplettpaket';
     $about->diddipoelerpage = 'http://www.fussballineuropa.de';
     //e-mail
     $about->diddipoeleremail = '*****@*****.**';
     //forum
     $about->diddipoelerforum = 'http://www.fussballineuropa.de/index.php?option=com_kunena&view=category&catid=247&Itemid=530';
     $this->_about = $about;
     return $this->_about;
 }
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $model = $this->getModel();
     $lists = array();
     //get the project
     $project =& $this->get('data');
     $project->fav_team = explode(",", $project->fav_team);
     $isNew = $project->id < 1;
     $append = '';
     if ($isNew) {
         $append = ' style="background-color:#FFCCCC;"';
     }
     $edit = JRequest::getVar('edit');
     $copy = JRequest::getVar('copy');
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_THE_PROJECT'), $project->name);
         $mainframe->redirect('index.php?option=' . $option, $msg);
     }
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // initialise new record
         $project->published = 1;
         $project->order = 0;
     }
     // add javascript
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JURI::root() . 'administrator/components/com_joomleague/models/forms/project.js');
     $this->assignRef('edit', $edit);
     $this->assignRef('copy', $copy);
     $this->assignRef('lists', $lists);
     $this->assignRef('project', $project);
     $this->assignRef('leagues', $res);
     // 'regular' joomla 2.5 form associated to view
     // TODO: all fields should be migrated to this xml file !
     $this->assignRef('form', $this->get('form'));
     $extended = $this->getExtended($project->extended, 'project');
     $this->assignRef('extended', $extended);
     $this->assign('cfg_which_media_tool', JComponentHelper::getParams($option)->get('cfg_which_media_tool', 0));
     $this->addToolbar();
     parent::display($tpl);
 }
 /**
  * Image selection List
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $document = JFactory::getDocument();
     if ($this->getLayout() == 'upload') {
         $this->_displayupload($tpl);
         return;
     }
     //get vars
     $type = JRequest::getVar('type');
     $folder = ImageSelectJL::getfolder($type);
     $field = JRequest::getVar('field');
     $fieldid = JRequest::getVar('fieldid');
     $search = $mainframe->getUserStateFromRequest('com_joomleague.imageselect', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     //add css
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addStyleSheet('components/com_joomleague/assets/css/imageselect.css?v=' . $version);
     JRequest::setVar('folder', $folder);
     // Do not allow cache
     JResponse::allowCache(false);
     //get images
     $images = $this->get('Images');
     $pageNav =& $this->get('Pagination');
     if (count($images) > 0 || $search) {
         $this->assignRef('images', $images);
         $this->assignRef('type', $type);
         $this->assignRef('folder', $folder);
         $this->assignRef('search', $search);
         $this->assignRef('state', $this->get('state'));
         $this->assignRef('pageNav', $pageNav);
         $this->assignRef('field', $field);
         $this->assignRef('fieldid', $fieldid);
         $this->assignRef('form', $this->get('form'));
         parent::display($tpl);
     } else {
         //no images in the folder, redirect to uploadscreen and raise notice
         JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_JOOMLEAGUE_ADMIN_IMAGEHANDLER_NO_IMAGES'));
         $this->setLayout('upload');
         $this->assignRef('form', $this->get('form'));
         $this->_displayupload($tpl);
         return;
     }
 }
Exemplo n.º 6
0
 function getAbout()
 {
     $about = new stdClass();
     //Translations Hosted by
     $about->translations = '<a href="https://opentranslators.transifex.com/projects/p/joomleague/" target="_blank">https://opentranslators.transifex.com/projects/p/joomleague/</a>';
     //Repository Hosted by
     $about->repository = '<a href="https://gitlab.com/joomleague/joomleague" target="_blank">https://gitlab.com/joomleague/joomleague</a>';
     //version
     $version = JoomleagueHelper::getVersion();
     $revision = explode('.', $version);
     $about->version = $version;
     //author
     $about->author = 'Joomleague-Team';
     //page
     $about->page = 'http://www.joomleague.at';
     //e-mail
     $about->email = 'http://www.joomleague.at/forum/index.php?action=contact';
     //forum
     $about->forum = 'http://forum.joomleague.at';
     //bugtracker
     $about->bugs = 'http://tracker.joomleague.at/projects/joomleague';
     //wiki
     $about->wiki = 'http://wiki.joomleague.at';
     //date
     $about->date = '2013-01-07';
     //developer
     $about->developer = '<a href="https://gitlab.com/joomleague/joomleague/graphs/master" target="_blank">JoomLeague-Team</a>';
     //designer
     $about->designer = 'Kasi';
     $about->designer .= ', <a href="http://www.cg-design.net" target="_blank">cg design</a>&nbsp;(Carsten Grob) ';
     //icons
     $about->icons = '<a href="http://www.hollandsevelden.nl/iconset/" target="_blank">Jersey Icons</a> (Hollandsevelden.nl)';
     $about->icons .= ', <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">Silk / Flags Icons</a> (Mark James)';
     $about->icons .= ', Panel images (Kasi)';
     //flash
     $about->flash = 'Open Flash Chart 2.x';
     //graphoc library
     $about->graphic_library = '<a href="http://www.walterzorn.com" target="_blank">www.walterzorn.com</a>';
     //phpthumb class
     $about->phpthumb = 'phpthumb.gxdlabs.com';
     $this->_about = $about;
     return $this->_about;
 }
Exemplo n.º 7
0
 public function display($tpl = null)
 {
     $this->form = $this->get('form');
     $isNew = $this->form->getValue('id') < 1;
     if ($isNew) {
         $this->form->setValue('is_utc_converted', null, 1);
     }
     $edit = JRequest::getVar('edit');
     $copy = JRequest::getVar('copy');
     // add javascript
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $this->edit = $edit;
     $this->copy = $copy;
     $extended = $this->getExtended($this->form->getValue('extended'), 'project');
     $this->extended = $extended;
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 8
0
 function display($tpl = null)
 {
     $this->form = $this->get('form');
     $isNew = $this->form->getValue('id') < 1;
     if ($isNew) {
         $this->form->setValue('is_utc_converted', null, 1);
     }
     $edit = JRequest::getVar('edit');
     $copy = JRequest::getVar('copy');
     // add javascript
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JUri::root() . 'administrator/components/com_joomleague/models/forms/project.js?v=' . $version);
     $this->edit = $edit;
     $this->copy = $copy;
     $extended = $this->getExtended($this->form->getValue('extended'), 'project');
     $this->extended = $extended;
     $this->addToolbar();
     parent::display($tpl);
 }
Exemplo n.º 9
0
 function _displayMenu($tpl = null)
 {
     $option = $this->input->getCmd('option');
     $app = JFactory::getApplication();
     JHtml::_('behavior.framework');
     $db = JFactory::getDbo();
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JUri::base() . 'components/com_joomleague/assets/js/quickmenu.js?v=' . $version);
     $uri = JFactory::getURI();
     $model = $this->getModel('project');
     $params = JComponentHelper::getParams($option);
     // catch variables
     $pid = JRequest::getVar('pid', array(0), '', 'array');
     $stid = JRequest::getVar('stid', array(0), '', 'array');
     // Project variable request + Sporttype variable request = ''
     if ($pid[0] > 0 && $stid[0] == '') {
         $model->setId($pid[0]);
         $project = $this->get('Data');
         $sports_type_id = $project->sports_type_id;
     } else {
         // defaulting to state
         $sports_type_id = $app->getUserState($option . 'sportstypes', 0);
     }
     // Sporttype variable request + sporttypeid
     if ($stid[0] > 0 || $sports_type_id > 0) {
         if ($stid[0] > 0) {
             $app->setUserState($option . 'sportstypes', $stid[0]);
         }
         if ($sports_type_id > 0) {
             $app->setUserState($option . 'sportstypes', $sports_type_id);
         }
     } else {
         $defsportstype = $params->get("defsportstype");
         $defsportstype = empty($defsportstype) ? "1" : $params->get("defsportstype");
         $app->setUserState($option . 'sportstypes', $defsportstype);
     }
     $seasonnav = $app->getUserState($option . 'seasonnav');
     $pid = JRequest::getVar('pid', array(0), '', 'array');
     if ($pid[0] > 0) {
         $app->setUserState($option . 'project', $pid[0]);
         $model->setId($pid[0]);
     }
     $project = $this->get('Data');
     $model = $this->getModel();
     $use_seasons = $params->get('cfg_show_seasons_in_project_drop_down', 0);
     //Use seasons in dropdown or not
     //build the html select list for sports-types
     $sports_type_id = $app->getUserState($option . 'sportstypes', 0);
     $project_id = $pid[0];
     if ($sports_type_id > 0) {
         $project_id = $app->getUserState($option . 'project', 0);
     }
     $allSportstypes = JoomleagueModelSportsTypes::getSportsTypes();
     $sportstypes[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SPORTSTYPE'), 'id', 'name');
     $allSportstypes = array_merge($sportstypes, $allSportstypes);
     $lists['sportstypes'] = JHtml::_('select.genericList', $allSportstypes, 'stid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $sports_type_id);
     if ($app->getUserState($option . 'sportstypes', 0)) {
         // seasons
         $seasons[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SEASON'), 'id', 'name');
         $seasons = array_merge($seasons, $model->getSeasons());
         $lists['seasons'] = JHtml::_('select.genericList', $seasons, 'seasonnav', 'class="inputbox" style="width:100%"', 'id', 'name', $seasonnav);
         //build the html select list for projects
         $projects[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name');
         //check if the season filter is set and select the needed projects
         if (!$use_seasons) {
             if ($res = $model->getProjectsBySportsType($sports_type_id, $seasonnav)) {
                 $projects = array_merge($projects, $res);
             }
         } else {
             if ($res = $model->getSeasonProjects($seasonnav)) {
                 $projects = array_merge($projects, $res);
             }
         }
         $lists['projects'] = JHtml::_('select.genericList', $projects, 'pid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $project_id);
     }
     // if a project is active we create the teams and rounds select lists
     if ($project_id > 0) {
         $team_id = JRequest::getInt("ptid", 0);
         if ($team_id == 0) {
             $team_id = $app->getUserState($option . 'project_team_id');
         }
         $projectteams[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text');
         if ($res = $model->getProjectteams()) {
             $projectteams = array_merge($projectteams, $res);
         }
         $lDummy = 'class="inputbox" ';
         $lDummy .= 'style="width:100%"';
         $lists['projectteams'] = JHtml::_('select.genericList', $projectteams, 'tid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $team_id);
         $round_id = $app->getUserState($option . 'round_id');
         $projectrounds[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_ROUND'), 'value', 'text');
         $mdlRound = JModelLegacy::getInstance("Round", "JoomleagueModel");
         $mdlRound->setId($project->current_round);
         $round = $mdlRound->getData();
         $projectrounds[] = JHtml::_('select.option', $round->id, JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_CURRENT_ROUND'), 'value', 'text');
         if ($ress = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true)) {
             foreach ($ress as $res) {
                 $project_roundslist[] = JHtml::_('select.option', $res->value, $res->text);
             }
             $projectrounds = array_merge($projectrounds, $project_roundslist);
         }
         $lists['projectrounds'] = JHtml::_('select.genericList', $projectrounds, 'rid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $round_id);
     }
     $imagePath = 'administrator/components/com_joomleague/assets/images/';
     $tabs = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_D_MENU_GENERAL');
     $pane->name = 'General data';
     $pane->alert = false;
     $tabs[] = $pane;
     $content['General data'] = $link = array();
     $label = array();
     $limage = array();
     $link1 = array();
     $label1 = array();
     $limage1 = array();
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=projects&task=project.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_PROJECTS');
     $limage1[] = JHtml::_('image', $imagePath . 'projects.png', JText::_('COM_JOOMLEAGUE_D_MENU_PROJECTS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=sportstypes&task=sportstype.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_SPORTSTYPES');
     $limage1[] = JHtml::_('image', $imagePath . 'sportstypes.png', JText::_('COM_JOOMLEAGUE_D_MENU_SPORTSTYPES'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=leagues&task=league.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_LEAGUES');
     $limage1[] = JHtml::_('image', $imagePath . 'leagues.png', JText::_('COM_JOOMLEAGUE_D_MENU_LEAGUES'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=seasons&task=season.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_SEASONS');
     $limage1[] = JHtml::_('image', $imagePath . 'seasons.png', JText::_('COM_JOOMLEAGUE_D_MENU_SEASONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=clubs&task=club.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_CLUBS');
     $limage1[] = JHtml::_('image', $imagePath . 'clubs.png', JText::_('COM_JOOMLEAGUE_D_MENU_CLUBS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=teams&task=team.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_TEAMS');
     $limage1[] = JHtml::_('image', $imagePath . 'icon-16-Teams.png', JText::_('COM_JOOMLEAGUE_D_MENU_TEAMS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=persons&task=person.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_PERSONS');
     $limage1[] = JHtml::_('image', $imagePath . 'players.png', JText::_('COM_JOOMLEAGUE_D_MENU_PERSONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=eventtypes&task=eventtype.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_EVENTS');
     $limage1[] = JHtml::_('image', $imagePath . 'events.png', JText::_('COM_JOOMLEAGUE_D_MENU_EVENTS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=statistics&task=statistic.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_STATISTICS');
     $limage1[] = JHtml::_('image', $imagePath . 'calc16.png', JText::_('COM_JOOMLEAGUE_D_MENU_STATISTICS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=positions&task=position.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_POSITIONS');
     $limage1[] = JHtml::_('image', $imagePath . 'icon-16-Positions.png', JText::_('COM_JOOMLEAGUE_D_MENU_POSITIONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=playgrounds&task=playground.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_VENUES');
     $limage1[] = JHtml::_('image', $imagePath . 'playground.png', JText::_('COM_JOOMLEAGUE_D_MENU_VENUES'));
     $link[] = $link1;
     $label[] = $label1;
     $limage[] = $limage1;
     if ($project->id) {
         $link2 = array();
         $label2 = array();
         $limage2 = array();
         $project_type = $project->project_type;
         if ($project_type == 0) {
             $pane = new stdClass();
             $pane->title = JText::_('COM_JOOMLEAGUE_P_MENU_PROJECT');
             $pane->name = 'PMenu';
             $pane->alert = false;
             $tabs[] = $pane;
             $link2[] = JRoute::_('index.php?option=com_joomleague&task=project.edit&cid[]=' . $project->id);
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_PSETTINGS');
             $limage2[] = JHtml::_('image', $imagePath . 'projects.png', JText::_('COM_JOOMLEAGUE_P_MENU_PSETTINGS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=templates&task=template.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_FES');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_P_MENU_FES'));
             if (isset($project->project_type) && $project->project_type == 'DIVISIONS_LEAGUE') {
                 $link2[] = JRoute::_('index.php?option=com_joomleague&view=divisions&task=division.display');
                 $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_DIVISIONS');
                 $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Divisions.png', JText::_('COM_JOOMLEAGUE_P_MENU_DIVISIONS'));
             }
             if (isset($project->project_type) && ($project->project_type == 'TOURNAMENT_MODE' || $project->project_type == 'DIVISIONS_LEAGUE')) {
                 $link2[] = JRoute::_('index.php?option=com_joomleague&view=treetos&task=treeto.display');
                 $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_TREE');
                 $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Tree.png', JText::_('COM_JOOMLEAGUE_P_MENU_TREE'));
             }
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectposition&task=projectposition.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_POSITIONS');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Positions.png', JText::_('COM_JOOMLEAGUE_P_MENU_POSITIONS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectreferees&task=projectreferee.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_REFEREES');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Referees.png', JText::_('COM_JOOMLEAGUE_P_MENU_REFEREES'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectteams&task=projectteam.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_TEAMS');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Teams.png', JText::_('COM_JOOMLEAGUE_P_MENU_TEAMS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=rounds&task=round.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_MATCHDAYS');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-Matchdays.png', JText::_('COM_JOOMLEAGUE_P_MENU_MATCHDAYS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=jlxmlexports&task=jlxmlexport.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_XML_EXPORT');
             $limage2[] = JHtml::_('image', $imagePath . 'icon-16-XMLExportData.png', JText::_('COM_JOOMLEAGUE_P_MENU_XML_EXPORT'));
         }
         $link[] = $link2;
         $label[] = $label2;
         $limage[] = $limage2;
     }
     $link3 = array();
     $label3 = array();
     $limage3 = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_M_MENU_MAINTENANCE');
     $pane->name = 'MMenu';
     $pane->alert = false;
     $tabs[] = $pane;
     $link3[] = JRoute::_('index.php?option=com_joomleague&task=settings.edit');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_SETTINGS');
     $limage3[] = JHtml::_('image', $imagePath . 'settings.png', JText::_('COM_JOOMLEAGUE_M_MENU_SETTINGS'));
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=jlxmlimports&task=jlxmlimport.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_XML_IMPORT');
     $limage3[] = JHtml::_('image', $imagePath . 'import.png', JText::_('COM_JOOMLEAGUE_M_MENU_XML_IMPORT'));
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=databasetools&task=databasetool.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_TOOLS');
     $limage3[] = JHtml::_('image', $imagePath . 'repair.gif', JText::_('COM_JOOMLEAGUE_M_MENU_TOOLS'));
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=updates&task=update.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_UPDATES');
     $limage3[] = JHtml::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_M_MENU_UPDATES'));
     if (JFactory::getUser()->authorise('core.manage')) {
         $link3[] = JRoute::_('index.php?option=com_joomleague&view=tools&task=tools.display');
         $label3[] = JText::_('Tools');
         $limage3[] = JHtml::_('image', $imagePath . 'update.png', JText::_('Tools2'));
     }
     $link[] = $link3;
     $label[] = $label3;
     $limage[] = $limage3;
     // active pane selector
     if ($project->id) {
         switch ($this->input->getCmd('view')) {
             case 'projects':
             case 'leagues':
             case 'seasons':
             case 'sportstypes':
             case 'clubs':
             case 'teams':
             case 'persons':
             case 'eventtypes':
             case 'statistics':
             case 'positions':
             case 'playgrounds':
                 $active = 0;
                 break;
             case 'settings':
             case 'updates':
             case 'jlxmlimports':
             case 'databasetools':
             case 'tools':
                 $active = 2;
                 break;
                 break;
             default:
                 $active = $this->input->getInt("active", 1);
         }
     } else {
         switch ($this->input->getCmd('view')) {
             case 'projects':
             case 'leagues':
             case 'seasons':
             case 'sportstypes':
             case 'clubs':
             case 'teams':
             case 'persons':
             case 'eventtypes':
             case 'statistics':
             case 'positions':
             case 'playgrounds':
                 $active = 0;
                 break;
             case 'settings':
             case 'updates':
             case 'jlxmlimports':
             case 'databasetools':
             case 'tools':
                 $active = 1;
                 break;
             default:
                 $active = $this->input->getInt("active", 0);
         }
     }
     $mdlJoomleague = JModelLegacy::getInstance('Joomleague', 'JoomleagueModel');
     $versions = $mdlJoomleague->getVersion();
     if ($versions) {
         $version = $versions[0]->version;
     } else {
         $version = '';
     }
     $this->version = $version;
     $this->link = $link;
     $this->tabs = $tabs;
     $this->label = $label;
     $this->lists = $lists;
     $this->active = $active;
     $this->limage = $limage;
     $this->project = $project;
     $this->sports_type_id = $sports_type_id;
     /* $this->management = $management; */
     parent::display('admin');
 }
 function _displayMenu($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     JHTML::_('behavior.mootools');
     $db = JFactory::getDBO();
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JURI::base() . 'components/com_joomleague/assets/js/quickmenu.js?v=' . $version);
     $uri = JFactory::getURI();
     $model = $this->getModel('project');
     $params = JComponentHelper::getParams($option);
     $stid = JRequest::getVar('stid', array(0), '', 'array');
     $sports_type_id = $mainframe->getUserState($option . 'sportstypes', 0);
     if ($stid[0] > 0 || $sports_type_id > 0) {
         if ($stid[0] > 0) {
             $mainframe->setUserState($option . 'sportstypes', $stid[0]);
         }
     } else {
         $defsportstype = $params->get("defsportstype");
         $defsportstype = empty($defsportstype) ? "1" : $params->get("defsportstype");
         $mainframe->setUserState($option . 'sportstypes', $defsportstype);
     }
     $seasonnav = $mainframe->getUserState($option . 'seasonnav');
     $pid = JRequest::getVar('pid', array(0), '', 'array');
     if ($pid[0] > 0) {
         $mainframe->setUserState($option . 'project', $pid[0]);
         $model->setId($pid[0]);
     }
     $project = $this->get('Data');
     $model = $this->getModel();
     $use_seasons = $params->get('cfg_show_seasons_in_project_drop_down', 0);
     //Use seasons in dropdown or not
     //build the html select list for sports-types
     $sports_type_id = $mainframe->getUserState($option . 'sportstypes', 0);
     $project_id = $pid[0];
     if ($sports_type_id > 0) {
         $project_id = $mainframe->getUserState($option . 'project', 0);
     }
     $allSportstypes = JoomleagueModelSportsTypes::getSportsTypes();
     $sportstypes[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SPORTSTYPE'), 'id', 'name');
     $allSportstypes = array_merge($sportstypes, $allSportstypes);
     $lists['sportstypes'] = JHTML::_('select.genericList', $allSportstypes, 'stid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $sports_type_id);
     if ($mainframe->getUserState($option . 'sportstypes', 0)) {
         // seasons
         $seasons[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SEASON'), 'id', 'name');
         $seasons = array_merge($seasons, $model->getSeasons());
         $lists['seasons'] = JHTML::_('select.genericList', $seasons, 'seasonnav', 'class="inputbox" style="width:100%"', 'id', 'name', $seasonnav);
         //build the html select list for projects
         $projects[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name');
         //check if the season filter is set and select the needed projects
         if (!$use_seasons) {
             if ($res = $model->getProjectsBySportsType($sports_type_id, $seasonnav)) {
                 $projects = array_merge($projects, $res);
             }
         } else {
             if ($res = $model->getSeasonProjects($seasonnav)) {
                 $projects = array_merge($projects, $res);
             }
         }
         $lists['projects'] = JHTML::_('select.genericList', $projects, 'pid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $project_id);
     }
     // if a project is active we create the teams and rounds select lists
     if ($project_id > 0) {
         $team_id = JRequest::getInt("ptid", 0);
         if ($team_id == 0) {
             $team_id = $mainframe->getUserState($option . 'project_team_id');
         }
         $projectteams[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text');
         if ($res = $model->getProjectteams()) {
             $projectteams = array_merge($projectteams, $res);
         }
         $lDummy = 'class="inputbox" ';
         $lDummy .= 'style="width:100%"';
         $lists['projectteams'] = JHTML::_('select.genericList', $projectteams, 'tid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $team_id);
         $round_id = $mainframe->getUserState($option . 'round_id');
         $projectrounds[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_ROUND'), 'value', 'text');
         $mdlRound = JModel::getInstance("Round", "JoomleagueModel");
         $mdlRound->setId($project->current_round);
         $round = $mdlRound->getData();
         $projectrounds[] = JHTML::_('select.option', $round->id, JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_CURRENT_ROUND'), 'value', 'text');
         if ($ress = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true)) {
             foreach ($ress as $res) {
                 $project_roundslist[] = JHTML::_('select.option', $res->value, $res->text);
             }
             $projectrounds = array_merge($projectrounds, $project_roundslist);
         }
         $lists['projectrounds'] = JHTML::_('select.genericList', $projectrounds, 'rid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $round_id);
     }
     $imagePath = 'administrator/components/com_joomleague/assets/images/';
     $tabs = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_D_MENU_GENERAL');
     $pane->name = 'General data';
     $pane->alert = false;
     $tabs[] = $pane;
     $content['General data'] = $link = array();
     $label = array();
     $limage = array();
     $link1 = array();
     $label1 = array();
     $limage1 = array();
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=currentseasons&task=currentseason.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_CURRENT_PROJECTS');
     $limage1[] = JHTML::_('image', $imagePath . 'projects.png', JText::_('COM_JOOMLEAGUE_D_MENU_CURRENT_PROJECTS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=projects&task=project.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_PROJECTS');
     $limage1[] = JHTML::_('image', $imagePath . 'projects.png', JText::_('COM_JOOMLEAGUE_D_MENU_PROJECTS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=sportstypes&task=sportstype.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_SPORTSTYPES');
     $limage1[] = JHTML::_('image', $imagePath . 'sportstypes.png', JText::_('COM_JOOMLEAGUE_D_MENU_SPORTSTYPES'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=leagues&task=league.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_LEAGUES');
     $limage1[] = JHTML::_('image', $imagePath . 'leagues.png', JText::_('COM_JOOMLEAGUE_D_MENU_LEAGUES'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=seasons&task=season.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_SEASONS');
     $limage1[] = JHTML::_('image', $imagePath . 'seasons.png', JText::_('COM_JOOMLEAGUE_D_MENU_SEASONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=clubs&task=club.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_CLUBS');
     $limage1[] = JHTML::_('image', $imagePath . 'clubs.png', JText::_('COM_JOOMLEAGUE_D_MENU_CLUBS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=teams&task=team.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_TEAMS');
     $limage1[] = JHTML::_('image', $imagePath . 'icon-16-Teams.png', JText::_('COM_JOOMLEAGUE_D_MENU_TEAMS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=persons&task=person.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_PERSONS');
     $limage1[] = JHTML::_('image', $imagePath . 'players.png', JText::_('COM_JOOMLEAGUE_D_MENU_PERSONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=eventtypes&task=eventtype.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_EVENTS');
     $limage1[] = JHTML::_('image', $imagePath . 'events.png', JText::_('COM_JOOMLEAGUE_D_MENU_EVENTS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=statistics&task=statistic.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_STATISTICS');
     $limage1[] = JHTML::_('image', $imagePath . 'calc16.png', JText::_('COM_JOOMLEAGUE_D_MENU_STATISTICS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=positions&task=position.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_POSITIONS');
     $limage1[] = JHTML::_('image', $imagePath . 'icon-16-Positions.png', JText::_('COM_JOOMLEAGUE_D_MENU_POSITIONS'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=playgrounds&task=playground.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_VENUES');
     $limage1[] = JHTML::_('image', $imagePath . 'playground.png', JText::_('COM_JOOMLEAGUE_D_MENU_VENUES'));
     $link1[] = JRoute::_('index.php?option=com_joomleague&view=jlextcountries&task=jlextcountry.display');
     $label1[] = JText::_('COM_JOOMLEAGUE_D_MENU_COUNTRY');
     $limage1[] = JHTML::_('image', $imagePath . 'countries.png', JText::_('COM_JOOMLEAGUE_D_MENU_COUNTRY'));
     $link[] = $link1;
     $label[] = $label1;
     $limage[] = $limage1;
     if ($project->id) {
         $link2 = array();
         $label2 = array();
         $limage2 = array();
         $project_type = $project->project_type;
         if ($project_type == 0) {
             $pane = new stdClass();
             $pane->title = JText::_('COM_JOOMLEAGUE_P_MENU_PROJECT');
             $pane->name = 'PMenu';
             $pane->alert = false;
             $tabs[] = $pane;
             $link2[] = JRoute::_('index.php?option=com_joomleague&task=project.edit&cid[]=' . $project->id);
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_PSETTINGS');
             $limage2[] = JHTML::_('image', $imagePath . 'projects.png', JText::_('COM_JOOMLEAGUE_P_MENU_PSETTINGS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=templates&task=template.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_FES');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_P_MENU_FES'));
             if (isset($project->project_type) && $project->project_type == 'DIVISIONS_LEAGUE') {
                 $link2[] = JRoute::_('index.php?option=com_joomleague&view=divisions&task=division.display');
                 $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_DIVISIONS');
                 $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Divisions.png', JText::_('COM_JOOMLEAGUE_P_MENU_DIVISIONS'));
             }
             if (isset($project->project_type) && ($project->project_type == 'TOURNAMENT_MODE' || $project->project_type == 'DIVISIONS_LEAGUE')) {
                 $link2[] = JRoute::_('index.php?option=com_joomleague&view=treetos&task=treeto.display');
                 $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_TREE');
                 $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Tree.png', JText::_('COM_JOOMLEAGUE_P_MENU_TREE'));
             }
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectposition&task=projectposition.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_POSITIONS');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Positions.png', JText::_('COM_JOOMLEAGUE_P_MENU_POSITIONS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectreferees&task=projectreferee.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_REFEREES');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Referees.png', JText::_('COM_JOOMLEAGUE_P_MENU_REFEREES'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=projectteams&task=projectteam.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_TEAMS');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Teams.png', JText::_('COM_JOOMLEAGUE_P_MENU_TEAMS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=rounds&task=round.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_MATCHDAYS');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-Matchdays.png', JText::_('COM_JOOMLEAGUE_P_MENU_MATCHDAYS'));
             $link2[] = JRoute::_('index.php?option=com_joomleague&view=jlxmlexports&task=jlxmlexport.display');
             $label2[] = JText::_('COM_JOOMLEAGUE_P_MENU_XML_EXPORT');
             $limage2[] = JHTML::_('image', $imagePath . 'icon-16-XMLExportData.png', JText::_('COM_JOOMLEAGUE_P_MENU_XML_EXPORT'));
         }
         $link[] = $link2;
         $label[] = $label2;
         $limage[] = $limage2;
     }
     $link3 = array();
     $label3 = array();
     $limage3 = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_M_MENU_MAINTENANCE');
     $pane->name = 'MMenu';
     $pane->alert = false;
     $tabs[] = $pane;
     /*
     		$link3[]=JRoute::_('index.php?option=com_joomleague&task=settings.edit');
     		$label3[]=JText::_('COM_JOOMLEAGUE_M_MENU_SETTINGS');
     		$limage3[]=JHTML::_('image',$imagePath.'settings.png',JText::_('COM_JOOMLEAGUE_M_MENU_SETTINGS'));
     */
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=jlxmlimports&task=jlxmlimport.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_XML_IMPORT');
     $limage3[] = JHTML::_('image', $imagePath . 'import.png', JText::_('COM_JOOMLEAGUE_M_MENU_XML_IMPORT'));
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=databasetools&task=databasetool.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_TOOLS');
     $limage3[] = JHTML::_('image', $imagePath . 'repair.gif', JText::_('COM_JOOMLEAGUE_M_MENU_TOOLS'));
     $link3[] = JRoute::_('index.php?option=com_joomleague&view=updates&task=update.display');
     $label3[] = JText::_('COM_JOOMLEAGUE_M_MENU_UPDATES');
     $limage3[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_M_MENU_UPDATES'));
     $link[] = $link3;
     $label[] = $label3;
     $limage[] = $limage3;
     $link4 = array();
     $label4 = array();
     $limage4 = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_DIDDIPOELER');
     $pane->name = 'MMenuDiddipoeler';
     $pane->alert = false;
     $tabs[] = $pane;
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_lmo_import', 0)) {
         $link4[] = JRoute::_('index.php?option=com_joomleague&view=jlextlmoimports&task=jlextlmoimports.display');
         $label4[] = JText::_('COM_JOOMLEAGUE_LMO_IMPORT');
         $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_LMO_IMPORT'));
     }
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_dbb_import', 0)) {
         $link4[] = JRoute::_('index.php?option=com_joomleague&view=jlextdbbimports&task=jlextdbbimports.display');
         $label4[] = JText::_('COM_JOOMLEAGUE_DBB_IMPORT');
         $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_DBB_IMPORT'));
     }
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_dfbnet_import', 0)) {
         $link4[] = JRoute::_('index.php?option=com_joomleague&view=jlextdfbnetplayerimport&task=jlextdfbnetplayerimport.display');
         $label4[] = JText::_('COM_JOOMLEAGUE_DFBNET_IMPORT');
         $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_DFBNET_IMPORT'));
     }
     $link4[] = JRoute::_('index.php?option=com_joomleague&view=jlextassociations&task=jlextassociation.display');
     $label4[] = JText::_('COM_JOOMLEAGUE_ASSOCIATION');
     $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_ASSOCIATION'));
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_rosterposition', 0)) {
         $link4[] = JRoute::_('index.php?option=com_joomleague&view=rosterpositions&task=rosterposition.display');
         $label4[] = JText::_('COM_JOOMLEAGUE_ROSTER_POSITION');
         $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_ROSTER_POSITION'));
     }
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_user_fields', 0)) {
         $link4[] = JRoute::_('index.php?option=com_joomleague&view=jlextuserextrafields&task=jlextuserextrafield.display');
         $label4[] = JText::_('COM_JOOMLEAGUE_USER_FIELDS');
         $limage4[] = JHTML::_('image', $imagePath . 'update.png', JText::_('COM_JOOMLEAGUE_USER_FIELDS'));
     }
     $link[] = $link4;
     $label[] = $label4;
     $limage[] = $limage4;
     if (JComponentHelper::getParams('com_joomleague')->get('cfg_be_extension_ringer_import', 0)) {
         $link6 = array();
         $label6 = array();
         $limage6 = array();
         $pane = new stdClass();
         $pane->title = JText::_('COM_JOOMLEAGUE_DIDDIPOELER_RINGEN');
         $pane->name = 'MMenuDiddipoelerRingen';
         $pane->alert = false;
         $tabs[] = $pane;
         $link6[] = JRoute::_('index.php?option=com_joomleague&view=jlextindividualsportringen&task=jlextindividualsportringen.display');
         $label6[] = JText::_('JL_T_MENU_RINGER_FILE_UPLOAD');
         $limage6[] = JHTML::_('image', $imagePath . 'update.png', JText::_('JL_T_MENU_RINGER_FILE_UPLOAD'));
         $link6[] = JRoute::_('index.php?option=com_joomleague&view=jlextringerpositions&task=jlextringerpositions.display');
         $label6[] = JText::_('JL_T_MENU_RINGER_POSITIONS');
         $limage6[] = JHTML::_('image', $imagePath . 'update.png', JText::_('JL_T_MENU_RINGER_POSITIONS'));
         $link[] = $link6;
         $label[] = $label6;
         $limage[] = $limage6;
     }
     $link5 = array();
     $label5 = array();
     $limage5 = array();
     $pane = new stdClass();
     $pane->title = JText::_('COM_JOOMLEAGUE_MENU_PREDICTION_GAMES');
     $pane->name = 'PREDICTIONGAMES';
     $pane->alert = false;
     $tabs[] = $pane;
     $link5[] = JRoute::_('index.php?option=com_joomleague&view=predictiongames&task=predictiongame.display');
     $label5[] = JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONGAMES');
     $limage5[] = JHTML::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONGAMES'));
     $link5[] = JRoute::_('index.php?option=com_joomleague&view=predictiongroups&task=predictiongroup.display');
     $label5[] = JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONGROUPS');
     $limage5[] = JHTML::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONGROUPS'));
     $link5[] = JRoute::_('index.php?option=com_joomleague&view=predictionmembers&task=predictionmember.display');
     $label5[] = JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONMEMBERS');
     $limage5[] = JHTML::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONMEMBERS'));
     $link5[] = JRoute::_('index.php?option=com_joomleague&view=predictiontemplates&task=predictiontemplate.display');
     $label5[] = JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONTEMPLATES');
     $limage5[] = JHTML::_('image', $imagePath . 'icon-16-FrontendSettings.png', JText::_('COM_JOOMLEAGUE_MENU_PREDICTIONTEMPLATES'));
     $link[] = $link5;
     $label[] = $label5;
     $limage[] = $limage5;
     // active pane selector
     if ($project->id) {
         switch (JRequest::getVar('view')) {
             case 'projects':
             case 'leagues':
             case 'seasons':
             case 'sportstypes':
             case 'clubs':
             case 'teams':
             case 'persons':
             case 'eventtypes':
             case 'statistics':
             case 'positions':
             case 'playgrounds':
                 $active = 0;
                 break;
             case 'settings':
             case 'updates':
             case 'jlxmlimports':
             case 'databasetools':
                 $active = 2;
                 break;
             case 'jlextlmoimport':
                 $active = 3;
                 break;
             case 'predictiongames':
             case 'predictionmembers':
             case 'predictiontemplates':
             case 'predictiongroups':
                 $active = 4;
                 break;
                 break;
             default:
                 $active = JRequest::getInt("active", 1);
         }
     } else {
         switch (JRequest::getVar('view')) {
             case 'projects':
             case 'leagues':
             case 'seasons':
             case 'sportstypes':
             case 'clubs':
             case 'teams':
             case 'persons':
             case 'eventtypes':
             case 'statistics':
             case 'positions':
             case 'playgrounds':
                 $active = 0;
                 break;
             case 'settings':
             case 'updates':
             case 'jlxmlimports':
             case 'databasetools':
                 $active = 1;
                 break;
             case 'jlextlmoimport':
                 $active = 2;
                 break;
             case 'predictiongames':
             case 'predictionmembers':
             case 'predictiontemplates':
             case 'predictiongroups':
                 $active = 3;
                 break;
             default:
                 $active = JRequest::getInt("active", 0);
         }
     }
     $mdlJoomleague = JModel::getInstance('Joomleague', 'JoomleagueModel');
     $versions = $mdlJoomleague->getVersion();
     //if ($versions) {$version=$versions[0]->version;} else {$version='';}
     $this->assignRef('version', $version);
     $this->assignRef('link', $link);
     $this->assignRef('tabs', $tabs);
     $this->assignRef('label', $label);
     $this->assignRef('lists', $lists);
     $this->assignRef('active', $active);
     $this->assignRef('limage', $limage);
     $this->assignRef('project', $project);
     $this->assignRef('sports_type_id', $sports_type_id);
     $this->assignRef('management', $management);
     parent::display('admin');
 }
Exemplo n.º 11
0
 function _displayEditlineup($tpl)
 {
     $option = JRequest::getCmd('option');
     $app = JFactory::getApplication();
     $project_id = $app->getUserState($option . 'project');
     $document = JFactory::getDocument();
     $tid = JRequest::getVar('team', '0');
     $params = JComponentHelper::getParams($option);
     $default_name_format = $params->get("name_format");
     $default_name_dropdown_list_order = $params->get("cfg_be_name_dropdown_list_order", "lastname");
     // add the js script
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JUri::base() . 'components/com_joomleague/assets/js/startinglineup.js?v=' . $version);
     $model = $this->getModel();
     $teams = $model->getMatchTeams();
     if (is_null($teams)) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_TEAM_MATCH') . '<br /><br />');
         return false;
     }
     $teamname = $tid == $teams->projectteam1_id ? $teams->team1 : $teams->team2;
     $this->_handlePreFillRoster($teams, $model, $params, $tid, $teamname);
     // get starters
     $starters = $model->getRoster($tid);
     $starters_id = array_keys($starters);
     // get players not already assigned to starter
     $not_assigned = $model->getTeamPlayers($tid, $starters_id, $default_name_dropdown_list_order);
     if (!$not_assigned && !$starters_id) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_PLAYERS_MATCH') . '<br /><br />');
         return false;
     }
     $projectpositions = $model->getProjectPositions();
     if (!$projectpositions) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_POS') . '<br /><br />');
         return false;
     }
     // build select list for not assigned players
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         if ($p->jerseynumber > 0) {
             $jerseynumber = '[' . $p->jerseynumber . '] ';
         } else {
             $jerseynumber = '';
         }
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
             case 'position':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, '(' . JText::_($p->positionname) . ') - ' . $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
         }
     }
     $lists['team_players'] = JHtml::_('select.genericlist', $not_assigned_options, 'roster[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // build position select
     $selectpositions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_IN_POSITION'));
     $selectpositions = array_merge($selectpositions, $model->getProjectPositionsOptions(0, 1));
     $lists['projectpositions'] = JHtml::_('select.genericlist', $selectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', NULL, false, true);
     // build player select for substitutions
     // starters + came in (because of multiple substitutions possibility in amateur soccer clubs for example)
     $substitutions = $model->getSubstitutions($tid);
     $starters = array_merge($starters, $substitutions[$tid]);
     // not assigned players + went out (because of multiple substitutions possibility in amateur soccer clubs for example)
     $not_assigned = array_merge($not_assigned, $substitutions[$tid]);
     // filter out duplicates $starters
     $new_starters = array();
     $exclude = array("");
     for ($i = 0; $i <= count($starters) - 1; $i++) {
         if (!in_array(trim($starters[$i]->value), $exclude)) {
             $new_starters[] = $starters[$i];
             $exclude[] = trim($starters[$i]->value);
         }
     }
     // filter out duplicates $not_assigned
     $new_not_assigned = array();
     $exclude = array("");
     for ($i = 0; $i <= count($not_assigned) - 1; $i++) {
         if (array_key_exists('came_in', $not_assigned[$i]) && $not_assigned[$i]->came_in == 1) {
             if (!in_array(trim($not_assigned[$i]->in_for), $exclude)) {
                 $new_not_assigned[] = $not_assigned[$i];
                 $exclude[] = trim($not_assigned[$i]->in_for);
             }
         } elseif (!array_key_exists('came_in', $not_assigned[$i])) {
             if (!in_array(trim($not_assigned[$i]->value), $exclude)) {
                 $new_not_assigned[] = $not_assigned[$i];
                 $exclude[] = trim($not_assigned[$i]->value);
             }
         }
     }
     $playersoptions_subs_out = array();
     $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
     $i = 0;
     foreach ((array) $new_starters as $player) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 if (array_key_exists('came_in', $player)) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_IN'));
                     }
                 }
                 $playersoptions_subs_out[] = JHtml::_('select.option', $player->value, JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 break;
             case 'position':
                 if (array_key_exists('came_in', $player)) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_out[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_IN'));
                     }
                 }
                 $playersoptions_subs_out[] = JHtml::_('select.option', $player->value, '(' . JText::_($player->positionname) . ') - ' . JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 break;
         }
     }
     $playersoptions_subs_in = array();
     $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
     $i = 0;
     foreach ((array) $new_not_assigned as $player) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 if (array_key_exists('came_in', $player) && $player->came_in == 1 && $player->in_for > 0) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_OUT'));
                     }
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->in_for, JoomleagueHelper::formatName(null, $player->out_firstname, $player->out_nickname, $player->out_lastname, $default_name_format));
                 } elseif (!array_key_exists('came_in', $player)) {
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->value, JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 }
                 break;
             case 'position':
                 if (array_key_exists('came_in', $player) && $player->came_in == 1 && $player->in_for > 0) {
                     $i++;
                     if ($i == 1) {
                         $playersoptions_subs_in[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_ELUSUBST_SELECT_PLAYER_ALREADY_OUT'));
                     }
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->in_for, '(' . JText::_($player->positionname_out) . ') - ' . JoomleagueHelper::formatName(null, $player->out_firstname, $player->out_nickname, $player->out_lastname, $default_name_format));
                 } elseif (!array_key_exists('came_in', $player)) {
                     $playersoptions_subs_in[] = JHtml::_('select.option', $player->value, '(' . JText::_($player->positionname) . ') - ' . JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format));
                 }
                 break;
         }
     }
     // $lists['all_players']=JHtml::_( 'select.genericlist',$playersoptions,'roster[]',
     // 'id="roster" style="font-size:12px;height:auto;min-width:15em;" class="inputbox" size="4"',
     // 'value','text');
     // generate selection list for each position
     $starters = array();
     foreach ($projectpositions as $position_id => $pos) {
         // get players assigned to this position
         $starters[$position_id] = $model->getRoster($tid, $pos->pposid);
     }
     foreach ($starters as $position_id => $players) {
         $options = array();
         foreach ((array) $players as $p) {
             if ($p->jerseynumber > 0) {
                 $jerseynumber = '[' . $p->jerseynumber . '] ';
             } else {
                 $jerseynumber = '';
             }
             $options[] = JHtml::_('select.option', $p->value, $jerseynumber . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
         }
         $lists['team_players' . $position_id] = JHtml::_('select.genericlist', $options, 'position' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-starters" multiple="true" ', 'value', 'text');
     }
     /**
      * staff positions
      */
     $staffpositions = $model->getProjectStaffPositions();
     // get staff not already assigned to starter
     // echo '<pre>'.print_r($staffpositions,true).'</pre>';
     // assigned staff
     $assigned = $model->getMatchStaffs($tid);
     $assigned_id = array_keys($assigned);
     // not assigned staff
     $not_assigned = $model->getTeamStaffs($tid, $assigned_id, $default_name_dropdown_list_order);
     // build select list for not assigned
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         switch ($default_name_dropdown_list_order) {
             case 'lastname':
             case 'firstname':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
             case 'position':
                 $not_assigned_options[] = JHtml::_('select.option', $p->value, '(' . JText::_($p->positionname) . ') - ' . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
                 break;
         }
     }
     $lists['team_staffs'] = JHtml::_('select.genericlist', $not_assigned_options, 'staff[]', 'style="font-size:12px;height:auto;min-width:15em;" size="18" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // generate selection list for each position
     $options = array();
     foreach ($staffpositions as $position_id => $pos) {
         // get players assigned to this position
         $options = array();
         foreach ($assigned as $staff) {
             if ($staff->project_position_id == $pos->pposid) {
                 $options[] = JHtml::_('select.option', $staff->team_staff_id, JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $default_name_format));
             }
         }
         $lists['team_staffs' . $position_id] = JHtml::_('select.genericlist', $options, 'staffposition' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     $this->match = $teams;
     $this->tid = $tid;
     $this->teamname = $teamname;
     $this->positions = $projectpositions;
     $this->staffpositions = $staffpositions;
     $this->substitutions = $substitutions[$tid];
     $this->playersoptions_subs_out = $playersoptions_subs_out;
     $this->playersoptions_subs_in = $playersoptions_subs_in;
     $this->lists = $lists;
     $this->default_name_format = $default_name_format;
     $this->default_name_dropdown_list_order = $default_name_dropdown_list_order;
     parent::display($tpl);
 }
 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);
     $map_config = $model->getMapConfig();
     $this->assignRef('mapconfig', $map_config);
     // Loads the project-template -settings for the GoogleMap
     $this->assignRef('model', $model);
     $this->assignRef('project', $project);
     $extended = $this->getExtended($this->project->extended, 'project');
     $this->assignRef('extended', $extended);
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('tableconfig', $config);
     $this->assignRef('config', $config);
     if ($this->overallconfig['show_project_rss_feed'] == 1) {
         $mod_name = "mod_jw_srfr";
         $rssfeeditems = '';
         $rssfeedlink = $this->extended->getValue('COM_JOOMLEAGUE_PROJECT_RSS_FEED');
         if ($rssfeedlink) {
             $this->assignRef('rssfeeditems', $model->getRssFeeds($rssfeedlink, $this->overallconfig['rssitems']));
         } else {
             $this->assignRef('rssfeeditems', $rssfeeditems);
         }
     }
     if ($this->config['show_half_of_season'] == 1) {
         $model->part = 1;
         $model->from = 0;
         $model->to = 0;
         unset($model->currentRanking);
         unset($model->previousRanking);
         $model->computeRanking();
         $this->assignRef('firstRank', $model->currentRanking);
         $model->part = 2;
         $model->from = 0;
         $model->to = 0;
         unset($model->currentRanking);
         unset($model->previousRanking);
         $model->computeRanking();
         $this->assignRef('secondRank', $model->currentRanking);
         $model->part = 0;
         unset($model->currentRanking);
         unset($model->previousRanking);
     }
     $model->computeRanking();
     $this->assignRef('round', $model->round);
     $this->assignRef('part', $model->part);
     $this->assignRef('rounds', $rounds);
     $this->assignRef('divisions', $model->getDivisions());
     $this->assignRef('type', $model->type);
     $this->assignRef('from', $model->from);
     $this->assignRef('to', $model->to);
     $this->assignRef('divLevel', $model->divLevel);
     $this->assignRef('currentRanking', $model->currentRanking);
     $this->assignRef('previousRanking', $model->previousRanking);
     $this->assignRef('homeRank', $model->homeRank);
     $this->assignRef('awayRank', $model->awayRank);
     $this->assignRef('current_round', $model->current_round);
     $this->assignRef('teams', $model->getTeamsIndexedByPtid());
     $no_ranking_reason = '';
     if ($this->config['show_notes'] == 1) {
         $ranking_reason = array();
         foreach ($this->teams as $teams) {
             if ($teams->start_points) {
                 if ($teams->start_points < 0) {
                     $color = "red";
                 } else {
                     $color = "green";
                 }
                 $ranking_reason[$teams->name] = '<font color="' . $color . '">' . $teams->name . ': ' . $teams->start_points . ' Punkte Grund: ' . $teams->reason . '</font>';
             }
         }
     }
     if (sizeof($ranking_reason) > 0) {
         $this->assign('ranking_notes', implode(", ", $ranking_reason));
     } else {
         $this->assign('ranking_notes', $no_ranking_reason);
     }
     $this->assignRef('previousgames', $model->getPreviousGames());
     $this->assign('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->assignRef('lists', $lists);
     if (!isset($config['colors'])) {
         $config['colors'] = "";
     }
     $this->assignRef('colors', $model->getColors($config['colors']));
     //$this->assignRef('result', $model->getTeamInfo());
     //		$this->assignRef( 'pageNav', $model->pagenav( "ranking", count( $rounds ), $sr->to ) );
     //		$this->assignRef( 'pageNav2', $model->pagenav2( "ranking", count( $rounds ), $sr->to ) );
     // diddipoeler
     $mdlTeams = JModel::getInstance("Teams", "JoomleagueModel");
     $this->assignRef('allteams', $mdlTeams->getTeams());
     if ($this->config['show_ranking_maps'] == 1) {
         $this->geo = new simpleGMapGeocoder();
         $this->geo->genkml3($project->id, $this->allteams);
         // 	  $this->map = new simpleGMapAPI();
         //   $this->geo = new simpleGMapGeocoder();
         //   $this->map->setWidth($this->mapconfig['width']);
         //   $this->map->setHeight($this->mapconfig['height']);
         //   $this->map->setZoomLevel($this->mapconfig['map_zoom']);
         //   $this->map->setMapType($this->mapconfig['default_map_type']);
         //   $this->map->setBackgroundColor('#d0d0d0');
         //   $this->map->setMapDraggable(true);
         //   $this->map->setDoubleclickZoom(false);
         //   $this->map->setScrollwheelZoom(true);
         //   $this->map->showDefaultUI(false);
         //   $this->map->showMapTypeControl(true, 'DROPDOWN_MENU');
         //   $this->map->showNavigationControl(true, 'DEFAULT');
         //   $this->map->showScaleControl(true);
         //   $this->map->showStreetViewControl(true);
         //   $this->map->setInfoWindowBehaviour('SINGLE_CLOSE_ON_MAPCLICK');
         //   $this->map->setInfoWindowTrigger('CLICK');
         //echo 'allteams <br><pre>'.print_r($this->allteams,true).'</pre><br>';
         foreach ($this->allteams as $row) {
             $address_parts = array();
             if (!empty($row->club_address)) {
                 $address_parts[] = $row->club_address;
             }
             if (!empty($row->club_state)) {
                 $address_parts[] = $row->club_state;
             }
             if (!empty($row->club_location)) {
                 if (!empty($row->club_zipcode)) {
                     $address_parts[] = $row->club_zipcode . ' ' . $row->club_location;
                 } else {
                     $address_parts[] = $row->club_location;
                 }
             }
             if (!empty($row->club_country)) {
                 $address_parts[] = Countries::getShortCountryName($row->club_country);
             }
             $row->address_string = implode(', ', $address_parts);
             //    $this->map->addMarkerByAddress($row->address_string, $row->team_name, '"<a href="'.$row->club_www.'" target="_blank">'.$row->club_www.'</a>"', "http://maps.google.com/mapfiles/kml/pal2/icon49.png");
             /*
             $paramsdata	= $row->club_extended;
             		$paramsdefs	= JLG_PATH_ADMIN . DS . 'assets' . DS . 'extended' . DS . 'club.xml';
             		$extended	= new JLGExtraParams( $paramsdata, $paramsdefs );
             		foreach ( $extended->getGroups() as $key => $groups )
             		{
             		$lat = $extended->get('JL_ADMINISTRATIVE_AREA_LEVEL_1_LATITUDE');
             $lng = $extended->get('JL_ADMINISTRATIVE_AREA_LEVEL_1_LONGITUDE');
             		}
             		
             if ( $lat && $lng )
             {
             $adressecountry_flag = Countries::getCountryFlag($row->club_country);
                 
             //echo JURI::root().'<br>';
             						
             		if ( $row->logo_big )
             {
             $path = JURI::root().$row->logo_big;
             }
             else
             {
             $path = JURI::root().'media/com_joomleague/placeholders/'.'placeholder_150.png';
             }
             
             //echo $path.'<br>';
             						
             $this->map->addMarker($lat, $lng, $row->club_name, $adressecountry_flag.' '.$row->address_string.'<br>',$path);
             }
             */
         }
         //   $document->addScript($this->map->JLprintGMapsJS());
         //   $document->addScriptDeclaration($this->map->JLshowMap(false));
     }
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     // Set page title
     $pageTitle = JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE');
     if (isset($this->project->name)) {
         $pageTitle .= ': ' . $this->project->name;
     }
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
Exemplo n.º 13
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);
 }
 function _displayEditlineup($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $project_id = $mainframe->getUserState($option . 'project');
     $document = JFactory::getDocument();
     $tid = JRequest::getVar('team', '0');
     $params =& JComponentHelper::getParams($option);
     $default_name_format = $params->get("name_format");
     //add the js script
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JURI::base() . 'components/com_joomleague/assets/js/startinglineup.js?v=' . $version);
     $model = $this->getModel();
     $match =& $model->getMatchTeams();
     if (!$match) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_TEAM_MATCH') . '<br /><br />');
     }
     $teamname = $tid == $match->projectteam1_id ? $match->team1 : $match->team2;
     if ($params->get('use_prefilled_match_roster') > 0) {
         $bDeleteCurrrentRoster = $params->get('on_prefill_delete_current_match_roster', 0);
         $prefillType = JRequest::getInt('prefill', 0);
         if ($prefillType == 0) {
             $prefillType = $params->get('use_prefilled_match_roster');
         }
         $projectteam_id = $tid == $match->projectteam1_id ? $match->projectteam1_id : $match->projectteam2_id;
         if ($prefillType == 2) {
             $preFillSuccess = false;
             if (!$model->prefillMatchPlayersWithProjectteamPlayers($projectteam_id, $bDeleteCurrrentRoster)) {
                 if ($model->getError() != '') {
                     JError::raiseWarning(440, '<br />' . $model->getError() . '<br /><br />');
                     return;
                 } else {
                     $preFillSuccess = false;
                 }
             } else {
                 $preFillSuccess = true;
             }
         } elseif ($prefillType == 1) {
             if (!$model->prefillMatchPlayersWithLastMatch($projectteam_id, $bDeleteCurrrentRoster)) {
                 if ($model->getError() != '') {
                     JError::raiseWarning(440, '<br />' . $model->getError() . '<br /><br />');
                     return;
                 } else {
                     $preFillSuccess = false;
                 }
             } else {
                 $preFillSuccess = true;
             }
         }
     }
     // get starters
     $starters = $model->getRoster($tid);
     $starters_id = array_keys($starters);
     // get players not already assigned to starter
     $not_assigned = $model->getTeamPlayers($tid, $starters_id);
     if (!$not_assigned && !$starters_id) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_PLAYERS_MATCH') . '<br /><br />');
         return;
     }
     $projectpositions =& $model->getProjectPositions();
     if (!$projectpositions) {
         JError::raiseWarning(440, '<br />' . JText::_('COM_JOOMLEAGUE_ADMIN_MATCH_NO_POS') . '<br /><br />');
         return;
     }
     // build select list for not assigned players
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         $not_assigned_options[] = JHTML::_('select.option', $p->value, '[' . $p->jerseynumber . '] ' . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format) . ' - (' . JText::_($p->positionname) . ')');
     }
     $lists['team_players'] = JHTML::_('select.genericlist', $not_assigned_options, 'roster[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // build position select
     $selectpositions[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_IN_POSITION'));
     $selectpositions = array_merge($selectpositions, $model->getProjectPositionsOptions(0, 1));
     $lists['projectpositions'] = JHTML::_('select.genericlist', $selectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', NULL, false, true);
     // build player select
     $allplayers = $model->getTeamPlayers($tid);
     $playersoptions = array();
     $playersoptions[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYER'));
     foreach ((array) $allplayers as $player) {
         $playersoptions[] = JHTML::_('select.option', $player->value, JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $default_name_format) . ' - (' . JText::_($player->positionname) . ')');
     }
     $lists['all_players'] = JHTML::_('select.genericlist', $playersoptions, 'roster[]', 'id="roster" style="font-size:12px;height:auto;min-width:15em;" class="inputbox" size="4"', 'value', 'text');
     // generate selection list for each position
     $starters = array();
     foreach ($projectpositions as $position_id => $pos) {
         // get players assigned to this position
         $starters[$position_id] = $model->getRoster($tid, $pos->pposid);
     }
     foreach ($starters as $position_id => $players) {
         $options = array();
         foreach ((array) $players as $p) {
             $options[] = JHTML::_('select.option', $p->value, '[' . $p->jerseynumber . '] ' . JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format));
         }
         $lists['team_players' . $position_id] = JHTML::_('select.genericlist', $options, 'position' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-starters" multiple="true" ', 'value', 'text');
     }
     $substitutions = $model->getSubstitutions($tid);
     /**
      * staff positions
      */
     $staffpositions =& $model->getProjectStaffPositions();
     // get staff not already assigned to starter
     //echo '<pre>'.print_r($staffpositions,true).'</pre>';
     // assigned staff
     $assigned = $model->getMatchStaffs($tid);
     $assigned_id = array_keys($assigned);
     // not assigned staff
     $not_assigned = $model->getTeamStaffs($tid, $assigned_id);
     // build select list for not assigned
     $not_assigned_options = array();
     foreach ((array) $not_assigned as $p) {
         $not_assigned_options[] = JHTML::_('select.option', $p->value, JoomleagueHelper::formatName(null, $p->firstname, $p->nickname, $p->lastname, $default_name_format) . ' - (' . JText::_($p->positionname) . ')');
     }
     $lists['team_staffs'] = JHTML::_('select.genericlist', $not_assigned_options, 'staff[]', 'style="font-size:12px;height:auto;min-width:15em;" size="18" class="inputbox" multiple="true" size="18"', 'value', 'text');
     // generate selection list for each position
     $options = array();
     foreach ($staffpositions as $position_id => $pos) {
         // get players assigned to this position
         $options = array();
         foreach ($assigned as $staff) {
             if ($staff->project_position_id == $pos->pposid) {
                 $options[] = JHTML::_('select.option', $staff->team_staff_id, JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $default_name_format));
             }
         }
         $lists['team_staffs' . $position_id] = JHTML::_('select.genericlist', $options, 'staffposition' . $position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" size="4" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     $this->assignRef('match', $match);
     $this->assignRef('tid', $tid);
     $this->assignRef('teamname', $teamname);
     $this->assignRef('positions', $projectpositions);
     $this->assignRef('staffpositions', $staffpositions);
     $this->assignRef('substitutions', $substitutions[$tid]);
     $this->assignRef('playersoptions', $playersoptions);
     $this->assignRef('lists', $lists);
     $this->assignRef('preFillSuccess', $preFillSuccess);
     // diddipoeler
     $this->assign('show_debug_info', JComponentHelper::getParams($option)->get('show_debug_info', 0));
     $mdlMatchProject = JModel::getInstance('project', 'JoomleagueModel');
     $this->assignRef('eventsprojecttime', $mdlMatchProject->getProjectGameRegularTime($project_id));
     $this->assignRef('starters', $starters);
     parent::display($tpl);
 }
Exemplo n.º 15
0
<?php

/**
 * Joomleague
 *
 * @copyright	Copyright (C) 2006-2015 joomleague.at. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @link		http://www.joomleague.at
 */
defined('_JEXEC') or die;
if (JComponentHelper::getParams('com_joomleague')->get('show_footer', 1)) {
    ?>
	<br />
		<div class="poweredby">
			<?php 
    echo ' :: Powered by ';
    echo JHtml::link('http://www.joomleague.at', 'JoomLeague', array('target' => '_blank'));
    echo ' - ';
    echo JHtml::link('index.php?option=com_joomleague&amp;view=about', sprintf('Version %1$s', JoomleagueHelper::getVersion()));
    echo ' :: ';
    ?>
		</div>
<?php 
}
Exemplo n.º 16
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);
 }
Exemplo 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);
 }
 /**
  * _setJoomLeagueVersion
  *
  * set the version data and actual date, time and
  * Joomla systemName from the joomleague_version table
  *
  * @access private
  * @since  2010-08-26
  *
  * @return array
  */
 private function _setJoomLeagueVersion()
 {
     $exportRoutine = '2010-09-23 15:00:00';
     /*
     		$query = "SELECT CONCAT(major,'.',minor,'.',build,'.',revision) AS version FROM #__joomleague_version ORDER BY date DESC LIMIT 1";
     		$this->_db->setQuery($query);
     		$this->_db->query();
     		if ($this->_db->getNumRows() > 0)
     		{
     			$result = $this->_db->loadAssocList();
     			$result[0]['exportRoutine']=$exportRoutine;
     			$result[0]['exportDate']=date('Y-m-d');
     			$result[0]['exportTime']=date('H:i:s');
     			$result[0]['exportSystem']=JFactory::getConfig()->getValue('config.sitename');
     			$result[0]['object']='JoomLeagueVersion';
     			return $result;
     		}
     		return false;
     */
     $result[0]['version'] = JoomleagueHelper::getVersion();
     $result[0]['exportRoutine'] = $exportRoutine;
     $result[0]['exportDate'] = date('Y-m-d');
     $result[0]['exportTime'] = date('H:i:s');
     $result[0]['exportSystem'] = JFactory::getConfig()->getValue('config.sitename');
     $result[0]['object'] = 'JoomLeagueVersion';
     return $result;
 }
 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);
     // diddipoeler
     $css = 'components/com_joomleague/assets/css/tooltipstyle.css';
     $document->addStyleSheet($css);
     $css = 'components/com_joomleague/assets/css/jquery-easy-tooltip.css';
     $document->addStyleSheet($css);
     $document->addScript(JURI::base(true) . '/components/com_joomleague/assets/js/tooltipscript.js');
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $match = $model->getMatch();
     $this->assignRef('project', $project);
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('match', $match);
     $ret = $model->getMatchText($match->new_match_id);
     $this->assignRef('newmatchtext', $ret->text);
     $ret = $model->getMatchText($match->old_match_id);
     $this->assignRef('oldmatchtext', $ret->text);
     $this->assignRef('round', $model->getRound());
     $this->assignRef('team1', $model->getTeaminfo($this->match->projectteam1_id));
     $this->assignRef('team2', $model->getTeaminfo($this->match->projectteam2_id));
     $this->assignRef('team1_club', $model->getClubinfo($this->team1->club_id));
     $this->assignRef('team2_club', $model->getClubinfo($this->team2->club_id));
     $this->assignRef('matchplayerpositions', $model->getMatchPlayerPositions());
     $this->assignRef('matchplayers', $model->getMatchPlayers());
     $this->assignRef('matchstaffpositions', $model->getMatchStaffPositions());
     $this->assignRef('matchstaffs', $model->getMatchStaff());
     $this->assignRef('matchrefereepositions', $model->getMatchRefereePositions());
     $this->assignRef('matchreferees', $model->getMatchReferees());
     $this->assignRef('matchcommentary', $model->getMatchCommentary());
     $this->assignRef('substitutes', $model->getSubstitutes());
     $this->assignRef('eventtypes', $model->getEventTypes());
     $sortEventsDesc = isset($this->config['sort_events_desc']) ? $this->config['sort_events_desc'] : '1';
     $this->assignRef('matchevents', $model->getMatchEvents($this->match->id, 1, $sortEventsDesc));
     $this->assignRef('playground', $model->getPlayground($this->match->playground_id));
     $this->assignRef('stats', $model->getProjectStats());
     $this->assignRef('playerstats', $model->getMatchStats());
     $this->assignRef('staffstats', $model->getMatchStaffStats());
     $this->assignRef('model', $model);
     $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . DS . 'assets' . DS . 'extended' . DS . 'match.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($match->extended, 'ini');
     $extended =& JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $this->assignRef('extended', $extended);
     $extended2 = $this->getExtended($match->extended, 'match');
     $this->assignRef('extended2', $extended2);
     //$rssfeedlink = $this->extended2->getValue('formation1');
     $this->assignRef('formation1', $this->extended2->getValue('formation1'));
     $this->assignRef('formation2', $this->extended2->getValue('formation2'));
     $schemahome = $this->assignRef('schemahome', $model->getSchemaHome($this->formation1));
     $schemaaway = $this->assignRef('schemaaway', $model->getSchemaAway($this->formation2));
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     $this->assign('use_joomlaworks', JComponentHelper::getParams('com_joomleague')->get('use_joomlaworks', 0));
     if ($this->config['show_pictures'] == 1) {
         // die bilder zum spiel
         $dest = JPATH_ROOT . '/images/com_joomleague/database/matchreport/' . $this->match->id;
         $folder = 'matchreport/' . $this->match->id;
         $images = $model->getMatchPictures($folder);
         if ($images) {
             $this->assignRef('matchimages', $images);
         }
     }
     // Set page title
     $pageTitle = JText::_('COM_JOOMLEAGUE_MATCHREPORT_PAGE_TITLE');
     if (isset($this->team1) and isset($this->team1)) {
         $pageTitle .= ": " . $this->team1->name . " " . JText::_("COM_JOOMLEAGUE_NEXTMATCH_VS") . " " . $this->team2->name;
     }
     $document->setTitle($pageTitle);
     $document->addScript(JURI::base(true) . '/components/com_joomleague/assets/js/highslide.js');
     $document->addStyleSheet(JURI::base(true) . '/components/com_joomleague/assets/css/highslide/highslide.css');
     $js = "hs.graphicsDir = '" . JURI::base(true) . "/components/com_joomleague/assets/css/highslide/graphics/" . "';\n";
     $js .= "hs.outlineType = 'rounded-white';\n";
     $js .= "\n    hs.lang = {\n   cssDirection:     'ltr',\n   loadingText :     'Lade...',\n   loadingTitle :    'Klick zum Abbrechen',\n   focusTitle :      'Klick um nach vorn zu bringen',\n   fullExpandTitle : 'Zur Originalgr&ouml;&szlig;e erweitern',\n   fullExpandText :  'Vollbild',\n   creditsText :     '',\n   creditsTitle :    '',\n   previousText :    'Voriges',\n   previousTitle :   'Voriges (Pfeiltaste links)',\n   nextText :        'N&auml;chstes',\n   nextTitle :       'N&auml;chstes (Pfeiltaste rechts)',\n   moveTitle :       'Verschieben',\n   moveText :        'Verschieben',\n   closeText :       'Schlie&szlig;en',\n   closeTitle :      'Schlie&szlig;en (Esc)',\n   resizeTitle :     'Gr&ouml;&szlig;e wiederherstellen',\n   playText :        'Abspielen',\n   playTitle :       'Slideshow abspielen (Leertaste)',\n   pauseText :       'Pause',\n   pauseTitle :      'Pausiere Slideshow (Leertaste)',\n   number :          'Bild %1/%2',\n   restoreTitle :    'Klick um das Bild zu schlie&szlig;en, klick und ziehe um zu verschieben. Benutze Pfeiltasten für vor und zurück.'\n};\n\n    \n    \n";
     $document->addScriptDeclaration($js);
     /*    
         $startfade = 1000;
         
         $js = "jQuery(document).ready(function() {\n ";
         foreach ($this->matchplayers as $player)
         {
         $js .= ' jQuery("#'.$player->person_id.'").slideToggle("'.$startfade.'");\n';
         $startfade += 1000;
         }
         $js .= "});\n";
         $document->addScriptDeclaration( $js );    
     */
     parent::display($tpl);
 }
Exemplo n.º 20
0
 public function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     //support for global client side lang res
     JHtml::_('behavior.formvalidation');
     // Load the modal behavior script.
     JHtml::_('behavior.modal', 'a.modal');
     $lang = JFactory::getLanguage();
     $jllang = new JLLanguage();
     $jllang->setLanguage($lang);
     $props = $jllang->getProperties();
     $strings =& $props['strings'];
     foreach ($strings as $key => $value) {
         if ($app->isAdmin()) {
             if (strpos($key, 'COM_JOOMLEAGUE_ADMIN_' . strtoupper($this->getName()) . '_CSJS') !== false) {
                 JText::script($key, true);
             }
         } else {
             if (strpos($key, 'COM_JOOMLEAGUE_' . strtoupper($this->getName()) . '_CSJS_') !== false) {
                 JText::script($key, true);
             }
         }
     }
     // General Joomleague CSS include
     $file = JPATH_COMPONENT . '/assets/css/joomleague.css';
     if (file_exists(JPath::clean($file))) {
         $document->addStyleSheet($this->baseurl . '/components/' . $option . '/assets/css/joomleague.css?v=' . $version);
     }
     // Genereal CSS include per view
     $file = JPATH_COMPONENT . '/assets/css/' . $this->getName() . '.css';
     if (file_exists(JPath::clean($file))) {
         //add css file
         $document->addStyleSheet($this->baseurl . '/components/' . $option . '/assets/css/' . $this->getName() . '.css?v=' . $version);
     }
     // General Joomleague JS include
     $file = JPATH_COMPONENT . '/assets/js/joomleague.js';
     if (file_exists(JPath::clean($file))) {
         $js = $this->baseurl . '/components/' . $option . '/assets/js/joomleague.js?v=' . $version;
         $document->addScript($js);
     }
     // General JS include per view
     self::includeLanguageStrings();
     $file = JPATH_COMPONENT . '/assets/js/' . $this->getName() . '.js';
     if (file_exists(JPath::clean($file))) {
         $js = $this->baseurl . '/components/' . $option . '/assets/js/' . $this->getName() . '.js?v=' . $version;
         $document->addScript($js);
     }
     //extension management
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $JLGPATH_EXTENSION = JPATH_COMPONENT_SITE . '/extensions/' . $extension;
         //General extension CSS include
         $file = $JLGPATH_EXTENSION . '/assets/css/' . $extension . '.css';
         if (file_exists(JPath::clean($file))) {
             $document->addStyleSheet($this->baseurl . '/components/' . $option . '/extensions/' . $extension . '/assets/css/' . $extension . '.css?v=' . $version);
         }
         //CSS override
         $file = $JLGPATH_EXTENSION . '/assets/css/' . $this->getName() . '.css';
         if (file_exists(JPath::clean($file))) {
             //add css file
             $document->addStyleSheet($this->baseurl . '/components/' . $option . '/extensions/' . $extension . '/assets/css/' . $this->getName() . '.css?v=' . $version);
         }
         //General extension JS include
         $file = $JLGPATH_EXTENSION . '/assets/js/' . $extension . '.js';
         if (file_exists(JPath::clean($file))) {
             //add js file
             $document->addScript($this->baseurl . '/components/' . $option . '/extensions/' . $extension . '/assets/js/' . $extension . '.js?v=' . $version);
         }
         //JS override
         $file = $JLGPATH_EXTENSION . '/assets/js/' . $this->getName() . '.js';
         if (file_exists(JPath::clean($file))) {
             //add js file
             $document->addScript($this->baseurl . '/components/' . $option . '/extensions/' . $extension . '/assets/js/' . $this->getName() . '.js?v=' . $version);
         }
         if ($app->isAdmin()) {
             $JLGPATH_EXTENSION = JPATH_COMPONENT_SITE . '/extensions/' . $extension . '/admin';
             //General extension CSS include
             $file = $JLGPATH_EXTENSION . '/assets/css/' . $extension . '.css';
             if (file_exists(JPath::clean($file))) {
                 $document->addStyleSheet($this->baseurl . '/../components/' . $option . '/extensions/' . $extension . '/admin/assets/css/' . $extension . '.css?v=' . $version);
             }
             //CSS override
             $file = $JLGPATH_EXTENSION . '/assets/css/' . $this->getName() . '.css';
             if (file_exists(JPath::clean($file))) {
                 //add css file
                 $document->addStyleSheet($this->baseurl . '/../components/' . $option . '/extensions/' . $extension . '/admin/assets/css/' . $this->getName() . '.css?v=' . $version);
             }
             //General extension JS include
             $file = $JLGPATH_EXTENSION . '/assets/js/' . $extension . '.js';
             if (file_exists(JPath::clean($file))) {
                 //add js file
                 $document->addScript($this->baseurl . '/../components/' . $option . '/extensions/' . $extension . '/admin/assets/js/' . $extension . '.js?v=' . $version);
             }
             //JS override
             $file = $JLGPATH_EXTENSION . '/assets/js/' . $this->getName() . '.js';
             if (file_exists(JPath::clean($file))) {
                 //add js file
                 $document->addScript($this->baseurl . '/../components/' . $option . '/extensions/' . $extension . '/admin/assets/js/' . $this->getName() . '.js?v=' . $version);
             }
         }
     }
     parent::display($tpl);
 }
 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);
     //add js file
     JHTML::_('behavior.mootools');
     $model = $this->getModel();
     $matches = $model->getMatches();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $mdlRound = JModel::getInstance("Round", "JoomleagueModel");
     $roundcode = $mdlRound->getRoundcode($model->roundid);
     $rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
     $this->assignRef('project', $project);
     $lists = array();
     if (isset($this->project)) {
         $this->assignRef('overallconfig', $model->getOverallConfig());
         $this->assignRef('config', array_merge($this->overallconfig, $config));
         $this->assignRef('teams', $model->getTeamsIndexedByPtid());
         $this->assignRef('showediticon', $model->getShowEditIcon());
         $this->assignRef('division', $model->getDivision());
         $this->assignRef('matches', $matches);
         $this->assignRef('roundid', $model->roundid);
         $this->assignRef('roundcode', $roundcode);
         $this->assignRef('rounds', $model->getRounds());
         $this->assignRef('favteams', $model->getFavTeams($project));
         $this->assignRef('projectevents', $model->getProjectEvents());
         $this->assignRef('model', $model);
         $this->assignRef('isAllowed', $model->isAllowed());
         $extended = $this->getExtended($this->project->extended, 'project');
         $this->assignRef('extended', $extended);
         if ($this->overallconfig['show_project_rss_feed'] == 1) {
             $mod_name = "mod_jw_srfr";
             $rssfeeditems = '';
             $rssfeedlink = $this->extended->getValue('COM_JOOMLEAGUE_PROJECT_RSS_FEED_LIVE_RESULTS');
             if ($rssfeedlink) {
                 $this->assignRef('rssfeeditems', $model->getRssFeeds($rssfeedlink, $this->overallconfig['rssitems']));
             } else {
                 $this->assignRef('rssfeeditems', $rssfeeditems);
             }
             //echo 'rssfeed<br><pre>'.print_r($rssfeedlink,true).'</pre><br>';
             /*
                 if ( $rssfeedlink )
                 {
                 $srfrFeedsArray 							= explode(",",$rssfeedlink);
                 $perFeedItems 								= $this->overallconfig['perFeedItems'];
                 $totalFeedItems 							= $this->overallconfig['totalFeedItems'];
                 $feedTimeout									= $this->overallconfig['feedTimeout'];
                 $this->assignRef( 'feedTitle' , $this->overallconfig['feedTitle'] );
                 $this->assignRef( 'feedFavicon' , $this->overallconfig['feedFavicon'] );
                 $this->assignRef( 'feedItemTitle' , $this->overallconfig['feedItemTitle'] );
                 $this->assignRef( 'feedItemDate' , $this->overallconfig['feedItemDate'] );
                 $feedItemDateFormat						= $this->overallconfig['feedItemDateFormat'];
                 $this->assignRef( 'feedItemDescription' , $this->overallconfig['feedItemDescription'] );
                 $feedItemDescriptionWordlimit	= $this->overallconfig['feedItemDescriptionWordlimit'];
                 $feedItemImageHandling				= $this->overallconfig['feedItemImageHandling'];
                 $feedItemImageResizeWidth			= $this->overallconfig['feedItemImageResizeWidth'];
                 $feedItemImageResampleQuality	= $this->overallconfig['feedItemImageResampleQuality'];
                 $this->assignRef( 'feedItemReadMore' , $this->overallconfig['feedItemReadMore'] );
                 
                 $this->assignRef( 'feedsBlockPreText' ,	$this->overallconfig['feedsBlockPreText'] );
                 $this->assignRef( 'feedsBlockPostText' , $this->overallconfig['feedsBlockPostText'] );
                 $this->assignRef( 'feedsBlockPostLink' , $this->overallconfig['feedsBlockPostLink'] );
                 $feedsBlockPostLinkURL				= $this->overallconfig['feedsBlockPostLinkURL'];
                 $feedsBlockPostLinkTitle			= $this->overallconfig['feedsBlockPostLinkTitle'];
                 $srfrCacheTime								= $this->overallconfig['srfrCacheTime'];
                 $cacheLocation								= 'cache'.DS.$mod_name;
                 $this->assignRef( 'rssfeedoutput',SimpleRssFeedReaderHelper::getFeeds($srfrFeedsArray,$totalFeedItems,$perFeedItems,$feedTimeout,$feedItemDateFormat,$feedItemDescriptionWordlimit,$cacheLocation,$srfrCacheTime,$feedItemImageHandling,$feedItemImageResizeWidth,$feedItemImageResampleQuality,$this->feedFavicon) );
                 $css = JURI::root().'components/com_joomleague/assets/css/rssfeedstyle.css';
             		$document->addStyleSheet($css); 
             		}
             */
         }
         $lists['rounds'] = JHTML::_('select.genericlist', $rounds, 'current_round', 'class="inputbox" size="1" onchange="joomleague_changedoc(this);', 'value', 'text', $project->current_round);
         $this->assignRef('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;
         }
     }
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     // Set page title
     $pageTitle = JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE');
     if (isset($this->project->name)) {
         $pageTitle .= ': ' . $this->project->name;
     }
     $document->setTitle($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);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     // Get a reference 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();
     $match = $model->getMatch();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $this->assignRef('project', $model->getProject());
     $this->assignRef('config', $config);
     $this->assignRef('tableconfig', $tableconfig);
     $this->assignRef('overallconfig', $model->getOverallConfig());
     if (!isset($this->overallconfig['seperator'])) {
         $this->overallconfig['seperator'] = ":";
     }
     $this->assignRef('match', $match);
     if ($match) {
         $newmatchtext = "";
         if ($match->new_match_id > 0) {
             $ret = $model->getMatchText($match->new_match_id);
             $matchTime = JoomleagueHelperHtml::showMatchTime($ret, $this->config, $this->overallconfig, $this->project);
             $matchDate = JHTML::date($ret->match_date, JText::_('COM_JOOMLEAGUE_NEXTMATCH_GAMES_DATE'));
             $newmatchtext = $matchDate . " " . $matchTime . ", " . $ret->t1name . " - " . $ret->t2name;
         }
         $this->assignRef('newmatchtext', $newmatchtext);
         $prevmatchtext = "";
         if ($match->old_match_id > 0) {
             $ret = $model->getMatchText($match->old_match_id);
             $matchTime = JoomleagueHelperHtml::showMatchTime($ret, $this->config, $this->overallconfig, $this->project);
             $matchDate = JHTML::date($ret->match_date, JText::_('COM_JOOMLEAGUE_NEXTMATCH_GAMES_DATE'));
             $prevmatchtext = $matchDate . " " . $matchTime . ", " . $ret->t1name . " - " . $ret->t2name;
         }
         $this->assignRef('oldmatchtext', $prevmatchtext);
         $this->assignRef('teams', $model->getMatchTeams());
         $this->assignRef('referees', $model->getReferees());
         $this->assignRef('playground', $model->getPlayground($this->match->playground_id));
         $this->assignRef('homeranked', $model->getHomeRanked());
         $this->assignRef('awayranked', $model->getAwayRanked());
         $this->assignRef('chances', $model->getChances());
         $this->assignRef('home_highest_home_win', $model->getHomeHighestHomeWin());
         $this->assignRef('away_highest_home_win', $model->getAwayHighestHomeWin());
         $this->assignRef('home_highest_home_def', $model->getHomeHighestHomeDef());
         $this->assignRef('away_highest_home_def', $model->getAwayHighestHomeDef());
         $this->assignRef('home_highest_away_win', $model->getHomeHighestAwayWin());
         $this->assignRef('away_highest_away_win', $model->getAwayHighestAwayWin());
         $this->assignRef('home_highest_away_def', $model->getHomeHighestAwayDef());
         $this->assignRef('away_highest_away_def', $model->getAwayHighestAwayDef());
         $games = $model->getGames();
         $gamesteams = $model->getTeamsFromMatches($games);
         $this->assignRef('games', $games);
         $this->assignRef('gamesteams', $gamesteams);
         $previousx =& $this->get('previousx');
         $teams =& $this->get('TeamsIndexedByPtid');
         $this->assignRef('previousx', $previousx);
         $this->assignRef('allteams', $teams);
         $this->assignRef('matchcommentary', $model->getMatchCommentary());
     }
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     // Set page title
     $pageTitle = JText::_('COM_JOOMLEAGUE_NEXTMATCH_PAGE_TITLE');
     if (isset($this->teams)) {
         $pageTitle .= ": " . $this->teams[0]->name . " " . JText::_("COM_JOOMLEAGUE_NEXTMATCH_VS") . " " . $this->teams[1]->name;
     }
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
 protected function setDocument()
 {
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript(JURI::root() . $this->script);
 }
    }
    if ($this->config['show_staff'] == 1) {
        if ($this->config['show_staff_layout'] == 'staff_standard') {
            echo $this->loadTemplate('staff');
        } else {
            if ($this->config['show_staff_layout'] == 'staff_card') {
                $document = JFactory::getDocument();
                $option = JRequest::getCmd('option');
                $version = urlencode(JoomleagueHelper::getVersion());
                $document->addStyleSheet($this->baseurl . '/components/' . $option . '/assets/css/' . $this->getName() . '_card.css?v=' . $version);
                echo $this->loadTemplate('staff_card');
            } else {
                if ($this->config['show_staff_layout'] == 'staff_johncage') {
                    $document = JFactory::getDocument();
                    $option = JRequest::getCmd('option');
                    $version = urlencode(JoomleagueHelper::getVersion());
                    $document->addStyleSheet($this->baseurl . '/components/' . $option . '/assets/css/' . $this->getName() . '_johncage.css?v=' . $version);
                    echo $this->loadTemplate('staff_johncage');
                    //            echo $this->loadTemplate('person_staff');
                }
            }
        }
    }
} else {
    echo "<p>Project team could not be determined</p>";
}
echo "<div>";
echo $this->loadTemplate('backbutton');
echo $this->loadTemplate('footer');
echo "</div>";
?>
Exemplo n.º 25
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);
 }
<?php

defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal');
$view = JRequest::getVar("view");
$view = ucfirst(strtolower($view));
$cfg_help_server = JComponentHelper::getParams('com_joomleague')->get('cfg_help_server', '');
$modal_popup_width = JComponentHelper::getParams('com_joomleague')->get('modal_popup_width', 0);
$modal_popup_height = JComponentHelper::getParams('com_joomleague')->get('modal_popup_height', 0);
if (JComponentHelper::getParams('com_joomleague')->get('show_footer', 0)) {
    ?>
	<br />
		<div align='center' style='font-size:9px;float:none;clear:both; '>
			<?php 
    echo ' :: Extended Version Powered by ';
    echo JHTML::link('http://www.fussballineuropa.de', 'Fussball in Europa', array('target' => '_blank'));
    echo ' - ';
    echo JHTML::link('index.php?option=com_joomleague&amp;view=about', sprintf('Version %1$s (diddipoeler)', JoomleagueHelper::getVersion()));
    echo ' :: ';
    echo ' :: Hilfeseite ';
    $send = '<a class="modal" rel="{handler: \'iframe\', size: {x: ' . $modal_popup_width . ', y: ' . $modal_popup_height . '}}" ' . ' href="' . $cfg_help_server . 'Frontend:' . $view . '">' . JText::_('Onlinehilfe') . '</a>';
    //$send="<a href=\"".$cfg_help_server."Frontend:".$view."\" target=\"_blank\" onclick=\"window.open(this.href,this.target,'width=".$modal_popup_width.",height=".$modal_popup_height."'); return false;\">Popup öffnen</a>";
    echo $send;
    ?>
		</div>
<?php 
}
 function display($tpl = null)
 {
     JHTML::_('behavior.mootools');
     $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 = JModel::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->assignRef('project', $resultsmodel->getProject());
     $this->assignRef('overallconfig', $resultsmodel->getOverallConfig());
     $this->assignRef('config', array_merge($this->overallconfig, $config));
     $this->assignRef('tableconfig', $rankingconfig);
     $this->assignRef('params', $params);
     $this->assignRef('showediticon', $resultsmodel->getShowEditIcon());
     $this->assignRef('division', $resultsmodel->getDivision());
     $this->assignRef('divisions', $rankingmodel->getDivisions());
     $this->assignRef('divLevel', $rankingmodel->divLevel);
     $this->assignRef('matches', $resultsmodel->getMatches());
     $this->assignRef('round', $resultsmodel->roundid);
     $this->assignRef('roundid', $resultsmodel->roundid);
     $this->assignRef('roundcode', $roundcode);
     $rounds = $resultsmodel->getRoundOptions();
     $options = $this->getRoundSelectNavigation($rounds);
     $this->assignRef('matchdaysoptions', $options);
     $this->assignRef('currenturl', JoomleagueHelperRoute::getResultsRankingRoute($resultsmodel->getProject()->slug, $this->round));
     $this->assignRef('rounds', $resultsmodel->getRounds());
     $this->assignRef('favteams', $resultsmodel->getFavTeams($this->project));
     $this->assignRef('projectevents', $resultsmodel->getProjectEvents());
     $this->assignRef('model', $resultsmodel);
     $this->assignRef('isAllowed', $resultsmodel->isAllowed());
     $this->assignRef('type', $rankingmodel->type);
     $this->assignRef('from', $rankingmodel->from);
     $this->assignRef('to', $rankingmodel->to);
     $this->assignRef('currentRanking', $rankingmodel->currentRanking);
     $this->assignRef('previousRanking', $rankingmodel->previousRanking);
     $this->assignRef('homeRank', $rankingmodel->homeRank);
     $this->assignRef('awayRank', $rankingmodel->awayRank);
     $this->assignRef('current_round', $rankingmodel->current_round);
     $this->assignRef('teams', $rankingmodel->getTeamsIndexedByPtid());
     $this->assignRef('previousgames', $rankingmodel->getPreviousGames());
     $this->assign('action', $uri->toString());
     //rankingcolors
     if (!isset($this->config['colors'])) {
         $this->config['colors'] = "";
     }
     $this->assignRef('colors', $rankingmodel->getColors($this->config['colors']));
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     $this->assign('use_joomlaworks', JComponentHelper::getParams('com_joomleague')->get('use_joomlaworks', 0));
     // Set page title
     $pageTitle = $this->params->get('what_to_show_first', 0) == 0 ? JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE') : JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE');
     if (isset($this->project->name)) {
         $pageTitle .= ' - ' . $this->project->name;
     }
     $document->setTitle($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);
 }
 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);
     // Joomleague model
     $model = $this->getModel();
     $user = JFactory::getUser();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('match', $model->getMatch());
     $this->assignRef('matchid', $model->getMatchID());
     $isAllowed = $model->isAllowed() || $model->isMatchAdmin($this->matchid, $user->id);
     $config = $model->getTemplateConfig("player");
     $this->assignRef('config', $config);
     $this->assignRef('isAllowed', $isAllowed);
     $this->assignRef('hometeam', $model->getHomeTeam());
     $this->assignRef('team1_id', $model->getHomeTeamID());
     $this->assignRef('projectteam1_id', $model->getHomeProjectTeamID());
     // diddipoeler
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     $this->assignRef('eventsprojecttime', $model->getProjectGameRegularTime($this->project->id));
     $matchcommentary =& $model->getMatchCommentary();
     $this->assignRef('matchcommentary', $matchcommentary);
     $this->assignRef('awayteam', $model->getAwayTeam());
     $this->assignRef('team2_id', $model->getAwayTeamID());
     $this->assignRef('projectteam2_id', $model->getAwayProjectTeamID());
     $this->assignRef('rosters', $model->createRosterArray());
     $this->assignRef('homeroster', $model->getRosterOptions($this->projectteam1_id));
     $this->assignRef('awayroster', $model->getRosterOptions($this->projectteam2_id));
     $this->assignRef('homeplayeroptions', $model->getPlayerPositionOptions($this->projectteam1_id));
     $this->assignRef('awayplayeroptions', $model->getPlayerPositionOptions($this->projectteam2_id));
     $this->assignRef('homeinoutoptions', $model->getInOutOptions($this->projectteam1_id));
     $this->assignRef('awayinoutoptions', $model->getInOutOptions($this->projectteam2_id));
     $this->assignRef('post_add', $model->getPositionAdd());
     $this->assignRef('homesubstitutions', $model->getSubstitutions($this->projectteam1_id));
     $this->assignRef('awaysubstitutions', $model->getSubstitutions($this->projectteam2_id));
     $this->assignRef('eventtypes', $model->getEventTypes());
     $this->assignRef('homeoptions', $model->getHomeOptions());
     $this->assignRef('awayoptions', $model->getAwayOptions());
     $this->assignRef('matchevents', $model->getMatchEvents($model->getMatchID(), 1));
     $this->assignRef('playerprojectpositions', $model->getProjectPositions(0, 1));
     $this->assignRef('staffprojectpositions', $model->getProjectPositions(0, 2));
     $this->assignRef('refereeprojectpositions', $model->getProjectPositions(0, 3));
     $this->assignRef('homeplayersoptions', $model->getPlayersOptions($this->projectteam1_id));
     $this->assignRef('awayplayersoptions', $model->getPlayersOptions($this->projectteam2_id));
     $this->assignRef('overallconfig', $model->getTemplateConfig('overall'));
     $lists = array();
     // teams
     $teamlist = array();
     $teamlist[] = JHTML::_('select.option', $this->projectteam1_id, $this->hometeam->name);
     $teamlist[] = JHTML::_('select.option', $this->projectteam2_id, $this->awayteam->name);
     $lists['teams'] = JHTML::_('select.genericlist', $teamlist, 'team_id', 'class="inputbox select-team"');
     // events
     $events = $model->getEventsOptions($this->project->id);
     $eventlist = array();
     $eventlist = array_merge($eventlist, $events);
     unset($events);
     $lists['events'] = JHTML::_('select.genericlist', $eventlist, 'event_type_id', 'class="inputbox select-event"');
     // player
     $lists['team_players']['home'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamPlayerPersons($this->projectteam1_id), 'hplayer[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     //echo '<br /><pre>~'.print_r($lists['team_players']['home'],true).'~</pre><br />';
     $lists['team_players']['away'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamPlayerPersons($this->projectteam2_id), 'aplayer[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     //echo '<br /><pre>~'.print_r($lists['team_players']['away'],true).'~</pre><br />';
     foreach ($this->playerprojectpositions as $project_position_id => $pos) {
         // get home players assigned to this position
         $options = array();
         foreach ($model->getMatchPlayers($this->projectteam1_id) as $player) {
             if ($player->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $player->teamplayer_id, $nameStr);
             }
         }
         $lists['team_players' . $project_position_id]['home'] = JHTML::_('select.genericlist', $options, 'hplayerposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
         // get away players assigned to this position
         $options = array();
         foreach ($model->getMatchPlayers($this->projectteam2_id) as $player) {
             if ($player->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $player->firstname, $player->nickname, $player->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $player->teamplayer_id, $nameStr);
             }
         }
         $lists['team_players' . $project_position_id]['away'] = JHTML::_('select.genericlist', $options, 'aplayerposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // staff
     $lists['team_staffs']['home'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamStaffPersons($this->projectteam1_id), 'hstaff[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     $lists['team_staffs']['away'] = JHTML::_('select.genericlist', $model->getNotAssignedTeamStaffPersons($this->projectteam2_id), 'astaff[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     foreach ($this->staffprojectpositions as $project_position_id => $pos) {
         // get home staff assigned to this position
         $options = array();
         foreach ($model->getMatchStaffs($this->projectteam1_id) as $staff) {
             if ($staff->project_position_id == $project_position_id) {
                 // TODO: Aad thinks that the order of home and away staff should be the same...
                 $nameStr = JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $staff->team_staff_id, $nameStr);
             }
         }
         $lists['team_staffs' . $project_position_id]['home'] = JHTML::_('select.genericlist', $options, 'hstaffposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
         // get away staff assigned to this position
         $options = array();
         foreach ($model->getMatchStaffs($this->projectteam2_id) as $staff) {
             if ($staff->project_position_id == $project_position_id) {
                 $nameStr = JoomleagueHelper::formatName(null, $staff->firstname, $staff->nickname, $staff->lastname, $config["name_format"]);
                 $options[] = JHTML::_('select.option', $staff->team_staff_id, $nameStr);
             }
         }
         $lists['team_staffs' . $project_position_id]['away'] = JHTML::_('select.genericlist', $options, 'astaffposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // referees
     $referees = $this->project->teams_as_referees ? $model->getNotAssignedProjectRefereeTeams() : $model->getNotAssignedProjectReferees();
     $lists['project_referees'] = JHTML::_('select.genericlist', $referees, 'referee[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox" multiple="true" size="10"', 'value', 'text');
     unset($referees);
     foreach ($this->refereeprojectpositions as $project_position_id => $pos) {
         // get match referees assigned to this position
         $options = array();
         $referees = $this->project->teams_as_referees ? $model->getMatchRefereeTeams() : $model->getMatchReferees();
         foreach ($referees as $referee) {
             if ($referee->project_position_id == $project_position_id) {
                 if ($this->project->teams_as_referees) {
                     $options[] = JHTML::_('select.option', $referee->project_referee_id, $referee->teamname);
                 } else {
                     $nameStr = JoomleagueHelper::formatName(null, $referee->firstname, $referee->nickname, $referee->lastname, $config["name_format"]);
                     $options[] = JHTML::_('select.option', $referee->project_referee_id, $nameStr);
                 }
             }
         }
         $lists['match_referees' . $project_position_id] = JHTML::_('select.genericlist', $options, 'refereeposition' . $project_position_id . '[]', 'style="font-size:12px;height:auto;min-width:15em;" class="inputbox position-staff" multiple="true" ', 'value', 'text');
     }
     // substitutions
     $lists['home_projectpositions'] = $model->getSelectPositions('home');
     $lists['away_projectpositions'] = $model->getSelectPositions('away');
     $this->assignRef('lists', $lists);
     $pageTitle = JText::_('COM_JOOMLEAGUE_EDIT_EVENTS_TITLE');
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
 function _displayPopulate($tpl)
 {
     $app = JFactory::getApplication();
     $document = Jfactory::getDocument();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $projectws =& $this->get('Data', 'projectws');
     $document->setTitle(JText::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TITLE'));
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript('components/com_joomleague/assets/js/populate.js?v=' . $version);
     $lists = array();
     $options = array(JHTML::_('select.option', 0, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_SINGLE_ROUND_ROBIN')), JHTML::_('select.option', 1, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_DOUBLE_ROUND_ROBIN')), JHTML::_('select.option', 2, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_TOURNAMENT_ROUND_ROBIN')));
     $lists['scheduling'] = JHTML::_('select.genericlist', $options, 'scheduling', '', 'value', 'text');
     //TODO-add error message - what if there are no teams assigned to the project
     $teams = $this->get('projectteams');
     $options = array();
     foreach ($teams as $t) {
         $options[] = JHTML::_('select.option', $t->projectteam_id, $t->text);
     }
     $lists['teamsorder'] = JHTML::_('select.genericlist', $options, 'teamsorder[]', 'multiple="multiple" size="20"');
     $this->assignRef('projectws', $projectws);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('lists', $lists);
     $this->addToolbar_Populate();
     parent::display($tpl);
 }