2010-09-20 10:44:44 +02:00
|
|
|
<?php
|
2010-09-20 11:40:27 +02:00
|
|
|
class clockAdvanced extends Module {
|
|
|
|
protected static $paramsList = array(
|
2010-09-20 10:44:44 +02:00
|
|
|
'visibility',
|
|
|
|
'x',
|
|
|
|
'y',
|
|
|
|
'fontFamily',
|
|
|
|
'fontSize',
|
|
|
|
'format',
|
|
|
|
'color'
|
|
|
|
);
|
|
|
|
|
|
|
|
public $params = array();
|
|
|
|
|
|
|
|
public function __construct($params){
|
|
|
|
$this->setParams($params);
|
|
|
|
echo '<script type="text/javascript" src="js/jquery.jclockAdvanced.js"></script>';
|
|
|
|
echo '<div class="jclockAdvanced" id="clockAdvanced" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
|
|
|
|
$options = '';
|
|
|
|
foreach (self::$paramsList as $paramName){
|
|
|
|
if(isset($this->params[$paramName]))
|
|
|
|
$options .= $paramName.' : '.$this->params[$paramName].',';
|
|
|
|
}
|
|
|
|
echo '<script>$(document).ready(function(){
|
|
|
|
$(\'.jclockAdvanced\').jclock({'.substr($options,0,-1).'});
|
|
|
|
});
|
|
|
|
</script>';
|
|
|
|
}
|
|
|
|
|
|
|
|
private function setParams($params){
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function start($params){
|
|
|
|
$clockAdvanced = new clockAdvanced($params);
|
|
|
|
}
|
2010-09-20 11:40:27 +02:00
|
|
|
public static function updateConfig($updated){
|
|
|
|
}
|
2010-09-20 10:44:44 +02:00
|
|
|
}
|