39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
class clockAdvanced extends Module {
|
|
protected static $paramsList = array(
|
|
'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);
|
|
}
|
|
public static function updateConfig($updated){
|
|
}
|
|
} |