activityReport; $section = isset($_REQUEST['section']) ? $_REQUEST['section'] : ''; if ($global) { $O->setGlobal(); $t = 'super'; } else { $t = 'blog'; } $combo_int = array( __('every hour') => 3600, __('every 2 hours') => 7200, __('2 times by day') => 43200, __('every day') => 86400, __('every 2 days') => 172800, __('every week') => 604800 ); $combo_obs = array( __('every hour') => 3600, __('every 2 hours') => 7200, __('2 times by day') => 43200, __('every day') => 86400, __('every 2 days') => 172800, __('every week') => 604800, __('every 2 weeks') => 1209600, __('every 4 weeks') => 2419200 ); $combo_format = array( __('Plain text') => 'plain', __('HTML') => 'html' ); $redirect = false; if (!empty($_POST[$t.'_settings'])) { # Active notification on this blog $O->setSetting('active',isset($_POST['active'])); # Add dashboard items $O->setSetting('dashboardItem',isset($_POST['dashboardItem'])); # Report interval if (in_array($_POST['interval'],$combo_int)) { $O->setSetting('interval',(integer) $_POST['interval']); } # check obsolete logs interval if (in_array($_POST['obsolete'],$combo_obs)) { $O->setSetting('obsolete',(integer) $_POST['obsolete']); } # mail list $O->setSetting('mailinglist',explode(';',$_POST['mailinglist'])); # mail format $mailformat = isset($_POST['mailformat']) && $_POST['mailformat'] == 'html' ? 'html' : 'plain'; $O->setSetting('mailformat',$mailformat); # date format $O->setSetting('dateformat',html::escapeHTML($_POST['dateformat'])); # request infos $requests = isset($_POST['requests']) ? $_POST['requests'] : array(); $O->setSetting('requests',$requests); #blogs $blogs = isset($_POST['blogs']) ? $_POST['blogs'] : array(); $O->setSetting('blogs',$blogs); $redirect = true; } # force to send report now if (!empty($_POST[$t.'_force_report'])) { $core->activityReport->needReport(true); $redirect = true; } # force to delete all logs now if (!empty($_POST[$t.'_force_delete'])) { $core->activityReport->deleteLogs(); $redirect = true; } if ($redirect) { http::redirect('plugin.php?p=activityReport&tab='.$t.'_settings§ion'.$section); } $bl = $O->getSetting('lastreport'); $blog_last = !$bl ? __('never') : dt::str($core->blog->settings->system->date_format.', '.$core->blog->settings->system->time_format,$bl,$core->auth->getInfo('user_tz')); $bi = $O->getSetting('interval'); $blog_next = !$bl ? __('on new activity') : dt::str($core->blog->settings->system->date_format.', '.$core->blog->settings->system->time_format,$bl+$bi,$core->auth->getInfo('user_tz')); $emails = implode(';',$O->getSetting('mailinglist')); ?>
unsetGlobal(); } public static function logTab($core,$title,$global=false) { $O =& $core->activityReport; if ($global) { $O->setGlobal(); $t = 'super'; } else { $t = 'blog'; } $params = array(); $logs = $O->getLogs($params); ?>'.__('No log').'
'; } else { ?>blog_id; ?> |