Accueil/class/Clock.php

33 lines
787 B
PHP
Raw Normal View History

<?php
2010-09-20 11:40:27 +02:00
class clock extends Module {
protected static $paramsList = array(
'visibility',
'x',
'y'
);
public $params = array();
public function __construct($params){
$this->setParams($params);
echo '<script type="text/javascript" src="js/jquery.jclock.js"></script>';
echo '<div class="jclock" id="clock" style="left:'.$params['x'].'; top:'.$params['y'].';"></div>';
}
private function setParams($params){
$this->params = $params;
}
public static function start($params){
$clock = new clock($params);
}
2010-09-20 11:40:27 +02:00
public static function updateConfig($updated){
2010-09-21 18:07:23 +02:00
foreach ($updated as $what=>$withWhat){
if(in_array($what, self::$paramsList)){
call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat);
}
}
2010-09-20 11:40:27 +02:00
}
}