function _displayDefault($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $uri = JFactory::getURI();
     $node =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $model = $this->getModel();
     $projectws =& $this->get('Data', 'projectws');
     $treetows =& $this->get('Data', 'treetows');
     //build the html options for teams
     $team_id[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'));
     if ($projectteams =& $model->getProjectTeamsOptions()) {
         $team_id = array_merge($team_id, $projectteams);
     }
     $lists['team'] = $team_id;
     unset($team_id);
     $style = 'style="background-color: #dddddd; ';
     $style .= 'border: 0px solid white;';
     $style .= 'font-weight: normal; ';
     $style .= 'font-size: 8pt; ';
     $style .= 'width: 150px; ';
     $style .= 'font-family: verdana; ';
     $style .= 'text-align: center;"';
     $path = 'media/com_joomleague/treebracket/onwhite/';
     // build the html radio for adding into new round / exist round
     $createYesNo = array(0 => JText::_('JNO'), 1 => JText::_('JYES'));
     $createLeftRight = array(0 => JText::_('L'), 1 => JText::_('R'));
     $ynOptions = array();
     $lrOptions = array();
     foreach ($createYesNo as $key => $value) {
         $ynOptions[] = JHTMLSelect::option($key, $value);
     }
     foreach ($createLeftRight as $key => $value) {
         $lrOptions[] = JHTMLSelect::option($key, $value);
     }
     $lists['addToRound'] = JHTMLSelect::radiolist($ynOptions, 'addToRound', 'class="inputbox"', 'value', 'text', 1);
     // build the html radio for auto publish new matches
     $lists['autoPublish'] = JHTMLSelect::radiolist($ynOptions, 'autoPublish', 'class="inputbox"', 'value', 'text', 0);
     // build the html radio for Left or Right redepth
     $lists['LRreDepth'] = JHTMLSelect::radiolist($lrOptions, 'LRreDepth', 'class="inputbox"', 'value', 'text', 0);
     // build the html radio for create new treeto
     $lists['createNewTreeto'] = JHTMLSelect::radiolist($ynOptions, 'createNewTreeto', 'class="inputbox"', 'value', 'text', 1);
     $this->assignRef('lists', $lists);
     $this->assignRef('node', $node);
     //	$this->assignRef('roundcode',$roundcode);
     $this->assignRef('style', $style);
     $this->assignRef('path', $path);
     $this->assignRef('projectws', $projectws);
     $this->assignRef('treetows', $treetows);
     $this->assignRef('total', $total);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('request_url', $uri->toString());
     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);
 }