Your IP : 216.73.216.68


Current Path : /home/s/u/n/sunflowe/www2/j15/modules/mod_jweather/tmpl/
Upload File :
Current File : /home/s/u/n/sunflowe/www2/j15/modules/mod_jweather/tmpl/default.php

<?php
/**
 * @version		$Id:default.php 14 2008-02-06 09:35:30Z p0l0 $
 * @package		Joomla jWeather
 * @author		Marco Neumann
 * @copyright	Copyright (c) 2008, 2009, Marco Neumann
 * @license		GNU/GPL, see COPYING  
 * 
 * This file is part of jWeather.
 * 
 * jWeather is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * jWeather is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with jWeather.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

//no direct access
defined('_JEXEC') or die('Restricted access');

/**
 * We need mootools for fix png in IE
 */
JHTML::_('behavior.mootools');

/**
 * Load Document and add stylesheet
 */
$doc = &JFactory::getDocument();
$doc->addStyleSheet( JURI::base() . 'modules/mod_jweather/tmpl/mod_jweather.css' );
?>
<div id="jweather_<?php echo $params->get('idname'); ?>" class="jweather">

	<table border="0">
		<?php if (isset($weatherData['desc'])) { ?>
			<?php $locality = explode(',', $weatherData['desc']); ?>
			<tr>
				<td class="jweather_desc" colspan="<?php echo $weatherData['numDays']; ?>">
					<?php echo JText::_('Weather for').' '.$locality[0]; ?>
				</td>
			</tr>
		<?php } ?>
		<?php if (isset($weatherData['icon'])) { ?>
			<tr>
				<?php foreach ($weatherData['icon'] as $icons): ?>
					<td class="jweather_icon">
						<img class="jweather_icon" src="<?php echo $icons['image']; ?>" alt="<?php echo JText::_($icons['alt']); ?>" />
					</td>
				<?php endforeach; ?>	
			</tr>
			<?php
				/**
				 * IE6 PNG Transparency Fix
				 */
			?>
			<!--[if lte IE 6]>
			<script type="text/javascript">
				function doFix()
				{
					var blankImg = '<?php echo JURI::base(); ?>modules/mod_jweather/tmpl/blank.gif';
					var jwObject = $('jweather_<?php echo $params->get('idname'); ?>');
				
					var elements = jwObject.getElements('img');
					elements.each(function(el){
						var src = el.src;
			
						// test for png
						if ( /\.png$/.test( src.toLowerCase() ) && el.getStyle('filter') == '' ) {
							if (el.currentStyle.width == 'auto' && el.currentStyle.height == 'auto')
							{
								el.style.width = el.offsetWidth + 'px';
								el.style.height = el.offsetHeight + 'px';
							}
			
				  			// set filter
				  			el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
				                                     src + "',sizingMethod='scale')";
			                // set blank image
			                el.src = blankImg;
			            }
			   			else
			   			{
					      // remove filter
			    		  el.runtimeStyle.filter = "";
			   			}
					});
				}
				
				window.addEvent('domready', doFix);
			</script>
			<![endif]-->
		<?php } ?>
		<?php if (isset($weatherData['temp'])) { ?>
			<tr>
				<?php foreach ($weatherData['temp'] as $temps): ?>
					<td class="jweather_temp">
						<span class="jweather_tempText"><?php echo $temps; ?></span>
					</td>
				<?php endforeach; ?>
			</tr>
		<?php } ?>
		<?php if (isset($weatherData['days'])) { ?>
			<tr>
				<?php foreach ($weatherData['days'] as $dayName): ?>
					<td class="jweather_day">
						<span class="jweather_dayText"><?php echo $dayName; ?></span>
					</td>
				<?php endforeach; ?>
			</tr>
		<?php } ?>
		<?php if (isset($weatherData['forecast'])) { ?>
			<tr>
				<?php foreach ($weatherData['forecast'] as $forecast): ?>
					<td class="jweather_forecast">
						<span class="jweather_forecastText"><?php echo JText::_($forecast); ?></span>
					</td>
				<?php endforeach; ?>
			</tr>
		<?php } ?>
	</table>
</div>