use anonymous functions

master
Jean-Christian Paul Denis 2022-12-10 23:27:55 +01:00
parent 361d6e6fea
commit f8d6fa9894
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 77 additions and 92 deletions

View File

@ -31,48 +31,7 @@ class zcfsActivityReportBehaviors
__('feed creation'), __('feed creation'),
__('A new feed named "%s" point to "%s" was added by "%s"'), __('A new feed named "%s" point to "%s" was added by "%s"'),
'zoneclearFeedServerAfterAddFeed', 'zoneclearFeedServerAfterAddFeed',
['zoneclearFeedServerActivityReportBehaviors', 'addFeed'] function ($cur) {
);
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedinfo',
__('updating feed info'),
__('Feed named "%s" point to "%s" has been updated by "%s"'),
'zoneclearFeedServerAfterUpdFeed',
['zoneclearFeedServerActivityReportBehaviors', 'updFeedInfo']
);
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedrecords',
__('updating feed records'),
__('Records of the feed named "%s" have been updated automatically'),
'zoneclearFeedServerAfterUpdFeed',
['zoneclearFeedServerActivityReportBehaviors', 'updFeedRecord']
);
# from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'delete',
__('feed deletion'),
__('Feed named "%s" point to "%s" has been deleted by "%s"'),
'zoneclearFeedServerAfterDelFeed',
['zoneclearFeedServerActivityReportBehaviors', 'delFeed']
);
# from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'status',
__('feed status'),
__('Feed named "%s" point to "%s" has been set to "%s"'),
'zoneclearFeedServerAfterEnableFeed',
['zoneclearFeedServerActivityReportBehaviors', 'enableFeed']
);
}
public static function addFeed($cur)
{
$logs = [ $logs = [
$cur->feed_name, $cur->feed_name,
$cur->feed_feed, $cur->feed_feed,
@ -85,9 +44,15 @@ class zcfsActivityReportBehaviors
$logs $logs
); );
} }
);
public static function updFeedInfo($cur, $id) # from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
{ dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedinfo',
__('updating feed info'),
__('Feed named "%s" point to "%s" has been updated by "%s"'),
'zoneclearFeedServerAfterUpdFeed',
function ($cur, $id) {
if (defined('DC_CONTEXT_ADMIN')) { if (defined('DC_CONTEXT_ADMIN')) {
$zc = new zoneclearFeedServer(); $zc = new zoneclearFeedServer();
$rs = $zc->getFeeds(['feed_id' => $id]); $rs = $zc->getFeeds(['feed_id' => $id]);
@ -105,9 +70,15 @@ class zcfsActivityReportBehaviors
); );
} }
} }
);
public static function updFeedRecord($cur, $id) # from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
{ dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedrecords',
__('updating feed records'),
__('Records of the feed named "%s" have been updated automatically'),
'zoneclearFeedServerAfterUpdFeed',
function ($cur, $id) {
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
$zc = new zoneclearFeedServer(); $zc = new zoneclearFeedServer();
$rs = $zc->getFeeds(['feed_id' => $id]); $rs = $zc->getFeeds(['feed_id' => $id]);
@ -123,9 +94,15 @@ class zcfsActivityReportBehaviors
); );
} }
} }
);
public static function delFeed($id) # from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
{ dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'delete',
__('feed deletion'),
__('Feed named "%s" point to "%s" has been deleted by "%s"'),
'zoneclearFeedServerAfterDelFeed',
function ($id) {
$zc = new zoneclearFeedServer(); $zc = new zoneclearFeedServer();
$rs = $zc->getFeeds(['feed_id' => $id]); $rs = $zc->getFeeds(['feed_id' => $id]);
@ -141,9 +118,15 @@ class zcfsActivityReportBehaviors
$logs $logs
); );
} }
);
public static function enableFeed($id, $enable, $time) # from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
{ dcCore::app()->activityReport->addAction(
'zoneclearFeedServer',
'status',
__('feed status'),
__('Feed named "%s" point to "%s" has been set to "%s"'),
'zoneclearFeedServerAfterEnableFeed',
function ($id, $enable, $time) {
$zc = new zoneclearFeedServer(); $zc = new zoneclearFeedServer();
$rs = $zc->getFeeds(['feed_id' => $id]); $rs = $zc->getFeeds(['feed_id' => $id]);
@ -159,4 +142,6 @@ class zcfsActivityReportBehaviors
$logs $logs
); );
} }
);
}
} }