clean up code (no real changes)
This commit is contained in:
parent
b57b273d84
commit
68e2a4d1f1
@ -2,10 +2,9 @@
|
|||||||
- [ ] fix Dotclear 2.19 compatibility
|
- [ ] fix Dotclear 2.19 compatibility
|
||||||
- [ ] fix php7.3+ php8.0 compatibility
|
- [ ] fix php7.3+ php8.0 compatibility
|
||||||
- [ ] clean up code
|
- [ ] clean up code
|
||||||
- [ ] fix license
|
- [x] fix license
|
||||||
- [ ] fix translations
|
- [ ] fix translations
|
||||||
- [ ] remove all SoCialMe feature as this plugin is dead
|
- [x] remove all SoCialMe feature as this plugin is dead
|
||||||
- [ ] add asynchronous update of for feeds
|
|
||||||
- [ ] fix disallow self blog feeds
|
- [ ] fix disallow self blog feeds
|
||||||
- [ ] add plugin muppet support (request Mathieu M.)
|
- [ ] add plugin muppet support (request Mathieu M.)
|
||||||
- [ ] add log for errors
|
- [ ] add log for errors
|
||||||
|
9
LICENSE
9
LICENSE
@ -1,7 +1,7 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
|
|||||||
convey the exclusion of warranty; and each file should have at least
|
convey the exclusion of warranty; and each file should have at least
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
{description}
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) {year} {fullname}
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
|
|||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
{signature of Ty Coon}, 1 April 1989
|
<signature of Ty Coon>, 1 April 1989
|
||||||
Ty Coon, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
@ -337,4 +337,3 @@ proprietary programs. If your program is a subroutine library, you may
|
|||||||
consider it more useful to permit linking proprietary applications with the
|
consider it more useful to permit linking proprietary applications with the
|
||||||
library. If this is what you want to do, use the GNU Lesser General
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|
||||||
|
11
README.md
11
README.md
@ -1,10 +1,11 @@
|
|||||||
# README
|
# README
|
||||||
|
|
||||||
[![Release version](https://img.shields.io/github/v/release/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/releases)
|
[![Release](https://img.shields.io/github/v/release/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/releases)
|
||||||
[![Release date](https://img.shields.io/github/release-date/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/releases)
|
[![Date](https://img.shields.io/github/release-date/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/releases)
|
||||||
[![Issue tracking](https://img.shields.io/github/issues/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/issues)
|
[![Issues](https://img.shields.io/github/issues/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/issues)
|
||||||
[![Dotclear version](https://img.shields.io/badge/dotclear-v2.7-blue.svg)](https://fr.dotclear.org/download)
|
[![Dotclear](https://img.shields.io/badge/dotclear-v2.19-blue.svg)](https://fr.dotclear.org/download)
|
||||||
[![License](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://github.com/JcDenis/zoneclearFeedServer/blob/master/LICENSE)
|
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/zoneclearFeedServer)
|
||||||
|
[![License](https://img.shields.io/github/license/JcDenis/zoneclearFeedServer)](https://github.com/JcDenis/zoneclearFeedServer/blob/master/LICENSE)
|
||||||
|
|
||||||
## WHAT IS ZONECLEARFEEDSERVER ?
|
## WHAT IS ZONECLEARFEEDSERVER ?
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ if (!defined('DC_RC_PATH')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->registerModule(
|
$this->registerModule(
|
||||||
'zoneclearFeedServer',
|
'Feeds server',
|
||||||
'Mix your blog with a feeds planet',
|
'Mix your blog with a feeds planet',
|
||||||
'Jean-Christian Denis, BG, Pierre Van Glabeke',
|
'Jean-Christian Denis, BG, Pierre Van Glabeke',
|
||||||
'2015.07.19',
|
'2015.07.19',
|
||||||
|
@ -28,7 +28,7 @@ $core->url->register(
|
|||||||
'zoneclearFeedsPage',
|
'zoneclearFeedsPage',
|
||||||
'zcfeeds',
|
'zcfeeds',
|
||||||
'^zcfeeds(.*?)$',
|
'^zcfeeds(.*?)$',
|
||||||
array('zcfsUrlHandler', 'zcFeedsPage')
|
['zcfsUrlHandler', 'zcFeedsPage']
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add to report on plugin activityReport
|
// Add to report on plugin activityReport
|
||||||
|
182
_public.php
182
_public.php
@ -22,55 +22,37 @@ $s = $core->blog->settings->zoneclearFeedServer;
|
|||||||
# Widgets
|
# Widgets
|
||||||
require_once dirname(__FILE__) . '/_widgets.php';
|
require_once dirname(__FILE__) . '/_widgets.php';
|
||||||
|
|
||||||
$core->addBehavior(
|
$core->addBehavior('coreBlogGetPosts', ['zcfsPublicBehaviors', 'coreBlogGetPosts']);
|
||||||
'coreBlogGetPosts',
|
|
||||||
array('zcfsPublicBehaviors', 'coreBlogGetPosts')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!$s->zoneclearFeedServer_active) {
|
if (!$s->zoneclearFeedServer_active) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (1 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
if (1 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
||||||
$core->addBehavior(
|
$core->addBehavior('publicBeforeDocument', ['zcfsPublicBehaviors', 'publicDocument']);
|
||||||
'publicBeforeDocument',
|
} elseif (2 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
||||||
array('zcfsPublicBehaviors', 'publicDocument')
|
$core->addBehavior('publicAfterDocument', ['zcfsPublicBehaviors', 'publicAfterDocument']);
|
||||||
);
|
} elseif (3 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
||||||
}
|
$core->addBehavior('publicHeadContent', ['zcfsPublicBehaviors', 'publicHeadContent']);
|
||||||
elseif (2 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
|
||||||
$core->addBehavior(
|
|
||||||
'publicAfterDocument',
|
|
||||||
array('zcfsPublicBehaviors', 'publicAfterDocument')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
elseif (3 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
|
||||||
$core->addBehavior(
|
|
||||||
'publicHeadContent',
|
|
||||||
array('zcfsPublicBehaviors', 'publicHeadContent')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Take care about tweakurls (thanks Mathieu M.)
|
# Take care about tweakurls (thanks Mathieu M.)
|
||||||
if (version_compare($core->plugins->moduleInfo('tweakurls', 'version'), '0.8', '>=')) {
|
if (version_compare($core->plugins->moduleInfo('tweakurls', 'version'), '0.8', '>=')) {
|
||||||
$core->addbehavior(
|
$core->addbehavior('zoneclearFeedServerAfterPostCreate', ['zoneclearFeedServer', 'tweakurlsAfterPostCreate']);
|
||||||
'zoneclearFeedServerAfterPostCreate',
|
|
||||||
array('zoneclearFeedServer', 'tweakurlsAfterPostCreate')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Register tempalte blocks
|
# Register tempalte blocks
|
||||||
$tpl_blocks = array(
|
$tpl_blocks = [
|
||||||
'Feeds',
|
'Feeds',
|
||||||
'FeedsFooter',
|
'FeedsFooter',
|
||||||
'FeedsHeader',
|
'FeedsHeader',
|
||||||
'FeedIf'
|
'FeedIf'
|
||||||
);
|
];
|
||||||
foreach($tpl_blocks as $v) {
|
foreach($tpl_blocks as $v) {
|
||||||
$core->tpl->addBlock('zc'.$v, array('zcfsTemplate', $v));
|
$core->tpl->addBlock('zc' .$v, ['zcfsTemplate', $v]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Register tempalte values
|
# Register tempalte values
|
||||||
$tpl_values = array(
|
$tpl_values = [
|
||||||
'FeedsCount',
|
'FeedsCount',
|
||||||
'FeedsEntriesCount',
|
'FeedsEntriesCount',
|
||||||
'FeedEntriesCount',
|
'FeedEntriesCount',
|
||||||
@ -87,9 +69,9 @@ $tpl_values = array(
|
|||||||
'FeedDesc',
|
'FeedDesc',
|
||||||
'FeedSiteURL',
|
'FeedSiteURL',
|
||||||
'FeedFeedURL'
|
'FeedFeedURL'
|
||||||
);
|
];
|
||||||
foreach($tpl_values as $v) {
|
foreach($tpl_values as $v) {
|
||||||
$core->tpl->addValue('zc'.$v, array('zcfsTemplate', $v));
|
$core->tpl->addValue('zc' . $v, ['zcfsTemplate', $v]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,8 +102,7 @@ class zcfsPublicBehaviors
|
|||||||
{
|
{
|
||||||
# Limit feeds update to home page et feed page
|
# Limit feeds update to home page et feed page
|
||||||
# Like publishScheduledEntries
|
# Like publishScheduledEntries
|
||||||
if (!in_array($core->url->type, array('default', 'feed'))) {
|
if (!in_array($core->url->type, ['default', 'feed'])) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +134,6 @@ class zcfsPublicBehaviors
|
|||||||
{
|
{
|
||||||
# Limit update to home page
|
# Limit update to home page
|
||||||
if ($core->url->type != 'default') {
|
if ($core->url->type != 'default') {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,19 +146,13 @@ class zcfsPublicBehaviors
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
"\n<!-- JS for zoneclearFeedServer --> \n" .
|
"\n<!-- JS for zoneclearFeedServer --> \n" .
|
||||||
"<script type=\"text/javascript\" src=\"".
|
dcutils::jsLoad($core->blog->url . $core->url->getBase('zoneclearFeedsPage') . '/zcfsupd.js') .
|
||||||
$core->blog->url.
|
"<script type=\"text/javascript\"> \n//<![CDATA[\n" .
|
||||||
$core->url->getBase('zoneclearFeedsPage').
|
|
||||||
'/zcfsupd.js">'.
|
|
||||||
"</script> \n".
|
|
||||||
"<script type=\"text/javascript\"> \n".
|
|
||||||
"//<![CDATA[\n".
|
|
||||||
" \$(function(){if(!document.getElementById){return;} " .
|
" \$(function(){if(!document.getElementById){return;} " .
|
||||||
" $('body').zoneclearFeedServer({blog_url:'" .
|
" $('body').zoneclearFeedServer({blog_url:'" .
|
||||||
$blog_url . "',blog_id:'" . $blog_id . "'}); " .
|
$blog_url . "',blog_id:'" . $blog_id . "'}); " .
|
||||||
" })\n" .
|
" })\n" .
|
||||||
"//]]>\n".
|
"//]]>\n</script>\n";
|
||||||
"</script>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,12 +172,11 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
*/
|
*/
|
||||||
public static function zcFeed($rs, $info)
|
public static function zcFeed($rs, $info)
|
||||||
{
|
{
|
||||||
$p = array(
|
$meta = $rs->core->meta->getMetadata([
|
||||||
'post_id' => $rs->post_id,
|
'post_id' => $rs->post_id,
|
||||||
'meta_type' => 'zoneclearfeed_' . $info,
|
'meta_type' => 'zoneclearfeed_' . $info,
|
||||||
'limit' => 1
|
'limit' => 1
|
||||||
);
|
]);
|
||||||
$meta = $rs->core->meta->getMetadata($p);
|
|
||||||
|
|
||||||
return $meta->isEmpty() ? null : $meta->meta_id;
|
return $meta->isEmpty() ? null : $meta->meta_id;
|
||||||
}
|
}
|
||||||
@ -219,12 +192,10 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
{
|
{
|
||||||
if (!empty($GLOBALS['beforeZcFeedRsExt'][$type])) {
|
if (!empty($GLOBALS['beforeZcFeedRsExt'][$type])) {
|
||||||
$func = $GLOBALS['beforeZcFeedRsExt'][$type];
|
$func = $GLOBALS['beforeZcFeedRsExt'][$type];
|
||||||
}
|
} elseif (is_callable('rsExtPostPublic', $type)) {
|
||||||
elseif (is_callable('rsExtPostPublic', $type)) {
|
$func = ['rsExtPostPublic', $type];
|
||||||
$func = array('rsExtPostPublic', $type);
|
} else {
|
||||||
}
|
$func = ['rsExtPost', $type];
|
||||||
else {
|
|
||||||
$func = array('rsExtPost', $type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return call_user_func_array($func, $args);
|
return call_user_func_array($func, $args);
|
||||||
@ -242,9 +213,9 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
$site = $rs->zcFeed('site');
|
$site = $rs->zcFeed('site');
|
||||||
$sitename = $rs->zcFeed('sitename');
|
$sitename = $rs->zcFeed('sitename');
|
||||||
|
|
||||||
return ($author && $sitename) ?
|
return $author && $sitename ?
|
||||||
$author.' (<a href="'.$site.'">'.$sitename.'</a>)' :
|
sprintf('%s (<a href="%s">%s</a>)', $author, $site, $sitename) :
|
||||||
self::zcFeedBrother('getAuthorLink', array(&$rs));
|
self::zcFeedBrother('getAuthorLink', [&$rs]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -258,7 +229,7 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
$author = $rs->zcFeed('author');
|
$author = $rs->zcFeed('author');
|
||||||
return $author ?
|
return $author ?
|
||||||
$author :
|
$author :
|
||||||
self::zcFeedBrother('getAuthorCN', array(&$rs));
|
self::zcFeedBrother('getAuthorCN', [&$rs]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -275,7 +246,7 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
|
|
||||||
return $url && $full ?
|
return $url && $full ?
|
||||||
zoneclearFeedServer::absoluteURL($rs->zcFeed('site'), $url) :
|
zoneclearFeedServer::absoluteURL($rs->zcFeed('site'), $url) :
|
||||||
self::zcFeedBrother('getURL', array(&$rs));
|
self::zcFeedBrother('getURL', [&$rs]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -288,32 +259,31 @@ class zcfsRsExtPosts extends rsExtPost
|
|||||||
{
|
{
|
||||||
$url = $rs->zcFeed('url');
|
$url = $rs->zcFeed('url');
|
||||||
$sitename = $rs->zcFeed('sitename');
|
$sitename = $rs->zcFeed('sitename');
|
||||||
$content = self::zcFeedBrother('getContent', array(&$rs,$absolute_urls));
|
$content = self::zcFeedBrother('getContent', [&$rs, $absolute_urls]);
|
||||||
|
|
||||||
if ($url && $sitename && $rs->post_type == 'post') {
|
if ($url && $sitename && $rs->post_type == 'post') {
|
||||||
$types = @unserialize($rs->core->blog->settings->zoneclearFeedServer->zoneclearFeedServer_post_full_tpl);
|
$types = @unserialize($rs->core->blog->settings->zoneclearFeedServer->zoneclearFeedServer_post_full_tpl);
|
||||||
|
|
||||||
if (is_array($types) && in_array($rs->core->url->type, $types)) {
|
if (is_array($types) && in_array($rs->core->url->type, $types)) {
|
||||||
|
|
||||||
return $content .
|
return $content . sprintf(
|
||||||
'<p class="zoneclear-original"><em>'.
|
'<p class="zoneclear-original"><em>%s</em></p>',
|
||||||
sprintf(__('Original post on <a href="%s">%s</a>'), $url, $sitename).
|
sprintf(__('Original post on <a href="%s">%s</a>'), $url, $sitename)
|
||||||
'</em></p>';
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$content = context::remove_html($content);
|
$content = context::remove_html($content);
|
||||||
$content = context::cut_string($content, 350);
|
$content = context::cut_string($content, 350);
|
||||||
$content = html::escapeHTML($content);
|
$content = html::escapeHTML($content);
|
||||||
|
|
||||||
return
|
return sprintf(
|
||||||
'<p>'.$content.'... '.
|
'<p>%s... <em><a href="%s" title="%s">%s</a></em></p>',
|
||||||
'<em><a href="'.self::getURL($rs).'" title="'.
|
$content,
|
||||||
__('Read more details about this feed').
|
self::getURL($rs),
|
||||||
'">'.__('Continue reading').'</a></em></p>';
|
__('Read more details about this feed'),
|
||||||
|
__('Continue reading')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,25 +315,27 @@ class zcfsUrlHandler extends dcUrlHandlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Update feeds (from ajax or other post resquest)
|
# Update feeds (from ajax or other post resquest)
|
||||||
if ($args == '/zcfsupd'
|
if ($args == '/zcfsupd' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
||||||
&& 3 == $s->zoneclearFeedServer_bhv_pub_upd
|
|
||||||
) {
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (!empty($_POST['blogId'])
|
if (!empty($_POST['blogId']) && html::escapeJS($core->blog->id) == $_POST['blogId']) {
|
||||||
&& html::escapeJS($core->blog->id) == $_POST['blogId']
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
$zc = new zoneclearFeedServer($core);
|
$zc = new zoneclearFeedServer($core);
|
||||||
if ($zc->checkFeedsUpdate()) {
|
if ($zc->checkFeedsUpdate()) {
|
||||||
$msg = '<status>ok</status><message>'.
|
$msg = sprintf(
|
||||||
'Feeds updated successfully</message>';
|
'<status>%s</status><message>s%</message>',
|
||||||
|
'ok',
|
||||||
|
'Feeds updated successfully'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception $e) {}
|
catch (Exception $e) {}
|
||||||
}
|
}
|
||||||
if (empty($msg)) {
|
if (empty($msg)) {
|
||||||
$msg = '<status>failed</status><message>'.
|
$msg = sprintf(
|
||||||
'Failed to update feeds</message>';
|
'<status>%s</status><message>s%</message>',
|
||||||
|
'failed',
|
||||||
|
'Failed to update feeds'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: application/xml; charset=UTF-8');
|
header('Content-Type: application/xml; charset=UTF-8');
|
||||||
@ -374,11 +346,9 @@ class zcfsUrlHandler extends dcUrlHandlers
|
|||||||
'</rsp></response>';
|
'</rsp></response>';
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
|
||||||
# Server js
|
# Server js
|
||||||
elseif ($args == '/zcfsupd.js'
|
} elseif ($args == '/zcfsupd.js' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) {
|
||||||
&& 3 == $s->zoneclearFeedServer_bhv_pub_upd
|
|
||||||
) {
|
|
||||||
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__) . '/default-templates');
|
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__) . '/default-templates');
|
||||||
self::serveDocument(
|
self::serveDocument(
|
||||||
'zcfsupd.js',
|
'zcfsupd.js',
|
||||||
@ -386,16 +356,15 @@ class zcfsUrlHandler extends dcUrlHandlers
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
|
||||||
# Server feeds description page
|
# Server feeds description page
|
||||||
elseif (in_array($args, array('', '/'))
|
} elseif (in_array($args, ['', '/']) && $s->zoneclearFeedServer_pub_active) {
|
||||||
&& $s->zoneclearFeedServer_pub_active
|
|
||||||
) {
|
|
||||||
$tplset = $core->themes->moduleInfo($core->blog->settings->system->theme, 'tplset');
|
$tplset = $core->themes->moduleInfo($core->blog->settings->system->theme, 'tplset');
|
||||||
if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) {
|
$path = dirname(__FILE__) . '/default-templates/';
|
||||||
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset);
|
if (!empty($tplset) && is_dir($path . $tplset)) {
|
||||||
|
$core->tpl->setPath($core->tpl->getPath(), $path . $tplset);
|
||||||
} else {
|
} else {
|
||||||
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET);
|
$core->tpl->setPath($core->tpl->getPath(), $path . DC_DEFAULT_TPLSET);
|
||||||
}
|
}
|
||||||
self::serveDocument('zcfeeds.html');
|
self::serveDocument('zcfeeds.html');
|
||||||
}
|
}
|
||||||
@ -434,8 +403,7 @@ class zcfsTemplate
|
|||||||
}
|
}
|
||||||
if (isset($a['feed_status'])) {
|
if (isset($a['feed_status'])) {
|
||||||
$p .= "\$zcfs_params['feed_status'] = " . ((integer) $a['feed_status']) . ";\n";
|
$p .= "\$zcfs_params['feed_status'] = " . ((integer) $a['feed_status']) . ";\n";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$p .= "\$zcfs_params['feed_status'] = 1;\n";
|
$p .= "\$zcfs_params['feed_status'] = 1;\n";
|
||||||
}
|
}
|
||||||
if (!empty($a['feed_url'])) {
|
if (!empty($a['feed_url'])) {
|
||||||
@ -456,9 +424,7 @@ class zcfsTemplate
|
|||||||
case 'id' : $sortby = 'feed_id'; break;
|
case 'id' : $sortby = 'feed_id'; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($a['order'])
|
if (isset($a['order']) && preg_match('/^(desc|asc)$/i', $a['order'])) {
|
||||||
&& preg_match('/^(desc|asc)$/i', $a['order'])
|
|
||||||
) {
|
|
||||||
$order = $a['order'];
|
$order = $a['order'];
|
||||||
}
|
}
|
||||||
$p .= "\$zcfs_params['order'] = '" . $sortby . " " . $order . "';\n";
|
$p .= "\$zcfs_params['order'] = '" . $sortby . " " . $order . "';\n";
|
||||||
@ -475,7 +441,7 @@ class zcfsTemplate
|
|||||||
|
|
||||||
public static function FeedIf($a, $c)
|
public static function FeedIf($a, $c)
|
||||||
{
|
{
|
||||||
$if = array();
|
$if = [];
|
||||||
|
|
||||||
$operator = isset($a['operator']) ? self::getOperator($a['operator']) : '&&';
|
$operator = isset($a['operator']) ? self::getOperator($a['operator']) : '&&';
|
||||||
|
|
||||||
@ -489,8 +455,7 @@ class zcfsTemplate
|
|||||||
if (substr($url, 0, 1) == '!') {
|
if (substr($url, 0, 1) == '!') {
|
||||||
$url = substr($url, 1);
|
$url = substr($url, 1);
|
||||||
$if[] = '$_ctx->feeds->feed_url != "' . addslashes($url) . '"';
|
$if[] = '$_ctx->feeds->feed_url != "' . addslashes($url) . '"';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$if[] = '$_ctx->feeds->feed_url == "' . addslashes($url) . '"';
|
$if[] = '$_ctx->feeds->feed_url == "' . addslashes($url) . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -499,8 +464,7 @@ class zcfsTemplate
|
|||||||
if (substr($url, 0, 1) == '!') {
|
if (substr($url, 0, 1) == '!') {
|
||||||
$url = substr($url, 1);
|
$url = substr($url, 1);
|
||||||
$if[] = '$_ctx->feeds->feed_feed != "' . addslashes($url) . '"';
|
$if[] = '$_ctx->feeds->feed_feed != "' . addslashes($url) . '"';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$if[] = '$_ctx->feeds->feed_feed == "' . addslashes($url) . '"';
|
$if[] = '$_ctx->feeds->feed_feed == "' . addslashes($url) . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,8 +473,7 @@ class zcfsTemplate
|
|||||||
if (substr($category, 0, 1) == '!') {
|
if (substr($category, 0, 1) == '!') {
|
||||||
$category = substr($category, 1);
|
$category = substr($category, 1);
|
||||||
$if[] = '($_ctx->feeds->cat_url != "' . $category . '")';
|
$if[] = '($_ctx->feeds->cat_url != "' . $category . '")';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$if[] = '($_ctx->feeds->cat_url == "' . $category . '")';
|
$if[] = '($_ctx->feeds->cat_url == "' . $category . '")';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,9 +559,10 @@ class zcfsTemplate
|
|||||||
$f = $GLOBALS['core']->tpl->getFilters($a);
|
$f = $GLOBALS['core']->tpl->getFilters($a);
|
||||||
|
|
||||||
return empty($a['full']) ?
|
return empty($a['full']) ?
|
||||||
'<?php echo '.sprintf($f,'$_ctx->feeds->feed_lang').'; ?>'
|
'<?php echo ' . sprintf($f, '$_ctx->feeds->feed_lang') . '; ?>' :
|
||||||
:
|
'<?php $langs = l10n::getISOcodes(); if (isset($langs[$_ctx->feeds->feed_lang])) { echo ' .
|
||||||
'<?php $langs = l10n::getISOcodes(); if (isset($langs[$_ctx->feeds->feed_lang])) { echo '.sprintf($f, '$langs[$_ctx->feeds->feed_lang]').'; } else { echo '.sprintf($f, '$_ctx->feeds->feed_lang').'; } unset($langs); ?>';
|
sprintf($f, '$langs[$_ctx->feeds->feed_lang]') .'; } else { echo ' .
|
||||||
|
sprintf($f, '$_ctx->feeds->feed_lang') . '; } unset($langs); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function FeedName($a)
|
public static function FeedName($a)
|
||||||
@ -732,7 +696,7 @@ class zcfsTemplate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$core->addBehavior('publicBreadcrumb',array('extZcfeeds','publicBreadcrumb'));
|
$core->addBehavior('publicBreadcrumb', ['extZcfeeds', 'publicBreadcrumb']);
|
||||||
|
|
||||||
class extZcfeeds
|
class extZcfeeds
|
||||||
{
|
{
|
||||||
|
@ -15,14 +15,14 @@ class zcfsFeedsActionsPage extends dcActionsPage
|
|||||||
{
|
{
|
||||||
public $zcfs;
|
public $zcfs;
|
||||||
|
|
||||||
public function __construct(dcCore $core, $uri, $redirect_args=array())
|
public function __construct(dcCore $core, $uri, $redirect_args = [])
|
||||||
{
|
{
|
||||||
$this->zcfs = new zoneclearFeedServer($core);
|
$this->zcfs = new zoneclearFeedServer($core);
|
||||||
|
|
||||||
parent::__construct($core, $uri, $redirect_args);
|
parent::__construct($core, $uri, $redirect_args);
|
||||||
$this->redirect_fields = array(
|
$this->redirect_fields = [
|
||||||
'sortby', 'order', 'page', 'nb'
|
'sortby', 'order', 'page', 'nb'
|
||||||
);
|
];
|
||||||
$this->field_entries = 'feeds';
|
$this->field_entries = 'feeds';
|
||||||
$this->caller_title = __('Feeds');
|
$this->caller_title = __('Feeds');
|
||||||
$this->loadDefaults();
|
$this->loadDefaults();
|
||||||
@ -48,25 +48,25 @@ class zcfsFeedsActionsPage extends dcActionsPage
|
|||||||
|
|
||||||
public function endPage()
|
public function endPage()
|
||||||
{
|
{
|
||||||
echo
|
echo '</body></html>';
|
||||||
'</body></html>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function error(Exception $e)
|
public function error(Exception $e)
|
||||||
{
|
{
|
||||||
$this->core->error->add($e->getMessage());
|
$this->core->error->add($e->getMessage());
|
||||||
$this->beginPage(dcPage::breadcrumb(array(
|
$this->beginPage(
|
||||||
|
dcPage::breadcrumb([
|
||||||
html::escapeHTML($this->core->blog->name) => '',
|
html::escapeHTML($this->core->blog->name) => '',
|
||||||
$this->getCallerTitle() => $this->getRedirection(true),
|
$this->getCallerTitle() => $this->getRedirection(true),
|
||||||
__('Feeds actions') => ''
|
__('Feeds actions') => ''
|
||||||
)));
|
])
|
||||||
|
);
|
||||||
$this->endPage();
|
$this->endPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function fetchEntries($from)
|
protected function fetchEntries($from)
|
||||||
{
|
{
|
||||||
if (!empty($from['feeds'])) {
|
if (!empty($from['feeds'])) {
|
||||||
|
|
||||||
$params['feed_id'] = $from['feeds'];
|
$params['feed_id'] = $from['feeds'];
|
||||||
|
|
||||||
$feeds = $this->zcfs->getFeeds($params);
|
$feeds = $this->zcfs->getFeeds($params);
|
||||||
@ -74,11 +74,9 @@ class zcfsFeedsActionsPage extends dcActionsPage
|
|||||||
$this->entries[$feeds->feed_id] = $feeds->feed_name;
|
$this->entries[$feeds->feed_id] = $feeds->feed_name;
|
||||||
}
|
}
|
||||||
$this->rs = $feeds;
|
$this->rs = $feeds;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->rs = $this->core->con->select(
|
$this->rs = $this->core->con->select(
|
||||||
"SELECT blog_id FROM ".
|
"SELECT blog_id FROM " . $this->core->prefix . "blog WHERE false"
|
||||||
$this->core->prefix."blog WHERE false"
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,36 +93,36 @@ class zcfsDefaultFeedsActions
|
|||||||
public static function zcfsFeedsActionsPage(dcCore $core, zcfsFeedsActionsPage $ap)
|
public static function zcfsFeedsActionsPage(dcCore $core, zcfsFeedsActionsPage $ap)
|
||||||
{
|
{
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Change category') => 'changecat'),
|
[__('Change category') => 'changecat'],
|
||||||
array('zcfsDefaultFeedsActions', 'doChangeCategory')
|
['zcfsDefaultFeedsActions', 'doChangeCategory']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Change update interval') => 'changeint'),
|
[__('Change update interval') => 'changeint'],
|
||||||
array('zcfsDefaultFeedsActions', 'doChangeInterval')
|
['zcfsDefaultFeedsActions', 'doChangeInterval']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Disable feed update') => 'disablefeed'),
|
[__('Disable feed update') => 'disablefeed'],
|
||||||
array('zcfsDefaultFeedsActions', 'doEnableFeed')
|
['zcfsDefaultFeedsActions', 'doEnableFeed']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Enable feed update') => 'enablefeed'),
|
[__('Enable feed update') => 'enablefeed'],
|
||||||
array('zcfsDefaultFeedsActions', 'doEnableFeed')
|
['zcfsDefaultFeedsActions', 'doEnableFeed']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Reset last update') => 'resetupdlast'),
|
[__('Reset last update') => 'resetupdlast'],
|
||||||
array('zcfsDefaultFeedsActions', 'doResetUpdate')
|
['zcfsDefaultFeedsActions', 'doResetUpdate']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Update (check) feed') => 'updatefeed'),
|
[__('Update (check) feed') => 'updatefeed'],
|
||||||
array('zcfsDefaultFeedsActions', 'doUpdateFeed')
|
['zcfsDefaultFeedsActions', 'doUpdateFeed']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Delete related posts') => 'deletepost'),
|
[__('Delete related posts') => 'deletepost'],
|
||||||
array('zcfsDefaultFeedsActions', 'doDeletePost')
|
['zcfsDefaultFeedsActions', 'doDeletePost']
|
||||||
);
|
);
|
||||||
$ap->addAction(
|
$ap->addAction(
|
||||||
array(__('Delete feed (without related posts)') => 'deletefeed'),
|
[__('Delete feed (without related posts)') => 'deletefeed'],
|
||||||
array('zcfsDefaultFeedsActions', 'doDeleteFeed')
|
['zcfsDefaultFeedsActions', 'doDeleteFeed']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,13 +160,13 @@ class zcfsDefaultFeedsActions
|
|||||||
|
|
||||||
public static function doDeletePost(dcCore $core, zcfsFeedsActionsPage $ap, $post)
|
public static function doDeletePost(dcCore $core, zcfsFeedsActionsPage $ap, $post)
|
||||||
{
|
{
|
||||||
$types = array(
|
$types = [
|
||||||
'zoneclearfeed_url',
|
'zoneclearfeed_url',
|
||||||
'zoneclearfeed_author',
|
'zoneclearfeed_author',
|
||||||
'zoneclearfeed_site',
|
'zoneclearfeed_site',
|
||||||
'zoneclearfeed_sitename',
|
'zoneclearfeed_sitename',
|
||||||
'zoneclearfeed_id'
|
'zoneclearfeed_id'
|
||||||
);
|
];
|
||||||
|
|
||||||
$ids = $ap->getIDs();
|
$ids = $ap->getIDs();
|
||||||
|
|
||||||
@ -178,9 +176,9 @@ class zcfsDefaultFeedsActions
|
|||||||
|
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
|
|
||||||
$posts = $ap->zcfs->getPostsByFeed(array(
|
$posts = $ap->zcfs->getPostsByFeed([
|
||||||
'feed_id' => $id
|
'feed_id' => $id
|
||||||
));
|
]);
|
||||||
|
|
||||||
while($posts->fetch()) {
|
while($posts->fetch()) {
|
||||||
|
|
||||||
@ -297,30 +295,27 @@ class zcfsDefaultFeedsActions
|
|||||||
count($ids)
|
count($ids)
|
||||||
));
|
));
|
||||||
$ap->redirect(true);
|
$ap->redirect(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
$categories_combo = dcAdminCombos::getCategoriesCombo(
|
$categories_combo = dcAdminCombos::getCategoriesCombo(
|
||||||
$core->blog->getCategories()
|
$core->blog->getCategories()
|
||||||
);
|
);
|
||||||
|
|
||||||
$ap->beginPage(
|
$ap->beginPage(
|
||||||
dcPage::breadcrumb(
|
dcPage::breadcrumb([
|
||||||
array(
|
|
||||||
html::escapeHTML($core->blog->name) => '',
|
html::escapeHTML($core->blog->name) => '',
|
||||||
__('Feeds server') => '',
|
__('Feeds server') => '',
|
||||||
$ap->getCallerTitle() => $ap->getRedirection(true),
|
$ap->getCallerTitle() => $ap->getRedirection(true),
|
||||||
__('Change category for this selection') => ''
|
__('Change category for this selection') => ''
|
||||||
)));
|
]));
|
||||||
|
|
||||||
echo
|
echo
|
||||||
'<form action="' . $ap->getURI() . '" method="post">' .
|
'<form action="' . $ap->getURI() . '" method="post">' .
|
||||||
$ap->getCheckboxes() .
|
$ap->getCheckboxes() .
|
||||||
'<p><label for="upd_cat_id" class="classic">' . __('Category:') . '</label> ' .
|
'<p><label for="upd_cat_id" class="classic">' . __('Category:') . '</label> ' .
|
||||||
form::combo(array('upd_cat_id'), $categories_combo, '').
|
form::combo(['upd_cat_id'], $categories_combo, '') .
|
||||||
$core->formNonce() .
|
$core->formNonce() .
|
||||||
$ap->getHiddenFields() .
|
$ap->getHiddenFields() .
|
||||||
form::hidden(array('action'), 'changecat').
|
form::hidden(['action'], 'changecat') .
|
||||||
'<input type="submit" value="' . __('Save') . '" /></p>' .
|
'<input type="submit" value="' . __('Save') . '" /></p>' .
|
||||||
'</form>';
|
'</form>';
|
||||||
|
|
||||||
@ -359,21 +354,21 @@ class zcfsDefaultFeedsActions
|
|||||||
|
|
||||||
$ap->beginPage(
|
$ap->beginPage(
|
||||||
dcPage::breadcrumb(
|
dcPage::breadcrumb(
|
||||||
array(
|
[
|
||||||
html::escapeHTML($core->blog->name) => '',
|
html::escapeHTML($core->blog->name) => '',
|
||||||
__('Feeds server') => '',
|
__('Feeds server') => '',
|
||||||
$ap->getCallerTitle() => $ap->getRedirection(true),
|
$ap->getCallerTitle() => $ap->getRedirection(true),
|
||||||
__('Change update frequency for this selection') => ''
|
__('Change update frequency for this selection') => ''
|
||||||
)));
|
]));
|
||||||
|
|
||||||
echo
|
echo
|
||||||
'<form action="' . $ap->getURI() . '" method="post">' .
|
'<form action="' . $ap->getURI() . '" method="post">' .
|
||||||
$ap->getCheckboxes() .
|
$ap->getCheckboxes() .
|
||||||
'<p><label for="upd_upd_int" class="classic">' . __('Frequency:') . '</label> ' .
|
'<p><label for="upd_upd_int" class="classic">' . __('Frequency:') . '</label> ' .
|
||||||
form::combo(array('upd_upd_int'), $ap->zcfs->getAllUpdateInterval(), '').
|
form::combo(['upd_upd_int'], $ap->zcfs->getAllUpdateInterval(), '') .
|
||||||
$core->formNonce() .
|
$core->formNonce() .
|
||||||
$ap->getHiddenFields() .
|
$ap->getHiddenFields() .
|
||||||
form::hidden(array('action'), 'changeint').
|
form::hidden(['action'], 'changeint') .
|
||||||
'<input type="submit" value="' . __('Save') . '" /></p>' .
|
'<input type="submit" value="' . __('Save') . '" /></p>' .
|
||||||
'</form>';
|
'</form>';
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')) {
|
if (!defined('DC_RC_PATH')) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ $core->activityReport->addAction(
|
|||||||
__('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',
|
||||||
array('zoneclearFeedServerActivityReportBehaviors', 'addFeed')
|
['zoneclearFeedServerActivityReportBehaviors', 'addFeed']
|
||||||
);
|
);
|
||||||
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
@ -38,7 +37,7 @@ $core->activityReport->addAction(
|
|||||||
__('updating feed info'),
|
__('updating feed info'),
|
||||||
__('Feed named "%s" point to "%s" has been updated by "%s"'),
|
__('Feed named "%s" point to "%s" has been updated by "%s"'),
|
||||||
'zoneclearFeedServerAfterUpdFeed',
|
'zoneclearFeedServerAfterUpdFeed',
|
||||||
array('zoneclearFeedServerActivityReportBehaviors', 'updFeedInfo')
|
['zoneclearFeedServerActivityReportBehaviors', 'updFeedInfo']
|
||||||
);
|
);
|
||||||
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
@ -47,7 +46,7 @@ $core->activityReport->addAction(
|
|||||||
__('updating feed records'),
|
__('updating feed records'),
|
||||||
__('Records of the feed named "%s" have been updated automatically'),
|
__('Records of the feed named "%s" have been updated automatically'),
|
||||||
'zoneclearFeedServerAfterUpdFeed',
|
'zoneclearFeedServerAfterUpdFeed',
|
||||||
array('zoneclearFeedServerActivityReportBehaviors', 'updFeedRecord')
|
['zoneclearFeedServerActivityReportBehaviors', 'updFeedRecord']
|
||||||
);
|
);
|
||||||
# from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
# from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
@ -56,7 +55,7 @@ $core->activityReport->addAction(
|
|||||||
__('feed deletion'),
|
__('feed deletion'),
|
||||||
__('Feed named "%s" point to "%s" has been deleted by "%s"'),
|
__('Feed named "%s" point to "%s" has been deleted by "%s"'),
|
||||||
'zoneclearFeedServerAfterDelFeed',
|
'zoneclearFeedServerAfterDelFeed',
|
||||||
array('zoneclearFeedServerActivityReportBehaviors', 'delFeed')
|
['zoneclearFeedServerActivityReportBehaviors', 'delFeed']
|
||||||
);
|
);
|
||||||
# from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
# from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
|
||||||
$core->activityReport->addAction(
|
$core->activityReport->addAction(
|
||||||
@ -65,7 +64,7 @@ $core->activityReport->addAction(
|
|||||||
__('feed status'),
|
__('feed status'),
|
||||||
__('Feed named "%s" point to "%s" has been set to "%s"'),
|
__('Feed named "%s" point to "%s" has been set to "%s"'),
|
||||||
'zoneclearFeedServerAfterEnableFeed',
|
'zoneclearFeedServerAfterEnableFeed',
|
||||||
array('zoneclearFeedServerActivityReportBehaviors', 'enableFeed')
|
['zoneclearFeedServerActivityReportBehaviors', 'enableFeed']
|
||||||
);
|
);
|
||||||
|
|
||||||
class zoneclearFeedServerActivityReportBehaviors
|
class zoneclearFeedServerActivityReportBehaviors
|
||||||
@ -74,11 +73,11 @@ class zoneclearFeedServerActivityReportBehaviors
|
|||||||
{
|
{
|
||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$logs = array(
|
$logs = [
|
||||||
$cur->feed_name,
|
$cur->feed_name,
|
||||||
$cur->feed_feed,
|
$cur->feed_feed,
|
||||||
$core->auth->getInfo('user_cn')
|
$core->auth->getInfo('user_cn')
|
||||||
);
|
];
|
||||||
|
|
||||||
$core->activityReport->addLog(
|
$core->activityReport->addLog(
|
||||||
'zoneclearFeedServer',
|
'zoneclearFeedServer',
|
||||||
@ -92,13 +91,13 @@ class zoneclearFeedServerActivityReportBehaviors
|
|||||||
if (defined('DC_CONTEXT_ADMIN')) {
|
if (defined('DC_CONTEXT_ADMIN')) {
|
||||||
global $core;
|
global $core;
|
||||||
$zc = new zoneclearFeedServer($core);
|
$zc = new zoneclearFeedServer($core);
|
||||||
$rs = $zc->getFeeds(array('feed_id' => $id));
|
$rs = $zc->getFeeds(['feed_id' => $id]);
|
||||||
|
|
||||||
$logs = array(
|
$logs = [
|
||||||
$rs->feed_name,
|
$rs->feed_name,
|
||||||
$rs->feed_feed,
|
$rs->feed_feed,
|
||||||
$core->auth->getInfo('user_cn')
|
$core->auth->getInfo('user_cn')
|
||||||
);
|
];
|
||||||
|
|
||||||
$core->activityReport->addLog(
|
$core->activityReport->addLog(
|
||||||
'zoneclearFeedServer',
|
'zoneclearFeedServer',
|
||||||
@ -113,11 +112,11 @@ class zoneclearFeedServerActivityReportBehaviors
|
|||||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
global $core;
|
global $core;
|
||||||
$zc = new zoneclearFeedServer($core);
|
$zc = new zoneclearFeedServer($core);
|
||||||
$rs = $zc->getFeeds(array('feed_id' => $id));
|
$rs = $zc->getFeeds(['feed_id' => $id]);
|
||||||
|
|
||||||
$logs = array(
|
$logs = [
|
||||||
$rs->feed_name
|
$rs->feed_name
|
||||||
);
|
];
|
||||||
|
|
||||||
$core->activityReport->addLog(
|
$core->activityReport->addLog(
|
||||||
'zoneclearFeedServer',
|
'zoneclearFeedServer',
|
||||||
@ -132,13 +131,13 @@ class zoneclearFeedServerActivityReportBehaviors
|
|||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$zc = new zoneclearFeedServer($core);
|
$zc = new zoneclearFeedServer($core);
|
||||||
$rs = $zc->getFeeds(array('feed_id' => $id));
|
$rs = $zc->getFeeds(['feed_id' => $id]);
|
||||||
|
|
||||||
$logs = array(
|
$logs = [
|
||||||
$rs->feed_name,
|
$rs->feed_name,
|
||||||
$rs->feed_feed,
|
$rs->feed_feed,
|
||||||
$core->auth->getInfo('user_cn')
|
$core->auth->getInfo('user_cn')
|
||||||
);
|
];
|
||||||
|
|
||||||
$core->activityReport->addLog(
|
$core->activityReport->addLog(
|
||||||
'zoneclearFeedServer',
|
'zoneclearFeedServer',
|
||||||
@ -152,13 +151,13 @@ class zoneclearFeedServerActivityReportBehaviors
|
|||||||
global $core;
|
global $core;
|
||||||
|
|
||||||
$zc = new zoneclearFeedServer($core);
|
$zc = new zoneclearFeedServer($core);
|
||||||
$rs = $zc->getFeeds(array('feed_id' => $id));
|
$rs = $zc->getFeeds(['feed_id' => $id]);
|
||||||
|
|
||||||
$logs = array(
|
$logs = [
|
||||||
$rs->feed_name,
|
$rs->feed_name,
|
||||||
$rs->feed_feed,
|
$rs->feed_feed,
|
||||||
$enable ? 'enable' : 'disable'
|
$enable ? 'enable' : 'disable'
|
||||||
);
|
];
|
||||||
|
|
||||||
$core->activityReport->addLog(
|
$core->activityReport->addLog(
|
||||||
'zoneclearFeedServer',
|
'zoneclearFeedServer',
|
||||||
|
Loading…
Reference in New Issue
Block a user