require JPATH_SITE . DS . 'libraries' . DS . 'joomla' . DS . 'html' . DS . 'editor.php';
// load javascripts
$document = JFactory::getDocument();
JHTML::_('behavior.mootools');
$version = urlencode(JoomleagueHelper::getVersion());
$document->addScript(JURI::root() . 'components/com_joomleague/assets/js/eventsediting.js?v=' . $version);
?>
<div style="overflow:auto;">
	<a name="jl_top" id="jl_top"></a>
	<!-- section header e.g. ranking, results etc. -->
	<table width='100%' class='contentpaneopen'>
		<tr>
			<td class="contentheading">
				<?php 
if ($this->roundid > 0) {
    JoomleagueHelperHtml::showMatchdaysTitle(JText::_('Round results'), $this->roundid, $this->config);
    if ($this->showediticon) {
        $link = JoomleagueHelperRoute::getResultsRoute($this->project->id, $this->roundid);
        $imgTitle = JText::_('Exit Edit Mode');
        $desc = JHTML::image('media/com_joomleague/jl_images/edit_exit.png', $imgTitle, array(' title' => $imgTitle));
        echo '&nbsp;';
        echo JHTML::link($link, $desc);
    }
}
?>
			</td>
			<td><?php 
echo JoomleagueHelperHtml::getRoundSelectNavigation(TRUE);
?>
</td>
		</tr>
    $title = JText::_('COM_JOOMLEAGUE_RESULTS_ROUND_RESULTS');
    if (isset($this->division)) {
        $title = JText::sprintf('COM_JOOMLEAGUE_RESULTS_ROUND_RESULTS2', '<i>' . $this->division->name . '</i>');
    }
    JoomleagueHelperHtml::showMatchdaysTitle($title, $this->roundid, $this->config);
    if ($this->showediticon) {
        $link = JoomleagueHelperRoute::getResultsRoute($this->project->id, $this->roundid, $this->model->divisionid, $this->model->mode, $this->model->order, $this->config['result_style_edit']);
        $imgTitle = JText::_('COM_JOOMLEAGUE_RESULTS_ENTER_EDIT_RESULTS');
        $desc = JHTML::image('media/com_joomleague/jl_images/edit.png', $imgTitle, array(' title' => $imgTitle));
        echo ' ';
        echo JHTML::link($link, $desc);
    }
} else {
    //1 request for current round
    // seems to be this shall show a plan of matches of a team???
    JoomleagueHelperHtml::showMatchdaysTitle(JText::_('COM_JOOMLEAGUE_RESULTS_PLAN'), 0, $this->config);
}
?>
		</td>
			<?php 
if ($this->config['show_matchday_dropdown'] == 1) {
    ?>
	            <td class="contentheading" style="text-align:right; font-size: 100%;">
			<?php 
    echo JoomleagueHelperHtml::getRoundSelectNavigation(FALSE);
    ?>
				</td>
    	    <?php 
}
?>
		</tr>
defined('_JEXEC') or die;
if ($this->config['show_sectionheader'] == 1) {
    ?>
		<table width="100%" class="contentpaneopen">
		<tr>
			<td class="contentheading">
				<?php 
    if ($this->roundid > 0) {
        $title = JText::_('COM_JOOMLEAGUE_RESULTS_ROUND_RESULTS');
        if (isset($this->division)) {
            $title = JText::sprintf('COM_JOOMLEAGUE_RESULTS_ROUND_RESULTS2', '<i>' . $this->division->name . '</i>');
        }
        JoomleagueHelperHtml::showMatchdaysTitle($title, $this->roundid, $this->config, $this->project, $this->overallconfig);
        if ($this->showediticon) {
            $link = JoomleagueHelperRoute::getResultsRoute($this->project->id, $this->roundid, $this->divisionid, 0, 0, 'match.display');
            $imgTitle = JText::_('COM_JOOMLEAGUE_RESULTS_ENTER_EDIT_RESULTS');
            $desc = JHtml::image('media/com_joomleague/jl_images/edit.png', $imgTitle, array(' title' => $imgTitle));
            echo ' ';
            echo JHtml::link($link, $desc);
        }
    } else {
        //1 request for current round
        // seems to be this shall show a plan of matches of a team???
        JoomleagueHelperHtml::showMatchdaysTitle(JText::_('COM_JOOMLEAGUE_RESULTS_PLAN') . " - " . $team->name, 0, $this->config, $this->project, $this->overallconfig);
    }
    ?>
			</td>
		</tr>
	</table>
	<?php 
}