예제 #1
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Initialize variables.
     $options = array();
     $varname = (string) $this->element['varname'];
     $project_id = JRequest::getVar($varname);
     if (is_array($project_id)) {
         $project_id = $project_id[0];
     }
     if ($project_id) {
         $options = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true);
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 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);
 }
예제 #3
0
 public function roundsoptions()
 {
     $req = JRequest::getVar('required', false);
     $required = $req == 'true' || $req == '1' ? true : false;
     echo json_encode((array) JoomleagueHelper::getRoundsOptions(JRequest::getInt('p'), 'ASC', $required));
 }
예제 #4
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);
 }
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $params =& JComponentHelper::getParams($option);
     $filter_state = $mainframe->getUserStateFromRequest($option . 'mc_filter_state', 'filter_state', '', 'word');
     $filter_order = $mainframe->getUserStateFromRequest($option . 'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'mc_filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($option . 'mc_search', 'search', '', 'string');
     $search_mode = $mainframe->getUserStateFromRequest($option . 'mc_search_mode', 'search_mode', '', 'string');
     $division = $mainframe->getUserStateFromRequest($option . 'mc_division', 'division', '', 'string');
     $project_id = $mainframe->getUserState($option . 'project');
     $search = JString::strtolower($search);
     $matches =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $model = $this->getModel();
     // state filter
     $lists['state'] = JHTML::_('grid.state', $filter_state);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $lists['search_mode'] = $search_mode;
     $projectws =& $this->get('Data', 'projectws');
     $roundws =& $this->get('Data', 'roundws');
     //build the html options for teams
     foreach ($matches as $row) {
         if ($row->divhomeid == '') {
             $row->divhomeid = 0;
         }
         if ($row->divawayid == '') {
             $row->divawayid = 0;
         }
         $teams[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'));
         $divhomeid = 0;
         //apply the filter only if both teams are from the same division
         //teams are not from the same division in tournament mode with divisions
         if ($row->divhomeid == $row->divawayid) {
             $divhomeid = $row->divhomeid;
         } else {
             $row->divhomeid = 0;
             $row->divawayid = 0;
         }
         if ($projectteams =& $model->getProjectTeamsOptions($divhomeid)) {
             $teams = array_merge($teams, $projectteams);
         }
         $lists['teams_' + $divhomeid] = $teams;
         unset($teams);
     }
     //build the html selectlist for rounds
     $model = $this->getModel('projectws');
     $ress = JoomleagueHelper::getRoundsOptions($model->_id, 'ASC', true);
     foreach ($ress as $res) {
         $datum = JoomleagueHelper::convertDate($res->round_date_first, 1) . ' - ' . JoomleagueHelper::convertDate($res->round_date_last, 1);
         $project_roundslist[] = JHTML::_('select.option', $res->id, sprintf("%s (%s)", $res->name, $datum));
     }
     $lists['project_rounds'] = JHTML::_('select.genericList', $project_roundslist, 'rid[]', 'class="inputbox" ' . 'onChange="document.getElementById(\'short_act\').value=\'rounds\';' . 'document.roundForm.submit();" ', 'value', 'text', $roundws->id);
     $lists['project_rounds2'] = JHTML::_('select.genericList', $project_roundslist, 'rid', 'class="inputbox" ', 'value', 'text', $roundws->id);
     // diddipoeler rounds for change in match
     $project_change_roundslist = array();
     if ($ress =& JoomleagueHelper::getRoundsOptions($model->_id, 'ASC', true)) {
         $project_change_roundslist = array_merge($project_change_roundslist, $ress);
     }
     $lists['project_change_rounds'] = $project_change_roundslist;
     unset($project_change_roundslist);
     //build the html selectlist for matches
     $overall_config = $model->getTemplateConfig('overall');
     if (isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] || isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) {
         $match_list = array();
         $mdd[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_MATCH'));
         foreach ($matches as $row) {
             $mdd[] = JHTML::_('select.option', 'index3.php?option=com_joomleague&controller=match&task=editEvents&cid[0]=' . $row->id, $row->team1 . '-' . $row->team2);
         }
         $RosterEventMessage = isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] ? JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_LINEUP') : '';
         if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) {
             if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_substitution']) {
                 $RosterEventMessage .= ' / ';
             }
             $RosterEventMessage .= JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_EVENTS');
         }
         $RosterEventMessage .= $RosterEventMessage != '' ? ':' : '';
         $lists['RosterEventMessage'] = $RosterEventMessage;
         $lists['round_matches'] = JHTML::_('select.genericList', $mdd, 'mdd', 'id="mdd" class="inputbox" onchange="jl_load_new_match_events(this,\'eventscontainer\')"', 'value', 'text', '0');
     }
     //build the html options for extratime
     $match_result_type[] = JHTMLSelect::option('0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_RT'));
     $match_result_type[] = JHTMLSelect::option('1', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_OT'));
     $match_result_type[] = JHTMLSelect::option('2', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_SO'));
     $lists['match_result_type'] = $match_result_type;
     unset($match_result_type);
     //build the html options for massadd create type
     $createTypes = array(0 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD'), 1 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_1'), 2 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_2'));
     $ctOptions = array();
     foreach ($createTypes as $key => $value) {
         $ctOptions[] = JHTMLSelect::option($key, $value);
     }
     $lists['createTypes'] = JHTMLSelect::genericlist($ctOptions, 'ct[]', 'class="inputbox" onchange="javascript:displayTypeView();"', 'value', 'text', 1, 'ct');
     unset($createTypes);
     // build the html radio for adding into one round / all rounds
     $createYesNo = array(0 => JText::_('JNO'), 1 => JText::_('JYES'));
     $ynOptions = array();
     foreach ($createYesNo as $key => $value) {
         $ynOptions[] = JHTMLSelect::option($key, $value);
     }
     $lists['addToRound'] = JHTMLSelect::radiolist($ynOptions, 'addToRound', 'class="inputbox"', 'value', 'text', 0);
     // build the html radio for auto publish new matches
     $lists['autoPublish'] = JHTMLSelect::radiolist($ynOptions, 'autoPublish', 'class="inputbox"', 'value', 'text', 0);
     //build the html options for divisions
     $divisions[] = JHTMLSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION'));
     $mdlDivisions = JModel::getInstance("divisions", "JoomLeagueModel");
     if ($res =& $mdlDivisions->getDivisions($project_id)) {
         $divisions = array_merge($divisions, $res);
     }
     $lists['divisions'] = $divisions;
     unset($divisions);
     $this->assignRef('division', $division);
     $this->assignRef('user', JFactory::getUser());
     $this->assignRef('lists', $lists);
     $this->assignRef('matches', $matches);
     $this->assignRef('ress', $ress);
     $this->assignRef('projectws', $projectws);
     $this->assignRef('roundws', $roundws);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('prefill', $params->get('use_prefilled_match_roster', 0));
     $this->addToolbar();
     parent::display($tpl);
 }
 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);
 }
예제 #7
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $model = $this->getModel();
     $lists = array();
     $projectws = $this->get('Data', 'project');
     $teamws = $this->get('Data', 'project_team');
     //get the project_player data of the project_team
     $project_player = $this->get('Data');
     $isNew = $project_player->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_TEAMPLAYER_THEPLAYER'), $project_player->name);
         $mainframe->redirect('index.php?option=com_joomleague', $msg);
     }
     // Edit or Create?
     if ($isNew) {
         $project_player->order = 0;
     }
     //build the html select list for positions
     #$selectedvalue = ( $project_player->position_id ) ? $project_player->position_id : $default_person->position_id;
     $selectedvalue = $project_player->project_position_id;
     $projectpositions = array();
     $projectpositions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_POSITION'));
     if ($res = $model->getProjectPositions()) {
         $projectpositions = array_merge($projectpositions, $res);
     }
     $lists['projectpositions'] = JHtml::_('select.genericlist', $projectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', $selectedvalue);
     unset($projectpositions);
     $matchdays = JoomleagueHelper::getRoundsOptions($projectws->id, 'ASC', false);
     // injury details
     $myoptions = array();
     $myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
     $myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
     $lists['injury'] = JHtml::_('select.radiolist', $myoptions, 'injury', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury);
     unset($myoptions);
     $lists['injury_date'] = JHtml::_('select.genericlist', $matchdays, 'injury_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury_date);
     $lists['injury_end'] = JHtml::_('select.genericlist', $matchdays, 'injury_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury_end);
     // suspension details
     $myoptions = array();
     $myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
     $myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
     $lists['suspension'] = JHtml::_('select.radiolist', $myoptions, 'suspension', 'class="radio" size="1"', 'value', 'text', $project_player->suspension);
     unset($myoptions);
     $lists['suspension_date'] = JHtml::_('select.genericlist', $matchdays, 'suspension_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->suspension_date);
     $lists['suspension_end'] = JHtml::_('select.genericlist', $matchdays, 'suspension_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->suspension_end);
     // away details
     $myoptions = array();
     $myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
     $myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
     $lists['away'] = JHtml::_('select.radiolist', $myoptions, 'away', 'class="inputbox" size="1"', 'value', 'text', $project_player->away);
     unset($myoptions);
     $lists['away_date'] = JHtml::_('select.genericlist', $matchdays, 'away_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->away_date);
     $lists['away_end'] = JHtml::_('select.genericlist', $matchdays, 'away_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->away_end);
     $this->form = $this->get('form');
     $extended = $this->getExtended($project_player->extended, 'teamplayer');
     $this->extended = $extended;
     #$this->default_person = $default_person;
     $this->projectws = $projectws;
     $this->teamws = $teamws;
     $this->lists = $lists;
     $this->project_player = $project_player;
     $this->addToolbar();
     parent::display($tpl);
 }
 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');
 }
 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);
 }
예제 #10
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);
 }
            ?>
' />
				<?php 
            echo JHTML::_('form.token');
            ?>


				<table class='blog' cellpadding='0' cellspacing='0'>
					<tr>
						<td class='sectiontableheader'><b><?php 
            echo JText::_('COM_JOOMLEAGUE_PRED_ENTRY_SUBTITLE_01');
            ?>
</b></td>
						<td class='sectiontableheader' style='text-align:right; ' width='20%' nowrap='nowrap' >
							<?php 
            $rounds = JoomleagueHelper::getRoundsOptions($predictionProject->project_id);
            //							$htmlRoundsOptions = JHTML::_('select.genericlist',$rounds,'current_round','class="inputbox" size="1" onchange="document.forms[\'resultsRoundSelector\'].r.value=this.value;submit()"','value','text',$this->model->roundID);
            $htmlRoundsOptions = JHTML::_('select.genericlist', $rounds, 'r', 'class="inputbox" size="1" onchange="this.form.submit();"', 'value', 'text', $this->model->roundID);
            echo JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_SUBTITLE_02', $htmlRoundsOptions, $this->model->createProjectSelector($this->model->_predictionProjectS, $predictionProject->project_id));
            ?>
						</td>
					</tr>
				</table><br />
				<?php 
            echo JHTML::_('form.token');
            ?>
			</form>
			<?php 
            $formName = 'predictionDoTipp' . $predictionProject->project_id;
            ?>
			<form	name='<?php 
예제 #12
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);
 }
예제 #13
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');
 }