Revize 1517
Přidáno uživatelem David Raška před více než 12 roky(ů)
freenetis/branches/testing/application/controllers/settings.php | ||
---|---|---|
// access control
|
||
if (!$this->acl_check_edit(get_class($this), 'system'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (Settings::get('ulogd_enabled'))
|
||
{
|
||
// time of next update of ulogd
|
||
$ulogd_update_next = Settings::get('ulogd_update_last') + Settings::get('ulogd_update_interval');
|
||
|
||
// remaining time to next update of ulogd
|
||
$remaining_time = $ulogd_update_next - time();
|
||
|
||
$additional_info = '<b>ulogd</b> - ' . __('info') . ':<br />';
|
||
$additional_info .= __('last update') . ': <b>'
|
||
. date('Y-m-d H:i:s', Settings::get('ulogd_update_last'))
|
||
. '</b>,<br />';
|
||
$additional_info .= '<span';
|
||
|
||
// remaining time is in past, print it red
|
||
if ($remaining_time < 0)
|
||
$additional_info .= ' style="color:red"';
|
||
|
||
$additional_info .= '>' . __('next update')
|
||
. ': <b>' . date('Y-m-d H:i:s', $ulogd_update_next)
|
||
. '</b> (' . __('Remaining time')
|
||
. ': <b><span id="rest">' . date::counter($remaining_time)
|
||
. '</span></b>)</span>';
|
||
}
|
||
else
|
||
{
|
||
$additional_info = '';
|
||
}
|
||
|
||
// creating of new forge
|
||
$this->form = new Forge('settings/logging');
|
||
|
||
... | ... | |
$view->title = __('Settings') . ' - ' . __('logging');
|
||
$view->content = new View('settings/main');
|
||
|
||
$view->content->additional_info = $additional_info;
|
||
|
||
$view->content->current = 'logging';
|
||
$view->content->content = $this->form->html();
|
||
$view->content->headline = __('Logging');
|
freenetis/branches/testing/application/views/js/settings_logging.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Settings logging javascript view.
|
||
*
|
||
* @author Ondřej Fibich
|
||
*/
|
||
|
||
// IDE complementation
|
||
if (FALSE): ?><script type="text/javascript"><?php endif
|
||
|
||
?>
|
||
|
||
$.timer(1000, function (timer)
|
||
{
|
||
rest = $("#rest").html();
|
||
|
||
arr = explode(":",rest);
|
||
|
||
t = parseInt(arr[2],10) + parseInt(arr[1],10)*60 + parseInt(arr[0],10)*3600;
|
||
|
||
if (t>0)
|
||
{
|
||
t = t-1;
|
||
|
||
s = t%60;
|
||
t = (t-s)/60;
|
||
|
||
m = t%60;
|
||
t = (t-m)/60;
|
||
|
||
h = t%24;
|
||
|
||
if (s<10)
|
||
s = "0"+s;
|
||
|
||
if (m<10)
|
||
m = "0"+m;
|
||
|
||
if (h<10)
|
||
h = "0"+h;
|
||
}
|
||
else
|
||
timer.stop();
|
||
|
||
$("#rest").html(h+":"+m+":"+s);
|
||
});
|
||
|
Také k dispozici: Unified diff
Upravy:
- Odstraneno odpocitavani aktualizace ulog v nastaveni