First pass to clean up code
This commit is contained in:
parent
d843671ddb
commit
55136bb6d7
16 changed files with 1794 additions and 1782 deletions
142
_admin.php
142
_admin.php
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
||||||
|
|
||||||
|
@ -16,78 +17,77 @@ if (!defined('ACTIVITY_REPORT')){return;}
|
||||||
|
|
||||||
# Plugin menu
|
# Plugin menu
|
||||||
$_menu['Plugins']->addItem(
|
$_menu['Plugins']->addItem(
|
||||||
__('Activity report'),
|
__('Activity report'),
|
||||||
'plugin.php?p=activityReport','index.php?pf=activityReport/icon.png',
|
'plugin.php?p=activityReport','index.php?pf=activityReport/icon.png',
|
||||||
preg_match('/plugin.php\?p=activityReport(&.*)?$/',
|
preg_match('/plugin.php\?p=activityReport(&.*)?$/',
|
||||||
$_SERVER['REQUEST_URI']),
|
$_SERVER['REQUEST_URI']),
|
||||||
$core->auth->check('admin',$core->blog->id)
|
$core->auth->check('admin',$core->blog->id)
|
||||||
);
|
);
|
||||||
|
|
||||||
# Dashboarditems
|
# Dashboarditems
|
||||||
if ($core->activityReport->getSetting('dashboardItem'))
|
if ($core->activityReport->getSetting('dashboardItem'))
|
||||||
{
|
{
|
||||||
$core->addBehavior(
|
$core->addBehavior(
|
||||||
'adminDashboardHeaders',
|
'adminDashboardHeaders',
|
||||||
array('activityReportAdmin','dashboardHeaders')
|
array('activityReportAdmin','dashboardHeaders')
|
||||||
);
|
);
|
||||||
$core->addBehavior(
|
$core->addBehavior(
|
||||||
'adminDashboardItems',
|
'adminDashboardItems',
|
||||||
array('activityReportAdmin','dashboardItems')
|
array('activityReportAdmin','dashboardItems')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class activityReportAdmin
|
class activityReportAdmin
|
||||||
{
|
{
|
||||||
# Add CSS to dashboardHeaders for items
|
# Add CSS to dashboardHeaders for items
|
||||||
public static function dashboardHeaders()
|
public static function dashboardHeaders()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
"\n<!-- CSS for activityReport --> \n".
|
"\n<!-- CSS for activityReport --> \n".
|
||||||
"<style type=\"text/css\"> \n".
|
"<style type=\"text/css\"> \n".
|
||||||
"#dashboard-items #report dt { font-weight: bold; margin: 0 0 0.4em 0; } \n".
|
"#dashboard-items #report dt { font-weight: bold; margin: 0 0 0.4em 0; } \n".
|
||||||
"#dashboard-items #report dd { font-size: 0.9em; margin: 0 0 1em 0; } \n".
|
"#dashboard-items #report dd { font-size: 0.9em; margin: 0 0 1em 0; } \n".
|
||||||
"#dashboard-items #report dd p { margin: 0.2em 0 0 0; } \n".
|
"#dashboard-items #report dd p { margin: 0.2em 0 0 0; } \n".
|
||||||
"</style> \n";
|
"</style> \n";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add report to dashboardItems
|
# Add report to dashboardItems
|
||||||
public static function dashboardItems($core, $__dashboard_items)
|
public static function dashboardItems($core, $__dashboard_items)
|
||||||
{
|
{
|
||||||
$r = $core->activityReport->getSetting('requests');
|
$r = $core->activityReport->getSetting('requests');
|
||||||
$g = $core->activityReport->getGroups();
|
$g = $core->activityReport->getGroups();
|
||||||
|
|
||||||
$p = array();
|
$p = array();
|
||||||
$p['limit'] = 20;
|
$p['limit'] = 20;
|
||||||
$p['order'] = 'activity_dt DESC';
|
$p['order'] = 'activity_dt DESC';
|
||||||
$p['sql'] = $core->activityReport->requests2params($r);
|
$p['sql'] = $core->activityReport->requests2params($r);
|
||||||
|
|
||||||
$res = '';
|
$res = '';
|
||||||
$rs = $core->activityReport->getLogs($p);
|
$rs = $core->activityReport->getLogs($p);
|
||||||
if (!$rs->isEmpty())
|
if (!$rs->isEmpty())
|
||||||
{
|
{
|
||||||
while($rs->fetch())
|
while($rs->fetch())
|
||||||
{
|
{
|
||||||
$group = $rs->activity_group;
|
$group = $rs->activity_group;
|
||||||
|
|
||||||
if (!isset($g[$group])) continue;
|
if (!isset($g[$group])) continue;
|
||||||
|
|
||||||
$res .=
|
$res .=
|
||||||
'<dd><p title="'.__($g[$group]['title']).'"><strong>'.
|
'<dd><p title="'.__($g[$group]['title']).'"><strong>'.
|
||||||
__($g[$group]['actions'][$rs->activity_action]['title']).
|
__($g[$group]['actions'][$rs->activity_action]['title']).
|
||||||
'</p></strong><em>'.
|
'</p></strong><em>'.
|
||||||
vsprintf(
|
vsprintf(
|
||||||
__($g[$group]['actions'][$rs->activity_action]['msg']),
|
__($g[$group]['actions'][$rs->activity_action]['msg']),
|
||||||
$core->activityReport->decode($rs->activity_logs)
|
$core->activityReport->decode($rs->activity_logs)
|
||||||
).
|
).
|
||||||
'</em></dd>';
|
'</em></dd>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($res))
|
if (!empty($res))
|
||||||
{
|
{
|
||||||
$__dashboard_items[1][] =
|
$__dashboard_items[1][] =
|
||||||
'<h3>'.__('Activity report').'</h3>'.
|
'<h3>'.__('Activity report').'</h3>'.
|
||||||
'<dl id="report">'.$res.'</dl>';
|
'<dl id="report">'.$res.'</dl>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
50
_define.php
50
_define.php
|
@ -1,24 +1,32 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('DC_RC_PATH')) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')){return;}
|
|
||||||
|
|
||||||
$this->registerModule(
|
$this->registerModule(
|
||||||
/* Name */ "Activity report",
|
'Activity report',
|
||||||
/* Description*/ "Receive your blog activity by email, feed, or on dashboard",
|
'Receive your blog activity by email, feed, or on dashboard',
|
||||||
/* Author */ "JC Denis",
|
'Jean-Christian Denis and contributors',
|
||||||
/* Version */ '1.0.1',
|
'1.0.1',
|
||||||
/* Permissions */ 'admin',
|
[
|
||||||
/* Priority */ -1000000
|
'requires' => [['core', '2.19']],
|
||||||
);
|
'permissions' => 'admin',
|
||||||
/* date */ #20100608
|
'priority' => -1000000,
|
||||||
?>
|
'type' => 'plugin',
|
||||||
|
'support' => 'https://github.com/JcDenis/activityReport',
|
||||||
|
'details' => 'http://plugins.dotaddict.org/dc2/details/activityReport',
|
||||||
|
'repository' => 'https://raw.githubusercontent.com/JcDenis/activityReport/master/dcstore.xml'
|
||||||
|
]
|
||||||
|
);
|
108
_install.php
108
_install.php
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
||||||
|
|
||||||
|
@ -19,53 +20,52 @@ if (version_compare($old_version,$new_version,'>=')) {return;}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
# Check DC version
|
# Check DC version
|
||||||
if (version_compare(DC_VERSION,'2.2-beta','<'))
|
if (version_compare(DC_VERSION,'2.2-beta','<'))
|
||||||
{
|
{
|
||||||
throw new Exception('translater requires Dotclear 2.2');
|
throw new Exception('translater requires Dotclear 2.2');
|
||||||
}
|
}
|
||||||
|
|
||||||
# Table
|
|
||||||
$s = new dbStruct($core->con,$core->prefix);
|
|
||||||
$s->activity
|
|
||||||
->activity_id ('bigint',0,false)
|
|
||||||
->activity_type ('varchar',32,false,"'activityReport'")
|
|
||||||
->blog_id ('varchar',32,true)
|
|
||||||
->activity_group('varchar',32,false)
|
|
||||||
->activity_action ('varchar',32,false)
|
|
||||||
->activity_logs ('text',0,false)
|
|
||||||
->activity_dt ('timestamp',0,false,'now()')
|
|
||||||
->activity_blog_status ('smallint',0,false,0)
|
|
||||||
->activity_super_status ('smallint',0,false,0)
|
|
||||||
|
|
||||||
->primary('pk_activity','activity_id')
|
|
||||||
->index('idx_activity_type','btree','activity_type')
|
|
||||||
->index('idx_activity_blog_id','btree','blog_id')
|
|
||||||
->index('idx_activity_action','btree','activity_group','activity_action')
|
|
||||||
->index('idx_activity_blog_status','btree','activity_blog_status')
|
|
||||||
->index('idx_activity_super_status','btree','activity_super_status');
|
|
||||||
|
|
||||||
$s->activity_setting
|
|
||||||
->setting_id('varchar',64,false)
|
|
||||||
->blog_id ('varchar',32,true)
|
|
||||||
->setting_type('varchar',32,false)
|
|
||||||
->setting_value('text',0,false)
|
|
||||||
|
|
||||||
->unique('uk_activity_setting','setting_id','blog_id','setting_type')
|
|
||||||
->index('idx_activity_setting_blog_id','btree','blog_id')
|
|
||||||
->index('idx_activity_setting_type','btree','setting_type');
|
|
||||||
|
|
||||||
$si = new dbStruct($core->con,$core->prefix);
|
|
||||||
$changes = $si->synchronize($s);
|
|
||||||
|
|
||||||
# Version
|
# Table
|
||||||
$core->setVersion('activityReport',$new_version);
|
$s = new dbStruct($core->con,$core->prefix);
|
||||||
|
$s->activity
|
||||||
|
->activity_id ('bigint',0,false)
|
||||||
|
->activity_type ('varchar',32,false,"'activityReport'")
|
||||||
|
->blog_id ('varchar',32,true)
|
||||||
|
->activity_group('varchar',32,false)
|
||||||
|
->activity_action ('varchar',32,false)
|
||||||
|
->activity_logs ('text',0,false)
|
||||||
|
->activity_dt ('timestamp',0,false,'now()')
|
||||||
|
->activity_blog_status ('smallint',0,false,0)
|
||||||
|
->activity_super_status ('smallint',0,false,0)
|
||||||
|
|
||||||
return true;
|
->primary('pk_activity','activity_id')
|
||||||
|
->index('idx_activity_type','btree','activity_type')
|
||||||
|
->index('idx_activity_blog_id','btree','blog_id')
|
||||||
|
->index('idx_activity_action','btree','activity_group','activity_action')
|
||||||
|
->index('idx_activity_blog_status','btree','activity_blog_status')
|
||||||
|
->index('idx_activity_super_status','btree','activity_super_status');
|
||||||
|
|
||||||
|
$s->activity_setting
|
||||||
|
->setting_id('varchar',64,false)
|
||||||
|
->blog_id ('varchar',32,true)
|
||||||
|
->setting_type('varchar',32,false)
|
||||||
|
->setting_value('text',0,false)
|
||||||
|
|
||||||
|
->unique('uk_activity_setting','setting_id','blog_id','setting_type')
|
||||||
|
->index('idx_activity_setting_blog_id','btree','blog_id')
|
||||||
|
->index('idx_activity_setting_type','btree','setting_type');
|
||||||
|
|
||||||
|
$si = new dbStruct($core->con,$core->prefix);
|
||||||
|
$changes = $si->synchronize($s);
|
||||||
|
|
||||||
|
# Version
|
||||||
|
$core->setVersion('activityReport',$new_version);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
$core->error->add($e->getMessage());
|
$core->error->add($e->getMessage());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
?>
|
|
46
_prepend.php
46
_prepend.php
|
@ -1,38 +1,38 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')){return;}
|
if (!defined('DC_RC_PATH')){return;}
|
||||||
|
|
||||||
global $__autoload, $core;
|
global $__autoload, $core;
|
||||||
|
|
||||||
$__autoload['activityReport'] =
|
$__autoload['activityReport'] =
|
||||||
dirname(__FILE__).'/inc/class.activity.report.php';
|
dirname(__FILE__).'/inc/class.activity.report.php';
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$core->activityReport = new activityReport($core);
|
$core->activityReport = new activityReport($core);
|
||||||
|
|
||||||
$core->url->register(
|
$core->url->register(
|
||||||
'activityReport',
|
'activityReport',
|
||||||
'reports',
|
'reports',
|
||||||
'^reports/((atom|rss2)/(.+))$',
|
'^reports/((atom|rss2)/(.+))$',
|
||||||
array('activityReportPublicUrl','feed')
|
array('activityReportPublicUrl','feed')
|
||||||
);
|
);
|
||||||
|
|
||||||
define('ACTIVITY_REPORT',true);
|
define('ACTIVITY_REPORT',true);
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/inc/class.activity.report.behaviors.php';
|
require_once dirname(__FILE__).'/inc/class.activity.report.behaviors.php';
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
//throw new Exception('Failed to launch activityReport');
|
//throw new Exception('Failed to launch activityReport');
|
||||||
}
|
}
|
||||||
?>
|
|
258
_public.php
258
_public.php
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')){return;}
|
if (!defined('DC_RC_PATH')){return;}
|
||||||
|
|
||||||
|
@ -23,152 +24,151 @@ $core->tpl->addValue('activityReportContent',array('activityReportPublicTpl','ac
|
||||||
|
|
||||||
class activityReportPublicUrl extends dcUrlHandlers
|
class activityReportPublicUrl extends dcUrlHandlers
|
||||||
{
|
{
|
||||||
public static function feed($args)
|
public static function feed($args)
|
||||||
{
|
{
|
||||||
global $core, $_ctx;
|
global $core, $_ctx;
|
||||||
|
|
||||||
if (!preg_match('/^(atom|rss2)\/(.+)$/',$args,$m))
|
if (!preg_match('/^(atom|rss2)\/(.+)$/',$args,$m))
|
||||||
{
|
{
|
||||||
self::p404();
|
self::p404();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!defined('ACTIVITY_REPORT')){
|
if (!defined('ACTIVITY_REPORT')){
|
||||||
self::p404();
|
self::p404();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$core->activityReport->getSetting('active'))
|
if (!$core->activityReport->getSetting('active'))
|
||||||
{
|
{
|
||||||
self::p404();
|
self::p404();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$mime = $m[1] == 'atom' ? 'application/atom+xml' : 'application/xml';
|
$mime = $m[1] == 'atom' ? 'application/atom+xml' : 'application/xml';
|
||||||
|
|
||||||
if (false === $core->activityReport->checkUserCode($m[2])) {
|
if (false === $core->activityReport->checkUserCode($m[2])) {
|
||||||
self::p404();
|
self::p404();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_feed;
|
$_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_feed;
|
||||||
$_ctx->short_feed_items = $core->blog->settings->system->short_feed_items;
|
$_ctx->short_feed_items = $core->blog->settings->system->short_feed_items;
|
||||||
|
|
||||||
header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->system->robots_policy,''));
|
header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->system->robots_policy,''));
|
||||||
self::serveDocument('activityreport-'.$m[1].'.xml',$mime);
|
self::serveDocument('activityreport-'.$m[1].'.xml',$mime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class activityReportPublicTpl
|
class activityReportPublicTpl
|
||||||
{
|
{
|
||||||
public static function activityReports($attr,$content)
|
public static function activityReports($attr,$content)
|
||||||
{
|
{
|
||||||
$lastn = 0;
|
$lastn = 0;
|
||||||
if (isset($attr['lastn'])) {
|
if (isset($attr['lastn'])) {
|
||||||
$lastn = abs((integer) $attr['lastn'])+0;
|
$lastn = abs((integer) $attr['lastn'])+0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$p = 'if (!isset($_page_number)) { $_page_number = 1; }'."\n\$params = array();\n";
|
$p = 'if (!isset($_page_number)) { $_page_number = 1; }'."\n\$params = array();\n";
|
||||||
|
|
||||||
if ($lastn > 0) {
|
if ($lastn > 0) {
|
||||||
$p .= "\$params['limit'] = ".$lastn.";\n";
|
$p .= "\$params['limit'] = ".$lastn.";\n";
|
||||||
} else {
|
} else {
|
||||||
$p .= "\$params['limit'] = \$_ctx->nb_entry_per_page;\n";
|
$p .= "\$params['limit'] = \$_ctx->nb_entry_per_page;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") {
|
if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") {
|
||||||
$p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n";
|
$p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n";
|
||||||
} else {
|
} else {
|
||||||
$p .= "\$params['limit'] = array(0, \$params['limit']);\n";
|
$p .= "\$params['limit'] = array(0, \$params['limit']);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$res =
|
$res =
|
||||||
"<?php \n".
|
"<?php \n".
|
||||||
$p.
|
$p.
|
||||||
'$_ctx->activityreport_params = $params; '."\n".
|
'$_ctx->activityreport_params = $params; '."\n".
|
||||||
'$_ctx->activityreports = $core->activityReport->getLogs($params); unset($params); '."\n".
|
'$_ctx->activityreports = $core->activityReport->getLogs($params); unset($params); '."\n".
|
||||||
'while ($_ctx->activityreports->fetch()) : ?>'.$content.'<?php endwhile; '.
|
'while ($_ctx->activityreports->fetch()) : ?>'.$content.'<?php endwhile; '.
|
||||||
'$_ctx->activityreports = null; $_ctx->activityreport_params = null; '."\n".
|
'$_ctx->activityreports = null; $_ctx->activityreport_params = null; '."\n".
|
||||||
"?>";
|
"?>";
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function activityReportFeedID($attr)
|
public static function activityReportFeedID($attr)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
'urn:md5:<?php echo md5($_ctx->activityreports->blog_id.'.
|
'urn:md5:<?php echo md5($_ctx->activityreports->blog_id.'.
|
||||||
'$_ctx->activityreports->activity_id.$_ctx->activityreports->activity_dt); '.
|
'$_ctx->activityreports->activity_id.$_ctx->activityreports->activity_dt); '.
|
||||||
'?>';
|
'?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function activityReportTitle($attr)
|
public static function activityReportTitle($attr)
|
||||||
{
|
{
|
||||||
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
||||||
return '<?php echo '.sprintf($f,'activityReportContext::parseTitle()').'; ?>';
|
return '<?php echo '.sprintf($f,'activityReportContext::parseTitle()').'; ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function activityReportContent($attr)
|
public static function activityReportContent($attr)
|
||||||
{
|
{
|
||||||
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
||||||
return '<?php echo '.sprintf($f,'activityReportContext::parseContent()').'; ?>';
|
return '<?php echo '.sprintf($f,'activityReportContext::parseContent()').'; ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function activityReportDate($attr)
|
public static function activityReportDate($attr)
|
||||||
{
|
{
|
||||||
$format = '';
|
$format = '';
|
||||||
if (!empty($attr['format'])) {
|
if (!empty($attr['format'])) {
|
||||||
$format = addslashes($attr['format']);
|
$format = addslashes($attr['format']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$iso8601 = !empty($attr['iso8601']);
|
$iso8601 = !empty($attr['iso8601']);
|
||||||
$rfc822 = !empty($attr['rfc822']);
|
$rfc822 = !empty($attr['rfc822']);
|
||||||
|
|
||||||
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
|
||||||
|
|
||||||
if ($rfc822) {
|
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
||||||
return '<?php echo '.sprintf($f,"dt::rfc822(strtotime(\$_ctx->activityreports->activity_dt),\$core->blog->settings->system->blog_timezone)").'; ?>';
|
|
||||||
} elseif ($iso8601) {
|
if ($rfc822) {
|
||||||
return '<?php echo '.sprintf($f,"dt::iso8601(strtotime(\$_ctx->activityreports->activity_dt),\$core->blog->settings->system->blog_timezone)").'; ?>';
|
return '<?php echo '.sprintf($f,"dt::rfc822(strtotime(\$_ctx->activityreports->activity_dt),\$core->blog->settings->system->blog_timezone)").'; ?>';
|
||||||
} elseif (!empty($format)) {
|
} elseif ($iso8601) {
|
||||||
return '<?php echo '.sprintf($f,"dt::dt2str('".$format."',\$_ctx->activityreports->activity_dt)").'; ?>';
|
return '<?php echo '.sprintf($f,"dt::iso8601(strtotime(\$_ctx->activityreports->activity_dt),\$core->blog->settings->system->blog_timezone)").'; ?>';
|
||||||
} else {
|
} elseif (!empty($format)) {
|
||||||
return '<?php echo '.sprintf($f,"dt::dt2str(\$core->blog->settings->system->date_format,\$_ctx->activityreports->activity_dt)").'; ?>';
|
return '<?php echo '.sprintf($f,"dt::dt2str('".$format."',\$_ctx->activityreports->activity_dt)").'; ?>';
|
||||||
}
|
} else {
|
||||||
}
|
return '<?php echo '.sprintf($f,"dt::dt2str(\$core->blog->settings->system->date_format,\$_ctx->activityreports->activity_dt)").'; ?>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class activityReportContext
|
class activityReportContext
|
||||||
{
|
{
|
||||||
public static function parseTitle()
|
public static function parseTitle()
|
||||||
{
|
{
|
||||||
global $core,$_ctx;
|
global $core,$_ctx;
|
||||||
|
|
||||||
$groups = $core->activityReport->getGroups();
|
$groups = $core->activityReport->getGroups();
|
||||||
|
|
||||||
$group = $_ctx->activityreports->activity_group;
|
$group = $_ctx->activityreports->activity_group;
|
||||||
$action = $_ctx->activityreports->activity_action;
|
$action = $_ctx->activityreports->activity_action;
|
||||||
|
|
||||||
if (!empty($groups[$group]['actions'][$action]['title'])) {
|
if (!empty($groups[$group]['actions'][$action]['title'])) {
|
||||||
return __($groups[$group]['actions'][$action]['title']);
|
return __($groups[$group]['actions'][$action]['title']);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function parseContent()
|
public static function parseContent()
|
||||||
{
|
{
|
||||||
global $core,$_ctx;
|
global $core,$_ctx;
|
||||||
|
|
||||||
$groups = $core->activityReport->getGroups();
|
$groups = $core->activityReport->getGroups();
|
||||||
|
|
||||||
$group = $_ctx->activityreports->activity_group;
|
$group = $_ctx->activityreports->activity_group;
|
||||||
$action = $_ctx->activityreports->activity_action;
|
$action = $_ctx->activityreports->activity_action;
|
||||||
$logs = $_ctx->activityreports->activity_logs;
|
$logs = $_ctx->activityreports->activity_logs;
|
||||||
$logs = $core->activityReport->decode($logs);
|
$logs = $core->activityReport->decode($logs);
|
||||||
|
|
||||||
if (!empty($groups[$group]['actions'][$action]['msg'])) {
|
if (!empty($groups[$group]['actions'][$action]['msg'])) {
|
||||||
$core->initWikiComment();
|
$core->initWikiComment();
|
||||||
return $core->wikiTransform(vsprintf(__($groups[$group]['actions'][$action]['msg']),$logs));
|
return $core->wikiTransform(vsprintf(__($groups[$group]['actions'][$action]['msg']),$logs));
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
|
@ -1,56 +1,56 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
||||||
|
|
||||||
$this->addUserAction(
|
$this->addUserAction(
|
||||||
/* type */ 'tables',
|
/* type */ 'tables',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activity',
|
/* ns */ 'activity',
|
||||||
/* description */ sprintf(__('delete %s table'),'"activity"')
|
/* description */ sprintf(__('delete %s table'),'"activity"')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addUserAction(
|
$this->addUserAction(
|
||||||
/* type */ 'tables',
|
/* type */ 'tables',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activity_setting',
|
/* ns */ 'activity_setting',
|
||||||
/* description */ sprintf(__('delete %s table'),'"activity_setting"')
|
/* description */ sprintf(__('delete %s table'),'"activity_setting"')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addUserAction(
|
$this->addUserAction(
|
||||||
/* type */ 'plugins',
|
/* type */ 'plugins',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activityReport',
|
/* ns */ 'activityReport',
|
||||||
/* description */ __('delete plugin files')
|
/* description */ __('delete plugin files')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addUserAction(
|
$this->addUserAction(
|
||||||
/* type */ 'versions',
|
/* type */ 'versions',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activityReport',
|
/* ns */ 'activityReport',
|
||||||
/* description */ __('delete the version number')
|
/* description */ __('delete the version number')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addDirectAction(
|
$this->addDirectAction(
|
||||||
/* type */ 'versions',
|
/* type */ 'versions',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activityReport',
|
/* ns */ 'activityReport',
|
||||||
/* description */ sprintf(__('delete %s version number'),'activityReport')
|
/* description */ sprintf(__('delete %s version number'),'activityReport')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addDirectAction(
|
$this->addDirectAction(
|
||||||
/* type */ 'plugins',
|
/* type */ 'plugins',
|
||||||
/* action */ 'delete',
|
/* action */ 'delete',
|
||||||
/* ns */ 'activityReport',
|
/* ns */ 'activityReport',
|
||||||
/* description */ sprintf(__('delete %s plugin files'),'activityReport')
|
/* description */ sprintf(__('delete %s plugin files'),'activityReport')
|
||||||
);
|
);
|
||||||
?>
|
|
11
dcstore.xml
Normal file
11
dcstore.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<modules xmlns:da="http://dotaddict.org/da/">
|
||||||
|
<module id="activityReport">
|
||||||
|
<name>Rapport d'activité</name>
|
||||||
|
<version>1.0.1</version>
|
||||||
|
<author>Jean-Christian Denis and contributors</author>
|
||||||
|
<desc>Receive your blog activity by email, feed, or on dashboard</desc>
|
||||||
|
<file>https://github.com/JcDenis/activityReport/releases/download/v1.0.1/plugin-activityReport.zip</file>
|
||||||
|
<da:details>http://plugins.dotaddict.org/dc2/details/activityReport</da:details>
|
||||||
|
<da:support>https://github.com/JcDenis/activityReport</da:support>
|
||||||
|
</module>
|
||||||
|
</modules>
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
||||||
xml:lang="{{tpl:BlogLanguage}}">
|
xml:lang="{{tpl:BlogLanguage}}">
|
||||||
|
|
||||||
<title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
|
<title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
|
||||||
<subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
|
<subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
|
||||||
<link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
|
<link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
</author>
|
</author>
|
||||||
<id>{{tpl:BlogFeedID}}</id>
|
<id>{{tpl:BlogFeedID}}</id>
|
||||||
<generator uri="http://www.dotclear.net/">Dotclear</generator>
|
<generator uri="http://www.dotclear.net/">Dotclear</generator>
|
||||||
|
|
||||||
<tpl:activityReports>
|
<tpl:activityReports>
|
||||||
|
|
||||||
<entry>
|
<entry>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
<copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
|
<copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
|
||||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||||
<generator>Dotclear</generator>
|
<generator>Dotclear</generator>
|
||||||
|
|
||||||
<tpl:activityReports>
|
<tpl:activityReports>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<title>{{tpl:activityReportTitle encode_xml="1"}}</title>
|
<title>{{tpl:activityReportTitle encode_xml="1"}}</title>
|
||||||
<guid isPermaLink="false">{{tpl:activityReportFeedID}}</guid>
|
<guid isPermaLink="false">{{tpl:activityReportFeedID}}</guid>
|
||||||
|
@ -28,6 +28,6 @@
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
</tpl:activityReports>
|
</tpl:activityReports>
|
||||||
|
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')){return;}
|
if (!defined('DC_RC_PATH')){return;}
|
||||||
|
|
||||||
|
@ -19,12 +20,12 @@ if (!defined('ACTIVITY_REPORT')){return;}
|
||||||
$core->activityReport->addGroup('activityReport',__('ActivityReport messages'));
|
$core->activityReport->addGroup('activityReport',__('ActivityReport messages'));
|
||||||
|
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'activityReport',
|
'activityReport',
|
||||||
'message',
|
'message',
|
||||||
__('Special messages'),
|
__('Special messages'),
|
||||||
__('%s'),
|
__('%s'),
|
||||||
'messageActivityReport',
|
'messageActivityReport',
|
||||||
array('activityReportBehaviors','messageActivityReport')
|
array('activityReportBehaviors','messageActivityReport')
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Blog
|
/* Blog
|
||||||
|
@ -35,25 +36,24 @@ $core->activityReport->addGroup('blog',__('Actions on blog'));
|
||||||
|
|
||||||
# from BEHAVIOR adminAfterBlogUpdate in admin/blog_pref.php
|
# from BEHAVIOR adminAfterBlogUpdate in admin/blog_pref.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'blog',
|
'blog',
|
||||||
'update',
|
'update',
|
||||||
__('updating blog'),
|
__('updating blog'),
|
||||||
__('Blog was updated by "%s"'),
|
__('Blog was updated by "%s"'),
|
||||||
'adminAfterBlogUpdate',
|
'adminAfterBlogUpdate',
|
||||||
array('activityReportBehaviors','blogUpdate')
|
array('activityReportBehaviors','blogUpdate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR publicHeadContent in template
|
# from BEHAVIOR publicHeadContent in template
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'blog',
|
'blog',
|
||||||
'p404',
|
'p404',
|
||||||
__('404 error'),
|
__('404 error'),
|
||||||
__('New 404 error page at "%s"'),
|
__('New 404 error page at "%s"'),
|
||||||
'publicHeadContent',
|
'publicHeadContent',
|
||||||
array('activityReportBehaviors','blogP404')
|
array('activityReportBehaviors','blogP404')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/* Post
|
/* Post
|
||||||
-------------------------*/
|
-------------------------*/
|
||||||
$core->activityReport->addGroup('post',__('Actions on posts'));
|
$core->activityReport->addGroup('post',__('Actions on posts'));
|
||||||
|
@ -62,60 +62,58 @@ $core->activityReport->addGroup('post',__('Actions on posts'));
|
||||||
# duplicate adminAfterPostCreate in admin/post.php
|
# duplicate adminAfterPostCreate in admin/post.php
|
||||||
# duplicate adminAfterPostCreate in admin/services.php
|
# duplicate adminAfterPostCreate in admin/services.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'post',
|
'post',
|
||||||
'create',
|
'create',
|
||||||
__('post creation'),
|
__('post creation'),
|
||||||
__('A new post called "%s" was created by "%s" at %s'),
|
__('A new post called "%s" was created by "%s" at %s'),
|
||||||
'adminAfterPostCreate',
|
'adminAfterPostCreate',
|
||||||
array('activityReportBehaviors','postCreate')
|
array('activityReportBehaviors','postCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# Plugin contribute
|
# Plugin contribute
|
||||||
# from BEHAVIOR publicAfterPostCreate in plugins/contribute/_public.php
|
# from BEHAVIOR publicAfterPostCreate in plugins/contribute/_public.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'post',
|
'post',
|
||||||
'create',
|
'create',
|
||||||
__('post creation'),
|
__('post creation'),
|
||||||
__('A new post called "%s" was created by "%s" at %s'),
|
__('A new post called "%s" was created by "%s" at %s'),
|
||||||
'publicAfterPostCreate',
|
'publicAfterPostCreate',
|
||||||
array('activityReportBehaviors','postCreate')
|
array('activityReportBehaviors','postCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR coreAfterPostUpdate in inc/core/class.dc.blog.php (DC2.2)
|
# from BEHAVIOR coreAfterPostUpdate in inc/core/class.dc.blog.php (DC2.2)
|
||||||
# duplicate adminAfterPostUpdate in admin/post.php
|
# duplicate adminAfterPostUpdate in admin/post.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'post',
|
'post',
|
||||||
'update',
|
'update',
|
||||||
__('updating post'),
|
__('updating post'),
|
||||||
__('Post called "%s" has been updated by "%s" at %s'),
|
__('Post called "%s" has been updated by "%s" at %s'),
|
||||||
'adminAfterPostUpdate',
|
'adminAfterPostUpdate',
|
||||||
array('activityReportBehaviors','postUpdate')
|
array('activityReportBehaviors','postUpdate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR adminBeforePostDelete in admin/posts_actions.php
|
# from BEHAVIOR adminBeforePostDelete in admin/posts_actions.php
|
||||||
# from BEHAVIOR adminBeforePostDelete in admin/post.php
|
# from BEHAVIOR adminBeforePostDelete in admin/post.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'post',
|
'post',
|
||||||
'delete',
|
'delete',
|
||||||
__('post deletion'),
|
__('post deletion'),
|
||||||
__('Post called "%s" has been deleted by "%s"'),
|
__('Post called "%s" has been deleted by "%s"'),
|
||||||
'adminBeforePostDelete',
|
'adminBeforePostDelete',
|
||||||
array('activityReportBehaviors','postDelete')
|
array('activityReportBehaviors','postDelete')
|
||||||
);
|
);
|
||||||
|
|
||||||
# Wrong attempt on passworded enrty
|
# Wrong attempt on passworded enrty
|
||||||
# from BEHAVIOR urlHandlerServeDocument in inc/public/lib.urlhandlers.php
|
# from BEHAVIOR urlHandlerServeDocument in inc/public/lib.urlhandlers.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'post',
|
'post',
|
||||||
'protection',
|
'protection',
|
||||||
__('Post protection'),
|
__('Post protection'),
|
||||||
__('An attempt failed on a passworded post with password "%s" at "%s"'),
|
__('An attempt failed on a passworded post with password "%s" at "%s"'),
|
||||||
'urlHandlerServeDocument',
|
'urlHandlerServeDocument',
|
||||||
array('activityReportBehaviors','postPasswordAttempt')
|
array('activityReportBehaviors','postPasswordAttempt')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Comment
|
/* Comment
|
||||||
-------------------------*/
|
-------------------------*/
|
||||||
$core->activityReport->addGroup('comment',__('Actions on comments'));
|
$core->activityReport->addGroup('comment',__('Actions on comments'));
|
||||||
|
@ -124,23 +122,23 @@ $core->activityReport->addGroup('comment',__('Actions on comments'));
|
||||||
# duplicate adminAfterCommentCreate in admin/comment.php
|
# duplicate adminAfterCommentCreate in admin/comment.php
|
||||||
# duplicate publicAfterCommentCreate in inc/public/lib.urlhandlers.php
|
# duplicate publicAfterCommentCreate in inc/public/lib.urlhandlers.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'comment',
|
'comment',
|
||||||
'create',
|
'create',
|
||||||
__('comment creation'),
|
__('comment creation'),
|
||||||
__('A new comment was created by "%s" on post "%s" at %s'),
|
__('A new comment was created by "%s" on post "%s" at %s'),
|
||||||
'coreAfterCommentCreate',
|
'coreAfterCommentCreate',
|
||||||
array('activityReportBehaviors','commentCreate')
|
array('activityReportBehaviors','commentCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR coreAfterCommentUpdate in inc/core/class.dc.blog.php
|
# from BEHAVIOR coreAfterCommentUpdate in inc/core/class.dc.blog.php
|
||||||
# duplicate adminAfterCommentUpdate in admin/comment.php
|
# duplicate adminAfterCommentUpdate in admin/comment.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'comment',
|
'comment',
|
||||||
'update',
|
'update',
|
||||||
__('updating comment'),
|
__('updating comment'),
|
||||||
__('Comment has been updated by "%s" at %s'),
|
__('Comment has been updated by "%s" at %s'),
|
||||||
'coreAfterCommentUpdate',
|
'coreAfterCommentUpdate',
|
||||||
array('activityReportBehaviors','commentUpdate')
|
array('activityReportBehaviors','commentUpdate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# Missing coreBeforeCommentDelete in inc/core/class.dc.blog.php
|
# Missing coreBeforeCommentDelete in inc/core/class.dc.blog.php
|
||||||
|
@ -149,287 +147,283 @@ $core->activityReport->addAction(
|
||||||
# from BEHAVIOR coreAfterCommentCreate in inc/core/class.dc.blog.php
|
# from BEHAVIOR coreAfterCommentCreate in inc/core/class.dc.blog.php
|
||||||
# duplicate publicAfterTrackbackCreate in inc/core/class.dc.trackback.php
|
# duplicate publicAfterTrackbackCreate in inc/core/class.dc.trackback.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'comment',
|
'comment',
|
||||||
'trackback',
|
'trackback',
|
||||||
__('trackback creation'),
|
__('trackback creation'),
|
||||||
__('A new trackback to "%" at "%s" was created on post "%s" at %s'),
|
__('A new trackback to "%" at "%s" was created on post "%s" at %s'),
|
||||||
'coreAfterCommentCreate',
|
'coreAfterCommentCreate',
|
||||||
array('activityReportBehaviors','trackbackCreate')
|
array('activityReportBehaviors','trackbackCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/* Category
|
/* Category
|
||||||
-------------------------*/
|
-------------------------*/
|
||||||
$core->activityReport->addGroup('category',__('Actions on categories'));
|
$core->activityReport->addGroup('category',__('Actions on categories'));
|
||||||
|
|
||||||
# from BEHAVIOR adminAfterCategoryCreate in admin/category.php
|
# from BEHAVIOR adminAfterCategoryCreate in admin/category.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'category',
|
'category',
|
||||||
'create',
|
'create',
|
||||||
__('category creation'),
|
__('category creation'),
|
||||||
__('A new category called "%s" was created by "%s" at %s'),
|
__('A new category called "%s" was created by "%s" at %s'),
|
||||||
'adminAfterCategoryCreate',
|
'adminAfterCategoryCreate',
|
||||||
array('activityReportBehaviors','categoryCreate')
|
array('activityReportBehaviors','categoryCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR adminAfterCategoryUpdate in admin/category.php
|
# from BEHAVIOR adminAfterCategoryUpdate in admin/category.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'category',
|
'category',
|
||||||
'update',
|
'update',
|
||||||
__('updating category'),
|
__('updating category'),
|
||||||
__('Category called "%s" has been updated by "%s" at %s'),
|
__('Category called "%s" has been updated by "%s" at %s'),
|
||||||
'adminAfterCategoryUpdate',
|
'adminAfterCategoryUpdate',
|
||||||
array('activityReportBehaviors','categoryUpdate')
|
array('activityReportBehaviors','categoryUpdate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# Missing adminBeforeCategoryDelete in admin/category.php
|
# Missing adminBeforeCategoryDelete in admin/category.php
|
||||||
|
|
||||||
|
|
||||||
/* User
|
/* User
|
||||||
-------------------------*/
|
-------------------------*/
|
||||||
$core->activityReport->addGroup('user',__('Actions on users'));
|
$core->activityReport->addGroup('user',__('Actions on users'));
|
||||||
|
|
||||||
# from BEHAVIOR adminAfterUserCreate in admin/user.php
|
# from BEHAVIOR adminAfterUserCreate in admin/user.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'user',
|
'user',
|
||||||
'create',
|
'create',
|
||||||
__('user creation'),
|
__('user creation'),
|
||||||
__('A new user named "%s" was created by "%s"'),
|
__('A new user named "%s" was created by "%s"'),
|
||||||
'adminAfterUserCreate',
|
'adminAfterUserCreate',
|
||||||
array('activityReportBehaviors','userCreate')
|
array('activityReportBehaviors','userCreate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR adminAfterUserUpdated in admin/user.php
|
# from BEHAVIOR adminAfterUserUpdated in admin/user.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'user',
|
'user',
|
||||||
'update',
|
'update',
|
||||||
__('updating user'),
|
__('updating user'),
|
||||||
__('User named "%s" has been updated by "%s"'),
|
__('User named "%s" has been updated by "%s"'),
|
||||||
'adminAfterUserUpdate',
|
'adminAfterUserUpdate',
|
||||||
array('activityReportBehaviors','userUpdate')
|
array('activityReportBehaviors','userUpdate')
|
||||||
);
|
);
|
||||||
|
|
||||||
# from BEHAVIOR adminBeforeUserDelete in admin/users.php
|
# from BEHAVIOR adminBeforeUserDelete in admin/users.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
'user',
|
'user',
|
||||||
'delete',
|
'delete',
|
||||||
__('user deletion'),
|
__('user deletion'),
|
||||||
__('User named "%s" has been deleted by "%"'),
|
__('User named "%s" has been deleted by "%"'),
|
||||||
'adminBeforeUserDelete',
|
'adminBeforeUserDelete',
|
||||||
array('activityReportBehaviors','userDelete')
|
array('activityReportBehaviors','userDelete')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
class activityReportBehaviors
|
class activityReportBehaviors
|
||||||
{
|
{
|
||||||
public static function messageActivityReport($message)
|
public static function messageActivityReport($message)
|
||||||
{
|
{
|
||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$logs = array($message);
|
$logs = array($message);
|
||||||
|
|
||||||
$core->activityReport->addLog('activityReport','message',$logs);
|
$core->activityReport->addLog('activityReport','message',$logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function blogUpdate($cur,$blog_id)
|
public static function blogUpdate($cur,$blog_id)
|
||||||
{
|
{
|
||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$logs = array($core->auth->getInfo('user_cn'));
|
$logs = array($core->auth->getInfo('user_cn'));
|
||||||
|
|
||||||
$core->activityReport->addLog('blog','update',$logs);
|
$core->activityReport->addLog('blog','update',$logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function blogP404()
|
public static function blogP404()
|
||||||
{
|
{
|
||||||
global $core;
|
global $core;
|
||||||
if ($core->url->type != '404') return;
|
if ($core->url->type != '404') return;
|
||||||
|
|
||||||
$logs = array($core->blog->url.$_SERVER['QUERY_STRING']);
|
$logs = array($core->blog->url.$_SERVER['QUERY_STRING']);
|
||||||
|
|
||||||
$core->activityReport->addLog('blog','p404',$logs);
|
$core->activityReport->addLog('blog','p404',$logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function postCreate($cur,$post_id)
|
public static function postCreate($cur,$post_id)
|
||||||
{
|
{
|
||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$type = $cur->post_type ? $cur->post_type : 'post';
|
|
||||||
$post_url = $core->blog->getPostURL('',$cur->post_dt,$cur->post_title,$post_id);
|
|
||||||
|
|
||||||
$logs = array(
|
$type = $cur->post_type ? $cur->post_type : 'post';
|
||||||
$cur->post_title,
|
$post_url = $core->blog->getPostURL('',$cur->post_dt,$cur->post_title,$post_id);
|
||||||
$core->auth->getInfo('user_cn'),
|
|
||||||
$core->blog->url.$core->url->getBase($type).'/'.$post_url
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('post','create',$logs);
|
$logs = array(
|
||||||
}
|
$cur->post_title,
|
||||||
|
$core->auth->getInfo('user_cn'),
|
||||||
|
$core->blog->url.$core->url->getBase($type).'/'.$post_url
|
||||||
|
);
|
||||||
|
|
||||||
public static function postUpdate($cur,$post_id)
|
$core->activityReport->addLog('post','create',$logs);
|
||||||
{
|
}
|
||||||
global $core;
|
|
||||||
|
|
||||||
$type = $cur->post_type ? $cur->post_type : 'post';
|
|
||||||
$post_url = $core->blog->getPostURL('',$cur->post_dt,$cur->post_title,$post_id);
|
|
||||||
|
|
||||||
$logs = array(
|
public static function postUpdate($cur,$post_id)
|
||||||
$cur->post_title,
|
{
|
||||||
$core->auth->getInfo('user_cn'),
|
global $core;
|
||||||
$core->blog->url.$core->url->getBase($type).'/'.$post_url
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('post','update',$logs);
|
$type = $cur->post_type ? $cur->post_type : 'post';
|
||||||
}
|
$post_url = $core->blog->getPostURL('',$cur->post_dt,$cur->post_title,$post_id);
|
||||||
|
|
||||||
public static function postDelete($post_id)
|
$logs = array(
|
||||||
{
|
$cur->post_title,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn'),
|
||||||
$posts = $core->blog->getPosts(array('post_id'=>$post_id,'limit'=>1));
|
$core->blog->url.$core->url->getBase($type).'/'.$post_url
|
||||||
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('post','update',$logs);
|
||||||
$posts->post_title,
|
}
|
||||||
$core->auth->getInfo('user_cn')
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('post','delete',$logs);
|
public static function postDelete($post_id)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
$posts = $core->blog->getPosts(array('post_id'=>$post_id,'limit'=>1));
|
||||||
|
|
||||||
public static function postPasswordAttempt($result)
|
$logs = array(
|
||||||
{
|
$posts->post_title,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn')
|
||||||
if ($result['tpl'] != 'password-form.html' || empty($_POST['password'])) return;
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('post','delete',$logs);
|
||||||
$_POST['password'],
|
}
|
||||||
http::getSelfURI()
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('post','protection',$logs);
|
public static function postPasswordAttempt($result)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
if ($result['tpl'] != 'password-form.html' || empty($_POST['password'])) return;
|
||||||
|
|
||||||
public static function commentCreate($blog,$cur)
|
$logs = array(
|
||||||
{
|
$_POST['password'],
|
||||||
global $core;
|
http::getSelfURI()
|
||||||
if ($cur->comment_trackback) return;
|
);
|
||||||
|
|
||||||
$posts = $core->blog->getPosts(array('post_id'=>$cur->post_id,'limit'=>1));
|
$core->activityReport->addLog('post','protection',$logs);
|
||||||
|
}
|
||||||
|
|
||||||
$logs = array(
|
public static function commentCreate($blog,$cur)
|
||||||
$cur->comment_author,
|
{
|
||||||
$posts->post_title,
|
global $core;
|
||||||
$core->blog->url.$core->url->getBase($posts->post_type).
|
if ($cur->comment_trackback) return;
|
||||||
'/'.$posts->post_url.'#c'.$cur->comment_id
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('comment','create',$logs);
|
$posts = $core->blog->getPosts(array('post_id'=>$cur->post_id,'limit'=>1));
|
||||||
}
|
|
||||||
|
|
||||||
public static function commentUpdate($blog,$cur,$old)
|
$logs = array(
|
||||||
{
|
$cur->comment_author,
|
||||||
global $core;
|
$posts->post_title,
|
||||||
$posts = $core->blog->getPosts(array('post_id'=>$old->post_id,'limit'=>1));
|
$core->blog->url.$core->url->getBase($posts->post_type).
|
||||||
|
'/'.$posts->post_url.'#c'.$cur->comment_id
|
||||||
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('comment','create',$logs);
|
||||||
$core->auth->getInfo('user_cn'),
|
}
|
||||||
$posts->post_title,
|
|
||||||
$core->blog->url.$core->url->getBase($posts->post_type).
|
|
||||||
'/'.$posts->post_url.'#c'.$old->comment_id
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('comment','update',$logs);
|
public static function commentUpdate($blog,$cur,$old)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
$posts = $core->blog->getPosts(array('post_id'=>$old->post_id,'limit'=>1));
|
||||||
|
|
||||||
public static function trackbackCreate($cur,$comment_id)
|
$logs = array(
|
||||||
{
|
$core->auth->getInfo('user_cn'),
|
||||||
global $core;
|
$posts->post_title,
|
||||||
|
$core->blog->url.$core->url->getBase($posts->post_type).
|
||||||
|
'/'.$posts->post_url.'#c'.$old->comment_id
|
||||||
|
);
|
||||||
|
|
||||||
// From blog args are $blog,$cur #thks to bruno
|
$core->activityReport->addLog('comment','update',$logs);
|
||||||
$c = $cur instanceOf dcBlog ? $comment_id : $cur;
|
}
|
||||||
if (!$c->comment_trackback || !$c->comment_site) return;
|
|
||||||
|
|
||||||
$posts = $core->blog->getPosts(
|
public static function trackbackCreate($cur,$comment_id)
|
||||||
array('post_id'=>$c->post_id,'no_content'=>true,'limit'=>1));
|
{
|
||||||
if ($posts->isEmpty()) return;
|
global $core;
|
||||||
|
|
||||||
$logs = array(
|
// From blog args are $blog,$cur #thks to bruno
|
||||||
$c->comment_author,
|
$c = $cur instanceOf dcBlog ? $comment_id : $cur;
|
||||||
$c->comment_site,
|
if (!$c->comment_trackback || !$c->comment_site) return;
|
||||||
$posts->post_title,
|
|
||||||
$core->blog->url.$core->url->getBase($posts->post_type).
|
|
||||||
'/'.$posts->post_url
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('comment','trackback',$logs);
|
$posts = $core->blog->getPosts(
|
||||||
}
|
array('post_id'=>$c->post_id,'no_content'=>true,'limit'=>1));
|
||||||
|
if ($posts->isEmpty()) return;
|
||||||
|
|
||||||
public static function categoryCreate($cur,$cat_id)
|
$logs = array(
|
||||||
{
|
$c->comment_author,
|
||||||
global $core;
|
$c->comment_site,
|
||||||
|
$posts->post_title,
|
||||||
|
$core->blog->url.$core->url->getBase($posts->post_type).
|
||||||
|
'/'.$posts->post_url
|
||||||
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('comment','trackback',$logs);
|
||||||
$cur->cat_title,
|
}
|
||||||
$core->auth->getInfo('user_cn'),
|
|
||||||
$core->blog->url.$core->url->getBase('category').'/'.$cur->cat_url
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('category','create',$logs);
|
public static function categoryCreate($cur,$cat_id)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
|
||||||
public static function categoryUpdate($cur,$cat_id)
|
$logs = array(
|
||||||
{
|
$cur->cat_title,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn'),
|
||||||
|
$core->blog->url.$core->url->getBase('category').'/'.$cur->cat_url
|
||||||
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('category','create',$logs);
|
||||||
$cur->cat_title,
|
}
|
||||||
$core->auth->getInfo('user_cn'),
|
|
||||||
$core->blog->url.$core->url->getBase('category').'/'.$cur->cat_url
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('category','update',$logs);
|
public static function categoryUpdate($cur,$cat_id)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
|
||||||
public static function userCreate($cur,$user_id)
|
$logs = array(
|
||||||
{
|
$cur->cat_title,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn'),
|
||||||
$user_cn = dcUtils::getUserCN($cur->user_id, $cur->user_name,
|
$core->blog->url.$core->url->getBase('category').'/'.$cur->cat_url
|
||||||
$cur->user_firstname, $cur->user_displayname);
|
);
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('category','update',$logs);
|
||||||
$user_cn,
|
}
|
||||||
$core->auth->getInfo('user_cn')
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('user','create',$logs);
|
public static function userCreate($cur,$user_id)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
$user_cn = dcUtils::getUserCN($cur->user_id, $cur->user_name,
|
||||||
|
$cur->user_firstname, $cur->user_displayname);
|
||||||
|
|
||||||
public static function usertUpdate($cur,$user_id)
|
$logs = array(
|
||||||
{
|
$user_cn,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn')
|
||||||
$user_cn = dcUtils::getUserCN($cur->user_id, $cur->user_name,
|
);
|
||||||
$cur->user_firstname, $cur->user_displayname);
|
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('user','create',$logs);
|
||||||
$user_cn,
|
}
|
||||||
$core->auth->getInfo('user_cn')
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('user','update',$logs);
|
public static function usertUpdate($cur,$user_id)
|
||||||
}
|
{
|
||||||
|
global $core;
|
||||||
|
$user_cn = dcUtils::getUserCN($cur->user_id, $cur->user_name,
|
||||||
|
$cur->user_firstname, $cur->user_displayname);
|
||||||
|
|
||||||
public static function userDelete($user_id)
|
$logs = array(
|
||||||
{
|
$user_cn,
|
||||||
global $core;
|
$core->auth->getInfo('user_cn')
|
||||||
$users = $core->getUser($id);
|
);
|
||||||
$user_cn = dcUtils::getUserCN($users->user_id, $users->user_name,
|
|
||||||
$users->user_firstname, $users->user_displayname);
|
|
||||||
|
|
||||||
$logs = array(
|
$core->activityReport->addLog('user','update',$logs);
|
||||||
$user_cn,
|
}
|
||||||
$core->auth->getInfo('user_cn')
|
|
||||||
);
|
|
||||||
|
|
||||||
$core->activityReport->addLog('user','delete',$logs);
|
public static function userDelete($user_id)
|
||||||
}
|
{
|
||||||
}
|
global $core;
|
||||||
?>
|
$users = $core->getUser($id);
|
||||||
|
$user_cn = dcUtils::getUserCN($users->user_id, $users->user_name,
|
||||||
|
$users->user_firstname, $users->user_displayname);
|
||||||
|
|
||||||
|
$logs = array(
|
||||||
|
$user_cn,
|
||||||
|
$core->auth->getInfo('user_cn')
|
||||||
|
);
|
||||||
|
|
||||||
|
$core->activityReport->addLog('user','delete',$logs);
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,374 +1,374 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
||||||
|
|
||||||
class activityReportLib
|
class activityReportLib
|
||||||
{
|
{
|
||||||
public static function settingTab($core,$title,$global=false)
|
public static function settingTab($core,$title,$global=false)
|
||||||
{
|
{
|
||||||
$O =& $core->activityReport;
|
$O =& $core->activityReport;
|
||||||
$section = isset($_REQUEST['section']) ? $_REQUEST['section'] : '';
|
$section = isset($_REQUEST['section']) ? $_REQUEST['section'] : '';
|
||||||
|
|
||||||
if ($global)
|
|
||||||
{
|
|
||||||
$O->setGlobal();
|
|
||||||
$t = 'super';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$t = 'blog';
|
|
||||||
}
|
|
||||||
|
|
||||||
$combo_int = array(
|
if ($global)
|
||||||
__('every hour') => 3600,
|
{
|
||||||
__('every 2 hours') => 7200,
|
$O->setGlobal();
|
||||||
__('2 times by day') => 43200,
|
$t = 'super';
|
||||||
__('every day') => 86400,
|
}
|
||||||
__('every 2 days') => 172800,
|
else
|
||||||
__('every week') => 604800
|
{
|
||||||
);
|
$t = 'blog';
|
||||||
|
}
|
||||||
|
|
||||||
$combo_obs = array(
|
$combo_int = array(
|
||||||
__('every hour') => 3600,
|
__('every hour') => 3600,
|
||||||
__('every 2 hours') => 7200,
|
__('every 2 hours') => 7200,
|
||||||
__('2 times by day') => 43200,
|
__('2 times by day') => 43200,
|
||||||
__('every day') => 86400,
|
__('every day') => 86400,
|
||||||
__('every 2 days') => 172800,
|
__('every 2 days') => 172800,
|
||||||
__('every week') => 604800,
|
__('every week') => 604800
|
||||||
__('every 2 weeks') => 1209600,
|
);
|
||||||
__('every 4 weeks') => 2419200
|
|
||||||
);
|
|
||||||
|
|
||||||
$combo_format = array(
|
$combo_obs = array(
|
||||||
__('Plain text') => 'plain',
|
__('every hour') => 3600,
|
||||||
__('HTML') => 'html'
|
__('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
|
||||||
|
);
|
||||||
|
|
||||||
$redirect = false;
|
$combo_format = array(
|
||||||
if (!empty($_POST[$t.'_settings']))
|
__('Plain text') => 'plain',
|
||||||
{
|
__('HTML') => 'html'
|
||||||
# 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
|
$redirect = false;
|
||||||
if (!empty($_POST[$t.'_force_report']))
|
if (!empty($_POST[$t.'_settings']))
|
||||||
{
|
{
|
||||||
$core->activityReport->needReport(true);
|
# Active notification on this blog
|
||||||
$redirect = true;
|
$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);
|
||||||
|
|
||||||
# force to delete all logs now
|
$redirect = true;
|
||||||
if (!empty($_POST[$t.'_force_delete']))
|
}
|
||||||
{
|
|
||||||
$core->activityReport->deleteLogs();
|
|
||||||
$redirect = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($redirect)
|
# force to send report now
|
||||||
{
|
if (!empty($_POST[$t.'_force_report']))
|
||||||
http::redirect('plugin.php?p=activityReport&tab='.$t.'_settings&section'.$section);
|
{
|
||||||
}
|
$core->activityReport->needReport(true);
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
|
||||||
$bl = $O->getSetting('lastreport');
|
# force to delete all logs now
|
||||||
$blog_last = !$bl ? __('never') : dt::str($core->blog->settings->system->date_format.', '.$core->blog->settings->system->time_format,$bl,$core->auth->getInfo('user_tz'));
|
if (!empty($_POST[$t.'_force_delete']))
|
||||||
|
{
|
||||||
|
$core->activityReport->deleteLogs();
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
|
||||||
$bi = $O->getSetting('interval');
|
if ($redirect)
|
||||||
$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'));
|
{
|
||||||
|
http::redirect('plugin.php?p=activityReport&tab='.$t.'_settings&section'.$section);
|
||||||
|
}
|
||||||
|
|
||||||
$emails = implode(';',$O->getSetting('mailinglist'));
|
$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');
|
||||||
<div class="multi-part" id="<?php echo $t; ?>_settings" title="<?php echo $title; ?>">
|
$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'));
|
||||||
|
|
||||||
<?php if (!$global) { ?>
|
$emails = implode(';',$O->getSetting('mailinglist'));
|
||||||
|
|
||||||
<p><img alt="<?php echo __('RSS feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" />
|
?>
|
||||||
<a title="<?php echo __('RSS feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/rss2/'.$O->getUserCode(); ?>">
|
<div class="multi-part" id="<?php echo $t; ?>_settings" title="<?php echo $title; ?>">
|
||||||
<?php echo __('Rss2 feed for activity on this blog'); ?></a>
|
|
||||||
<br />
|
|
||||||
<img alt="<?php echo __('Atom feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" />
|
|
||||||
<a title="<?php echo __('Atom feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/atom/'.$O->getUserCode(); ?>">
|
|
||||||
<?php echo __('Atom feed for activity on this blog'); ?></a></p>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<form id="setting-<?php echo $t; ?>-form" method="post" action="plugin.php">
|
<?php if (!$global) { ?>
|
||||||
|
|
||||||
<fieldset id="setting-<?php echo $t; ?>-setting"><legend><?php echo __('Settings'); ?></legend>
|
<p><img alt="<?php echo __('RSS feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" />
|
||||||
|
<a title="<?php echo __('RSS feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/rss2/'.$O->getUserCode(); ?>">
|
||||||
|
<?php echo __('Rss2 feed for activity on this blog'); ?></a>
|
||||||
|
<br />
|
||||||
|
<img alt="<?php echo __('Atom feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" />
|
||||||
|
<a title="<?php echo __('Atom feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/atom/'.$O->getUserCode(); ?>">
|
||||||
|
<?php echo __('Atom feed for activity on this blog'); ?></a></p>
|
||||||
|
|
||||||
<p><label class="classic"><?php echo
|
<?php } ?>
|
||||||
form::checkbox(array('active'),'1',
|
|
||||||
$O->getSetting('active')).' '.
|
|
||||||
($global ?
|
|
||||||
__('Enable super administrator report') :
|
|
||||||
__('Enable report on this blog')
|
|
||||||
); ?>
|
|
||||||
</label></p>
|
|
||||||
<p><label class="classic"><?php echo __('Automatic cleaning of old logs:').'<br />'.
|
|
||||||
form::combo(array('obsolete'),$combo_obs,$O->getSetting('obsolete')); ?>
|
|
||||||
</label></p>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if (!$global)
|
<form id="setting-<?php echo $t; ?>-form" method="post" action="plugin.php">
|
||||||
{
|
|
||||||
|
|
||||||
?>
|
<fieldset id="setting-<?php echo $t; ?>-setting"><legend><?php echo __('Settings'); ?></legend>
|
||||||
<p><label class="classic"><?php echo
|
|
||||||
form::checkbox(array('dashboardItem'),'1',
|
|
||||||
$O->getSetting('dashboardItem')).' '.
|
|
||||||
__('Add activity report on dashboard items'); ?>
|
|
||||||
</label></p>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
}
|
<p><label class="classic"><?php echo
|
||||||
|
form::checkbox(array('active'),'1',
|
||||||
|
$O->getSetting('active')).' '.
|
||||||
|
($global ?
|
||||||
|
__('Enable super administrator report') :
|
||||||
|
__('Enable report on this blog')
|
||||||
|
); ?>
|
||||||
|
</label></p>
|
||||||
|
<p><label class="classic"><?php echo __('Automatic cleaning of old logs:').'<br />'.
|
||||||
|
form::combo(array('obsolete'),$combo_obs,$O->getSetting('obsolete')); ?>
|
||||||
|
</label></p>
|
||||||
|
<?php
|
||||||
|
|
||||||
?>
|
if (!$global)
|
||||||
<p><label class="classic"><?php echo __('Send report:').'<br />'.
|
{
|
||||||
form::combo(array('interval'),$combo_int,$O->getSetting('interval')); ?>
|
|
||||||
</label></p>
|
|
||||||
|
|
||||||
<p><label class="classic"><?php echo __('Date format:').'<br />'.
|
?>
|
||||||
form::field(array('dateformat'),60,255,$O->getSetting('dateformat')); ?>
|
<p><label class="classic"><?php echo
|
||||||
</label></p>
|
form::checkbox(array('dashboardItem'),'1',
|
||||||
<p class="form-note"><?php echo __('Use Dotclear date formaters. ex: %B %d at %H:%M'); ?></p>
|
$O->getSetting('dashboardItem')).' '.
|
||||||
|
__('Add activity report on dashboard items'); ?>
|
||||||
|
</label></p>
|
||||||
|
<?php
|
||||||
|
|
||||||
<p><label class="classic"><?php echo __('Report format:').'<br />'.
|
}
|
||||||
form::combo(array('mailformat'),$combo_format,$O->getSetting('mailformat')); ?>
|
|
||||||
</label></p>
|
|
||||||
|
|
||||||
<p><label class="classic"><?php echo __('Recipients:').'<br />'.
|
?>
|
||||||
form::field(array('mailinglist'),60,255,$emails); ?>
|
<p><label class="classic"><?php echo __('Send report:').'<br />'.
|
||||||
</label></p>
|
form::combo(array('interval'),$combo_int,$O->getSetting('interval')); ?>
|
||||||
<p class="form-note"><?php echo __('Separate multiple email addresses with a semicolon ";"'); ?></p>
|
</label></p>
|
||||||
|
|
||||||
<ul>
|
<p><label class="classic"><?php echo __('Date format:').'<br />'.
|
||||||
<li><?php echo __('Last report by email:').' '.$blog_last; ?></li>
|
form::field(array('dateformat'),60,255,$O->getSetting('dateformat')); ?>
|
||||||
<li><?php echo __('Next report by email:').' '.$blog_next; ?></li>
|
</label></p>
|
||||||
</ul>
|
<p class="form-note"><?php echo __('Use Dotclear date formaters. ex: %B %d at %H:%M'); ?></p>
|
||||||
|
|
||||||
</fieldset>
|
<p><label class="classic"><?php echo __('Report format:').'<br />'.
|
||||||
<?php
|
form::combo(array('mailformat'),$combo_format,$O->getSetting('mailformat')); ?>
|
||||||
|
</label></p>
|
||||||
|
|
||||||
if ($global)
|
<p><label class="classic"><?php echo __('Recipients:').'<br />'.
|
||||||
{
|
form::field(array('mailinglist'),60,255,$emails); ?>
|
||||||
?>
|
</label></p>
|
||||||
<fieldset id="setting-<?php echo $t; ?>-blog"><legend><?php echo __('Blogs'); ?></legend>
|
<p class="form-note"><?php echo __('Separate multiple email addresses with a semicolon ";"'); ?></p>
|
||||||
<div class="three-cols">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$i = 0;
|
<ul>
|
||||||
$selected_blogs = $O->getSetting('blogs');
|
<li><?php echo __('Last report by email:').' '.$blog_last; ?></li>
|
||||||
$blogs = $core->getBlogs();
|
<li><?php echo __('Next report by email:').' '.$blog_next; ?></li>
|
||||||
while($blogs->fetch())
|
</ul>
|
||||||
{
|
|
||||||
$blog_id = $core->con->escape($blogs->blog_id);
|
|
||||||
?>
|
|
||||||
<div class="col">
|
|
||||||
<p><label class="classic"><?php echo
|
|
||||||
form::checkbox(array('blogs['.$i.']'),$blog_id,
|
|
||||||
in_array($blog_id,$selected_blogs)).' '.
|
|
||||||
$blogs->blog_name.' ('.$blog_id.')'; ?>
|
|
||||||
</label></p>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$i++;
|
</fieldset>
|
||||||
}
|
<?php
|
||||||
|
|
||||||
?>
|
if ($global)
|
||||||
</div>
|
{
|
||||||
</fieldset>
|
?>
|
||||||
<?php
|
<fieldset id="setting-<?php echo $t; ?>-blog"><legend><?php echo __('Blogs'); ?></legend>
|
||||||
}
|
<div class="three-cols">
|
||||||
|
<?php
|
||||||
|
|
||||||
?>
|
$i = 0;
|
||||||
<fieldset id="setting-<?php echo $t; ?>-report"><legend><?php echo __('Report'); ?></legend>
|
$selected_blogs = $O->getSetting('blogs');
|
||||||
<div class="three-cols">
|
$blogs = $core->getBlogs();
|
||||||
<?php
|
while($blogs->fetch())
|
||||||
|
{
|
||||||
|
$blog_id = $core->con->escape($blogs->blog_id);
|
||||||
|
?>
|
||||||
|
<div class="col">
|
||||||
|
<p><label class="classic"><?php echo
|
||||||
|
form::checkbox(array('blogs['.$i.']'),$blog_id,
|
||||||
|
in_array($blog_id,$selected_blogs)).' '.
|
||||||
|
$blogs->blog_name.' ('.$blog_id.')'; ?>
|
||||||
|
</label></p>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
$groups = $O->getGroups();
|
$i++;
|
||||||
$blog_request = $O->getSetting('requests');
|
}
|
||||||
|
|
||||||
$i = 0;
|
?>
|
||||||
foreach($groups as $k_group => $v_group)
|
</div>
|
||||||
{
|
</fieldset>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="col">
|
<fieldset id="setting-<?php echo $t; ?>-report"><legend><?php echo __('Report'); ?></legend>
|
||||||
<h3><?php echo __($v_group['title']); ?></h3>
|
<div class="three-cols">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach($v_group['actions'] as $k_action => $v_action)
|
$groups = $O->getGroups();
|
||||||
{
|
$blog_request = $O->getSetting('requests');
|
||||||
?>
|
|
||||||
<p><label class="classic"><?php echo
|
|
||||||
form::checkbox(array('requests['.$k_group.']['.$k_action.']'),'1',
|
|
||||||
isset($blog_request[$k_group][$k_action])).' '.__($v_action['title']); ?>
|
|
||||||
</label></p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
$i = 0;
|
||||||
</div>
|
foreach($groups as $k_group => $v_group)
|
||||||
<?php
|
{
|
||||||
|
|
||||||
$i++;
|
?>
|
||||||
if ($i == 3) {
|
<div class="col">
|
||||||
?></div><div class="three-cols"><?php
|
<h3><?php echo __($v_group['title']); ?></h3>
|
||||||
$i = 0;
|
<?php
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
foreach($v_group['actions'] as $k_action => $v_action)
|
||||||
</div>
|
{
|
||||||
</fieldset>
|
?>
|
||||||
|
<p><label class="classic"><?php echo
|
||||||
|
form::checkbox(array('requests['.$k_group.']['.$k_action.']'),'1',
|
||||||
|
isset($blog_request[$k_group][$k_action])).' '.__($v_action['title']); ?>
|
||||||
|
</label></p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
<p>
|
?>
|
||||||
<input type="submit" name="<?php echo $t; ?>_settings" value="<?php echo __('Save'); ?>" />
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($emails))
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<input type="submit" name="<?php echo $t; ?>_force_report" value="<?php echo __('Send report by email now'); ?>" />
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
if ($global)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<input type="submit" name="<?php echo $t; ?>_force_delete" value="<?php echo __('Delete all logs'); ?>" />
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
echo
|
|
||||||
form::hidden(array('p'),'activityReport').
|
|
||||||
form::hidden(array('tab'),$t.'_settings').
|
|
||||||
form::hidden(array('section'),$section).
|
|
||||||
$core->formNonce();
|
|
||||||
?>
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
$O->unsetGlobal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function logTab($core,$title,$global=false)
|
$i++;
|
||||||
{
|
if ($i == 3) {
|
||||||
$O =& $core->activityReport;
|
?></div><div class="three-cols"><?php
|
||||||
if ($global)
|
$i = 0;
|
||||||
{
|
}
|
||||||
$O->setGlobal();
|
}
|
||||||
$t = 'super';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$t = 'blog';
|
|
||||||
}
|
|
||||||
|
|
||||||
$params = array();
|
?>
|
||||||
$logs = $O->getLogs($params);
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
?>
|
<p>
|
||||||
<div class="multi-part" id="<?php echo $t; ?>_logs" title="<?php echo $title; ?>">
|
<input type="submit" name="<?php echo $t; ?>_settings" value="<?php echo __('Save'); ?>" />
|
||||||
<?php
|
<?php
|
||||||
|
if (!empty($emails))
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<input type="submit" name="<?php echo $t; ?>_force_report" value="<?php echo __('Send report by email now'); ?>" />
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
if ($global)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<input type="submit" name="<?php echo $t; ?>_force_delete" value="<?php echo __('Delete all logs'); ?>" />
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
echo
|
||||||
|
form::hidden(array('p'),'activityReport').
|
||||||
|
form::hidden(array('tab'),$t.'_settings').
|
||||||
|
form::hidden(array('section'),$section).
|
||||||
|
$core->formNonce();
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
$O->unsetGlobal();
|
||||||
|
}
|
||||||
|
|
||||||
if ($logs->isEmpty())
|
public static function logTab($core,$title,$global=false)
|
||||||
{
|
{
|
||||||
echo '<p>'.__('No log').'</p>';
|
$O =& $core->activityReport;
|
||||||
}
|
if ($global)
|
||||||
else
|
{
|
||||||
{
|
$O->setGlobal();
|
||||||
|
$t = 'super';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$t = 'blog';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
$params = array();
|
||||||
<table>
|
$logs = $O->getLogs($params);
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php echo __('Action'); ?></th>
|
|
||||||
<th><?php echo __('Message'); ?></th>
|
|
||||||
<th><?php echo __('Date'); ?></th>
|
|
||||||
<?php if ($global) { ?>
|
|
||||||
<th><?php echo __('Blog'); ?></th>
|
|
||||||
<?php } ?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
while($logs->fetch())
|
?>
|
||||||
{
|
<div class="multi-part" id="<?php echo $t; ?>_logs" title="<?php echo $title; ?>">
|
||||||
$off = $global && $logs->activity_blog_status == 1 ?
|
<?php
|
||||||
' offline' : '';
|
|
||||||
$date = dt::str(
|
|
||||||
$core->blog->settings->system->date_format.', '.$core->blog->settings->system->time_format,
|
|
||||||
strtotime($logs->activity_dt),
|
|
||||||
$core->auth->getInfo('user_tz')
|
|
||||||
);
|
|
||||||
$action = $O->getGroups($logs->activity_group,$logs->activity_action);
|
|
||||||
|
|
||||||
if (empty($action)) continue;
|
if ($logs->isEmpty())
|
||||||
|
{
|
||||||
|
echo '<p>'.__('No log').'</p>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
$msg = vsprintf(__($action['msg']),$O->decode($logs->activity_logs));
|
?>
|
||||||
?>
|
<table>
|
||||||
<tr class="line<?php echo $off; ?>">
|
<thead>
|
||||||
<td class="nowrap"><?php echo __($action['title']); ?></td>
|
<tr>
|
||||||
<td class="maximal"><?php echo $msg; ?></td>
|
<th><?php echo __('Action'); ?></th>
|
||||||
<td class="nowrap"><?php echo $date; ?></td>
|
<th><?php echo __('Message'); ?></th>
|
||||||
<?php if ($global) { ?>
|
<th><?php echo __('Date'); ?></th>
|
||||||
<td class="nowrap"><?php echo $logs->blog_id; ?></td>
|
<?php if ($global) { ?>
|
||||||
<?php } ?>
|
<th><?php echo __('Blog'); ?></th>
|
||||||
</tr>
|
<?php } ?>
|
||||||
<?php
|
</tr>
|
||||||
}
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
?>
|
while($logs->fetch())
|
||||||
</tbody>
|
{
|
||||||
</table>
|
$off = $global && $logs->activity_blog_status == 1 ?
|
||||||
<?php
|
' offline' : '';
|
||||||
|
$date = dt::str(
|
||||||
|
$core->blog->settings->system->date_format.', '.$core->blog->settings->system->time_format,
|
||||||
|
strtotime($logs->activity_dt),
|
||||||
|
$core->auth->getInfo('user_tz')
|
||||||
|
);
|
||||||
|
$action = $O->getGroups($logs->activity_group,$logs->activity_action);
|
||||||
|
|
||||||
}
|
if (empty($action)) continue;
|
||||||
|
|
||||||
?>
|
$msg = vsprintf(__($action['msg']),$O->decode($logs->activity_logs));
|
||||||
</div>
|
?>
|
||||||
<?php
|
<tr class="line<?php echo $off; ?>">
|
||||||
|
<td class="nowrap"><?php echo __($action['title']); ?></td>
|
||||||
|
<td class="maximal"><?php echo $msg; ?></td>
|
||||||
|
<td class="nowrap"><?php echo $date; ?></td>
|
||||||
|
<?php if ($global) { ?>
|
||||||
|
<td class="nowrap"><?php echo $logs->blog_id; ?></td>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
$O->unsetGlobal();
|
?>
|
||||||
}
|
</tbody>
|
||||||
}
|
</table>
|
||||||
?>
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$O->unsetGlobal();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
$format = array(
|
$format = array(
|
||||||
|
|
||||||
|
@ -66,5 +67,4 @@ $format = array(
|
||||||
|
|
||||||
"%PERIOD%\n-----------------------------------------------------------\n%TEXT%"
|
"%PERIOD%\n-----------------------------------------------------------\n%TEXT%"
|
||||||
|
|
||||||
));
|
));
|
||||||
?>
|
|
31
index.php
31
index.php
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
/**
|
||||||
# This file is part of activityReport, a plugin for Dotclear 2.
|
* @brief activityReport, a plugin for Dotclear 2
|
||||||
#
|
*
|
||||||
# Copyright (c) 2009-2010 JC Denis and contributors
|
* @package Dotclear
|
||||||
# jcdenis@gdwd.com
|
* @subpackage Plugin
|
||||||
#
|
*
|
||||||
# Licensed under the GPL version 2.0 license.
|
* @author Jean-Christian Denis and contributors
|
||||||
# A copy of this license is available in LICENSE file or at
|
*
|
||||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* @copyright Jean-Christian Denis
|
||||||
# -- END LICENSE BLOCK ------------------------------------
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
if (!defined('DC_CONTEXT_ADMIN')){return;}
|
||||||
|
|
||||||
|
@ -45,17 +46,17 @@ dcPage::jsVar('jcToolsBox.prototype.section',$section).
|
||||||
<?php
|
<?php
|
||||||
if (!activityReport::hasMailer())
|
if (!activityReport::hasMailer())
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<p class="error"><?php echo __('This server has no mail function, activityReport not send email report.'); ?></p>
|
<p class="error"><?php echo __('This server has no mail function, activityReport not send email report.'); ?></p>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
activityReportLib::settingTab($core,__('Settings'));
|
activityReportLib::settingTab($core,__('Settings'));
|
||||||
activityReportLib::logTab($core,__('Logs'));
|
activityReportLib::logTab($core,__('Logs'));
|
||||||
|
|
||||||
if ($core->auth->isSuperAdmin())
|
if ($core->auth->isSuperAdmin())
|
||||||
{
|
{
|
||||||
activityReportLib::settingTab($core,__('Super settings'),true);
|
activityReportLib::settingTab($core,__('Super settings'),true);
|
||||||
activityReportLib::logTab($core,__('Super logs'),true);
|
activityReportLib::logTab($core,__('Super logs'),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
/* tools */
|
/* tools */
|
||||||
dotclear.jcTools = new jcToolsBox();
|
dotclear.jcTools = new jcToolsBox();
|
||||||
|
|
||||||
/* setting blog */
|
/* setting blog */
|
||||||
var bForm=$('#setting-blog-form');
|
var bForm=$('#setting-blog-form');
|
||||||
if ($(bForm).attr('id')!=undefined){
|
if ($(bForm).attr('id')!=undefined){
|
||||||
|
|
|
@ -259,6 +259,4 @@ $GLOBALS['__l10n']['Logs'] = 'Enregistrements';
|
||||||
$GLOBALS['__l10n']['Super settings'] = 'Super paramètres';
|
$GLOBALS['__l10n']['Super settings'] = 'Super paramètres';
|
||||||
|
|
||||||
#index.php:58
|
#index.php:58
|
||||||
$GLOBALS['__l10n']['Super logs'] = 'Super enregistrements';
|
$GLOBALS['__l10n']['Super logs'] = 'Super enregistrements';
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in a new issue