Dotclear

source: plugins/pollsFactory/inc/lib.pollsfactory.activityreport.php @ 2139

Revision 2139, 1.6 KB checked in by JcDenis, 14 years ago (diff)

pollsFactory 1.0:

  • Rewrited plugin
Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3# This file is part of pollsFactory, a plugin for Dotclear 2.
4#
5# Copyright (c) 2009-2010 JC Denis and contributors
6# jcdenis@gdwd.com
7#
8# Licensed under the GPL version 2.0 license.
9# A copy of this license is available in LICENSE file or at
10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11# -- END LICENSE BLOCK ------------------------------------
12
13if (!defined('DC_RC_PATH')){return;}
14
15# This file is used with plugin activityReport
16$core->activityReport->addGroup('pollsfactory',__('Plugin polls factory'));
17
18# from BEHAVIOR publicAfterPollsFactoryVote in pollsFactory/_public.php
19$core->activityReport->addAction(
20     'pollsfactory',
21     'set',
22     __('new vote'),
23     __('New vote on poll called "%s" was set'),
24     'publicAfterPollsFactoryVote',
25     array('pollsFactoryActivityReportBehaviors','addResponse')
26);
27# from BEHAVIOR adminAfterPollsFactoryCreate in pollsFactory/inc/index.poll.php
28$core->activityReport->addAction(
29     'pollsfactory',
30     'create',
31     __('poll creation'),
32     __('Poll called "%s" was created by "%s"'),
33     'adminAfterPollsFactoryCreate',
34     array('pollsFactoryActivityReportBehaviors','createPoll')
35);
36
37class pollsFactoryActivityReportBehaviors
38{
39     public static function addResponse($poll,$people_id)
40     {
41          $logs = array(
42               $poll->post_title,
43          );
44
45          $GLOBALS['core']->activityReport->addLog('pollsfactory','set',$logs);
46     }
47     public static function createPoll($poll,$poll_id)
48     {
49          global $core;
50
51          $logs = array(
52               $poll->post_title,
53               $core->auth->getInfo('user_cn')
54          );
55
56          $core->activityReport->addLog('pollsfactory','create',$logs);
57     }
58}
59?>
Note: See TracBrowser for help on using the repository browser.

Sites map