ktk_mediaserve/modules/inactive/StyledClock.php

25 lines
648 B
PHP

<?php
namespace ktk\MusicServe;
class StyledClock {
static private $time = "";
static function onInit() {
if (!MusicServe::getData('time_format')) {
MusicServe::storeData('time_format', 'H:i:s');
}
}
static function onProcess() {
self::$time = date(MusicServe::getData('time_format'));
}
static function onRender() {
echo '<div id="ktk_MusicServe_StyledClock">'.PHP_EOL;
echo self::$time.PHP_EOL;
echo '<a href="?m=StyledClock&c=changeTime&p1=g:i:s a">12-hour</a>'.PHP_EOL;
echo '</div>'.PHP_EOL;
}
static function changeTime($format) {
MusicServe::storeData('time_format', $format);
}
}
?>