File: /home/iestorre/informatica/modules/mod_artclock/mod_artclock.php
<?php
/**
* @module Art Clock
* @copyright Copyright (C) 2009 artetics.com
* @license GPL
*/
defined('_JEXEC') or die('Restricted access');
error_reporting(E_ERROR);
define ("DS", DIRECTORY_SEPARATOR);
$document = &JFactory::getDocument();
echo '<!--[if IE]>';
$document->addScript( JURI::root() . 'modules/mod_artclock/js/excanvas.js' );
echo '<![endif]-->';
$moduleId = $module->id;
$document->addScript( JURI::root() . 'modules/mod_artclock/js/coolclock.js' );
$document->addScript( JURI::root() . 'modules/mod_artclock/js/moreskins.js' );
$document->addStyleSheet( JURI::root() . 'modules/mod_artclock/css/artclock.css' );
for ($i = 1; $i <=10; $i++) {
if ($i == 1) {
$enabled = $params->get("enabled".$i, 1);
} else {
$enabled = $params->get("enabled".$i, 0);
}
if ($enabled) {
$seconds = $params->get("seconds".$i, 'noSeconds');
$radius = $params->get("radius".$i, 85);
$GMTOffset = $params->get("GMTOffset".$i, "");
$skin = $params->get("skin".$i, "swissRail");
$clockString = "CoolClock:$skin:$radius";
if ($seconds == "noSeconds") {
$clockString .= ":noSeconds";
} else {
$clockString .= ":";
}
if ($GMTOffset != "") $clockString .= ":$GMTOffset";
$label = '';
if ($params->get("label".$i, '')) $label = '<span class="artclock_label">' . $params->get("label".$i, '') . '</span>';
echo '<span class="artclock_clock">' . $label ."<canvas id='artModClock$i$moduleId' class='$clockString'></canvas></span>" ;
}
}
?>