Exemplo n.º 1
0
 /**
  * Return formatted match time
  *
  * @param object $game
  * @param array $config
  * @param array $overallconfig
  * @param object $project
  * @return string html
  */
 public static function showMatchTime(&$game, &$config, &$overallconfig, &$project)
 {
     $output = '';
     if (!isset($overallconfig['time_format'])) {
         $overallconfig['time_format'] = 'H:i';
     }
     $timeSuffix = JText::_('COM_JOOMLEAGUE_GLOBAL_CLOCK');
     if ($timeSuffix == 'COM_JOOMLEAGUE_GLOBAL_CLOCK') {
         $timeSuffix = '%1$s h';
     }
     if ($game->match_date) {
         $matchTime = JoomleagueHelper::getMatchTime($game, $overallconfig['time_format']);
         if ($config['show_time_suffix'] == 1) {
             $output .= sprintf($timeSuffix, $matchTime);
         } else {
             $output .= $matchTime;
         }
         $config['mark_now_playing'] = isset($config['mark_now_playing']) ? $config['mark_now_playing'] : 0;
         if ($config['mark_now_playing']) {
             $totalMatchDuration = $project->halftime * ($project->game_parts - 1) + $project->game_regular_time;
             if ($project->allow_add_time == 1 && $game->team1_result == $game->team2_result) {
                 $totalMatchDuration += $project->add_time;
             }
             $project_tz = new DateTimeZone($game->timezone);
             $startTimestamp = JoomleagueHelper::getMatchStartTimestamp($game);
             $startTime = new DateTime($startTimestamp, $project_tz);
             $endTime = new DateTime($startTimestamp, $project_tz);
             $endTime->add(new DateInterval('PT' . $totalMatchDuration . 'M'));
             $now = new DateTime('now', $project_tz);
             if ($now >= $startTime && $now <= $endTime) {
                 $match_begin = $output . ' ';
                 $title = str_replace('%STARTTIME%', $match_begin, trim(htmlspecialchars($config['mark_now_playing_alt_text'])));
                 $title = str_replace('%ACTUALTIME%', self::mark_now_playing($thistime, $match_stamp, $config, $project), $title);
                 $styletext = '';
                 if (isset($config['mark_now_playing_blink']) && $config['mark_now_playing_blink']) {
                     $styletext = ' style="text-decoration:blink"';
                 }
                 $output = '<b><i><acronym title="' . $title . '"' . $styletext . '>';
                 $output .= $config['mark_now_playing_text'];
                 $output .= '</acronym></i></b>';
             }
         }
     } else {
         $matchTime = '--&nbsp;:&nbsp;--';
         if ($config['show_time_suffix']) {
             $output .= sprintf($timeSuffix, $matchTime);
         } else {
             $output .= $matchTime;
         }
     }
     return $output;
 }
Exemplo n.º 2
0
            echo JoomleagueHelper::getMatchDate($match, JText::_($params->get('date_format')));
            ?>
							</td>
						<?php 
        }
        ?>
				
						<?php 
        if ($params->get('show_time', 1)) {
            ?>
							<td class="mod_jl_results_time<?php 
            echo $params->get('moduleclass_sfx');
            ?>
">
								<?php 
            echo JoomleagueHelper::getMatchTime($match, JText::_($params->get('time_format')));
            ?>
							</td>
						<?php 
        }
        ?>
				
						<td class="mod_jl_results_opponent_left<?php 
        echo $params->get('moduleclass_sfx');
        ?>
">
							<?php 
        if (isset($teams[$match->projectteam1_id])) {
            if ($params->get('teamlink') != '0') {
                echo JHtml::link(modJLGResultsHelper::getTeamLink($teams[$match->projectteam1_id], $params, $list['project']), $teams[$match->projectteam1_id]->{$nametype});
            } else {
Exemplo n.º 3
0
 public function formatMatches(&$matches)
 {
     if ($this->params->get('lastsortorder') == 'desc') {
         $matches = $this->sortObject($matches, 'desc', 'alreadyplayed');
     }
     if ($this->params->get('upcoming_first', 1) == 1) {
         $matches = $this->sortObject($matches, 'asc', 'upcoming');
     }
     $matches = $this->sortObject($matches, 'asc', 'actplaying');
     $matches = $this->sortObject($matches, 'asc', 'live');
     $teams = $this->getTeamsFromMatches($matches);
     $rows = array();
     $useicons = $this->iconpath;
     $cnt = JRequest::getVar('nr', 0, 'default', 'POST');
     $hteam = false;
     $ateam = false;
     foreach ((array) $matches as $key => $match) {
         //echo 'NOW(): '.JHtml::_('date', $match->currenttime, $this->params->get('dateformat').' '.$this->params->get('timeformat'),0).'<br />';
         if ($match->projectteam1_id) {
             $hteam = $teams[$match->projectteam1_id];
         }
         if ($match->projectteam2_id) {
             $ateam = $teams[$match->projectteam2_id];
         }
         //$matches[$key]->live = false;
         $rows[$match->match_id]['type'] = 'undefined';
         if ($this->params->get('show_status_notice') == 1) {
             if ($match->live != 'z') {
                 $rows[$match->match_id]['type'] = 'live';
             } else {
                 $matches[$key]->live = false;
                 if ($match->actplaying != 'z') {
                     $rows[$match->match_id]['type'] = 'actplaying';
                 } elseif ($match->alreadyplayed != 0) {
                     $rows[$match->match_id]['type'] = 'alreadyplayed';
                 } elseif ($match->upcoming != 'z') {
                     $rows[$match->match_id]['type'] = 'upcoming';
                 }
             }
         }
         $rows[$match->match_id]['date'] = JoomleagueHelper::getMatchDate($match, JText::_($this->params->get('dateformat')));
         if ($useicons) {
             $rows[$match->match_id]['date'] = JHtml::_('image', $this->iconpath . 'date.png', 'Datum', array('title' => 'Datum', 'height' => '16', 'width' => '16')) . ' ' . $rows[$match->match_id]['date'];
         }
         $rows[$match->match_id]['time'] = JoomleagueHelper::getMatchTime($match, JText::_($this->params->get('timeformat')));
         if ($useicons) {
             $rows[$match->match_id]['time'] = JHtml::_('image', $this->iconpath . 'time.png', 'Beginn', array('title' => 'Beginn', 'height' => '16', 'width' => '16')) . ' ' . $rows[$match->match_id]['time'];
         }
         if (isset($match->meeting)) {
             $rows[$match->match_id]['meeting'] = JHtml::_('date', $match->meetingtime, $this->params->get('timeformat'), null);
             if ($useicons) {
                 $rows[$match->match_id]['meeting'] = JHtml::_('image', $this->iconpath . 'time_go.png', 'Treffpunkt', array('title' => 'Treffpunkt', 'height' => '16', 'width' => '16')) . ' ' . $rows[$match->match_id]['meeting'];
             }
         }
         $rows[$match->match_id]['project_id'] = $match->project_id;
         $rows[$match->match_id]['totaltime'] = $match->totaltime;
         $rows[$match->match_id]['round_id'] = $match->round_id;
         $rows[$match->match_id]['hometeam'] = $this->getTeamDetails($hteam, $cnt);
         $rows[$match->match_id]['homescore'] = !is_null($match->team1_result) ? $match->team1_result : '-';
         $rows[$match->match_id]['homeover'] = $this->buildTeamLinks($hteam, $cnt);
         $rows[$match->match_id]['awayteam'] = $this->getTeamDetails($ateam, $cnt);
         $rows[$match->match_id]['awayscore'] = !is_null($match->team2_result) ? $match->team2_result : '-';
         $rows[$match->match_id]['awayover'] = $this->buildTeamLinks($ateam, $cnt);
         $this->createMatchInfo($rows[$match->match_id], $match);
         $this->formatHeading($rows[$match->match_id], $match);
         $this->formatResults($rows[$match->match_id], $match);
         $this->createMatchLinks($rows[$match->match_id], $match);
         $this->createLocation($rows[$match->match_id], $match, $hteam);
         $this->createAjaxMenu($match, $cnt);
         $rows[$match->match_id]['ajax'] = $match->ajax;
         $cnt++;
     }
     return $rows;
 }
Exemplo n.º 4
0
             $playgroundname = $match->club_playground_name;
             $playground_id = $match->club_playground_id;
         }
     }
     if ($params->get('show_playground_link')) {
         $link = JoomleagueHelperRoute::getPlaygroundRoute($match->project_id, $playground_id);
         $playgroundname = JHtml::link($link, JText::sprintf('%1$s', $playgroundname));
     } else {
         $playgroundname = JText::sprintf('%1$s', $playgroundname);
     }
     $textdiv .= $playgroundname . '</div>';
 }
 $textdiv .= '<div class="jlplplanedate">';
 $textdiv .= JoomleagueHelper::getMatchDate($match, $dateformat);
 $textdiv .= " " . JText::_('MOD_JOOMLEAGUE_PLAYGROUNDPLAN_START_TIME') . " ";
 $textdiv .= JoomleagueHelper::getMatchTime($match, $timeformat);
 $textdiv .= '</div>';
 if ($params->get('show_project_name', 0)) {
     $textdiv .= '<div class="jlplplaneleaguename">';
     $textdiv .= $match->project_name;
     $textdiv .= '</div>';
 }
 if ($params->get('show_league_name', 0)) {
     $textdiv .= '<div class="jlplplaneleaguename">';
     $textdiv .= $match->league_name;
     $textdiv .= '</div>';
 }
 $textdiv .= '<div>';
 $textdiv .= '<div class="jlplplanetname">';
 if ($params->get('show_club_logo')) {
     $team1logo = modJLGPlaygroundplanHelper::getTeamLogo($match->team1);
Exemplo n.º 5
0
"
										value="<?php 
    echo $row->match_number;
    ?>
" size="6" tabindex="1" class="inputbox" />
							</td>
							<td class="center">
								<?php 
    $date = JoomleagueHelper::getMatchDate($row, JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_DATE_FORMAT'));
    echo JHtml::calendar($date, 'match_date' . $row->id, 'match_date' . $row->id, JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_DATE_FORMAT_CAL'), 'size="9"  tabindex="2" ondblclick="copyValue(\'match_date\')"
														 onchange="document.getElementById(\'cb' . $i . '\').checked=true"');
    ?>
							</td>
							<td class="left">
								<?php 
    $time = JoomleagueHelper::getMatchTime($row);
    ?>
								<input ondblclick="copyValue('match_time')" onchange="document.getElementById('cb<?php 
    echo $i;
    ?>
').checked=true" type="text" name="match_time<?php 
    echo $row->id;
    ?>
"
										value="<?php 
    echo $time;
    ?>
" size="4" maxlength="5" tabindex="3" class="inputbox" />

								<a	href="javascript:void(0)"
									onclick="switchMenu('present<?php 
Exemplo n.º 6
0
        foreach ($games as $game) {
            $home = $this->gamesteams[$game->team1];
            $away = $this->gamesteams[$game->team2];
            ?>
					<tr class="sectiontableentry1">
						<?php 
            if ($this->config['show_match_number'] == 1) {
                $match_number = '<td class="nowrap">';
                $match_number .= $game->match_number;
                $match_number .= '</td>';
                echo $match_number;
            }
            ?>
						<td>
							<?php 
            echo JoomleagueHelper::getMatchTime($game);
            ?>
						</td>
						<td class="nowrap">
							<?php 
            echo $game->project_name;
            ?>
						</td>
						<?php 
            if ($this->config['show_logo'] == 1) {
                $model = $this->getModel();
                $home_logo = $model->getTeamLogo($home->id);
                $away_logo = $model->getTeamLogo($away->id);
                $teamA = '<td align="right" valign="top" class="nowrap">';
                $teamA .= " " . JoomleagueModelProject::getClubIconHtml($home_logo[0], 1);
                $teamA .= '</td>';