first clean up of code and update license

This commit is contained in:
Jean-Christian Paul Denis 2021-09-11 11:56:57 +02:00
parent 64e75c9f1c
commit d8a9b15346
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
19 changed files with 3649 additions and 3843 deletions

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_MODULE')) { if (!defined('DC_CONTEXT_MODULE')) {

View File

@ -1,36 +1,31 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
$this->registerModule( $this->registerModule(
/* Name */ 'zoneclearFeedServer',
"zoneclearFeedServer", 'Mix your blog with a feeds planet',
/* Description*/ 'Jean-Christian Denis, BG, Pierre Van Glabeke',
"Mix your blog with a feeds planet",
/* Author */
"Jean-Christian Denis, BG, Pierre Van Glabeke",
/* Version */
'2015.07.19', '2015.07.19',
/* Properies */ [
array( 'requires' => [['core', '2.19']],
'permissions' => 'admin', 'permissions' => 'admin',
'type' => 'plugin', 'type' => 'plugin',
'dc_min' => '2.8', 'support' => 'https://github.com/JcDenis/zoneclearFeedServer',
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=331158', 'details' => 'https://plugins.dotaddict.org/dc2/details/pacKman',
'details' => 'http://plugins.dotaddict.org/dc2/details/zoneclearFeedServer' 'repository' => 'https://raw.githubusercontent.com/JcDenis/zoneclearFeedServer/master/dcstore.xml'
) ]
); );

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
@ -37,7 +37,7 @@ $core->url->register(
'^zcfeeds(.*?)$', '^zcfeeds(.*?)$',
array('zcfsUrlHandler', 'zcFeedsPage') array('zcfsUrlHandler', 'zcFeedsPage')
); );
/*
# Add to plugn soCialMe (writer part) # Add to plugn soCialMe (writer part)
$__autoload['zcfsSoCialMeWriter'] = $d.'lib.zcfs.socialmewriter.php'; $__autoload['zcfsSoCialMeWriter'] = $d.'lib.zcfs.socialmewriter.php';
$core->addBehavior( $core->addBehavior(
@ -48,7 +48,7 @@ $core->addBehavior(
'zoneclearFeedServerAfterFeedUpdate', 'zoneclearFeedServerAfterFeedUpdate',
array('zcfsSoCialMeWriter', 'zoneclearFeedServerAfterFeedUpdate') array('zcfsSoCialMeWriter', 'zoneclearFeedServerAfterFeedUpdate')
); );
//*/
# Add to report on plugin activityReport # Add to report on plugin activityReport
if (defined('ACTIVITY_REPORT')) { if (defined('ACTIVITY_REPORT')) {
require_once $d.'lib.zcfs.activityreport.php'; require_once $d.'lib.zcfs.activityreport.php';

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# Licensed under the GPL version 2.0 license. *
# A copy of this license is available in LICENSE file or at * @copyright Jean-Christian Denis
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# */
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
@ -43,7 +43,6 @@ $this->addUserAction(
/* desc */ __('delete the version number') /* desc */ __('delete the version number')
); );
$this->addDirectAction( $this->addDirectAction(
/* type */ 'settings', /* type */ 'settings',
/* action */ 'delete_all', /* action */ 'delete_all',

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {

View File

@ -1,17 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
# This file is highly based cron-script.php # This file is highly based cron-script.php
# From Dotclear extension called planet # From Dotclear extension called planet
# By Olivier Meunier and contributors # By Olivier Meunier and contributors

View File

@ -1,22 +1,16 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/** /**
* @ingroup DC_PLUGIN_ZONECLEARFEEDSERVER * @brief zoneclearFeedServer, a plugin for Dotclear 2
* @brief Feeds server - actions methods *
* @since 2.6 * @package Dotclear
* @see dcPostsActionsPage for more info * @subpackage Plugin
*
* @author Jean-Christian Denis, BG, Pierre Van Glabeke
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
class zcfsFeedsActionsPage extends dcActionsPage class zcfsFeedsActionsPage extends dcActionsPage
{ {
public $zcfs; public $zcfs;

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {

View File

@ -1,169 +0,0 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
return null;
}
# This file is used with plugin activityReport
$core->activityReport->addGroup(
'zoneclearFeedServer',
__('Plugin zoneclearFeedServer')
);
# from BEHAVIOR zoneclearFeedServerAfterAddFeed in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
$core->activityReport->addAction(
'zoneclearFeedServer',
'create',
__('feed creation'),
__('A new feed named "%s" point to "%s" was added by "%s"'),
'zoneclearFeedServerAfterAddFeed',
array('zoneclearFeedServerActivityReportBehaviors', 'addFeed')
);
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
$core->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedinfo',
__('updating feed info'),
__('Feed named "%s" point to "%s" has been updated by "%s"'),
'zoneclearFeedServerAfterUpdFeed',
array('zoneclearFeedServerActivityReportBehaviors', 'updFeedInfo')
);
# from BEHAVIOR zoneclearFeedServerAfterUpdFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
$core->activityReport->addAction(
'zoneclearFeedServer',
'updatefeedrecords',
__('updating feed records'),
__('Records of the feed named "%s" have been updated automatically'),
'zoneclearFeedServerAfterUpdFeed',
array('zoneclearFeedServerActivityReportBehaviors', 'updFeedRecord')
);
# from BEHAVIOR zoneclearFeedServerAfterDelFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
$core->activityReport->addAction(
'zoneclearFeedServer',
'delete',
__('feed deletion'),
__('Feed named "%s" point to "%s" has been deleted by "%s"'),
'zoneclearFeedServerAfterDelFeed',
array('zoneclearFeedServerActivityReportBehaviors', 'delFeed')
);
# from BEHAVIOR zoneclearFeedServerAfterEnableFeed in in zoneclearFeedServer/inc/class.zoneclear.feed.server.php
$core->activityReport->addAction(
'zoneclearFeedServer',
'status',
__('feed status'),
__('Feed named "%s" point to "%s" has been set to "%s"'),
'zoneclearFeedServerAfterEnableFeed',
array('zoneclearFeedServerActivityReportBehaviors', 'enableFeed')
);
class zoneclearFeedServerActivityReportBehaviors
{
public static function addFeed($cur)
{
global $core;
$logs = array(
$cur->feed_name,
$cur->feed_feed,
$core->auth->getInfo('user_cn')
);
$core->activityReport->addLog(
'zoneclearFeedServer',
'create',
$logs
);
}
public static function updFeedInfo($cur, $id)
{
if (defined('DC_CONTEXT_ADMIN')) {
global $core;
$zc = new zoneclearFeedServer($core);
$rs = $zc->getFeeds(array('feed_id' => $id));
$logs = array(
$rs->feed_name,
$rs->feed_feed,
$core->auth->getInfo('user_cn')
);
$core->activityReport->addLog(
'zoneclearFeedServer',
'updatefeedinfo',
$logs
);
}
}
public static function updFeedRecord($cur,$id)
{
if (!defined('DC_CONTEXT_ADMIN')) {
global $core;
$zc = new zoneclearFeedServer($core);
$rs = $zc->getFeeds(array('feed_id' => $id));
$logs = array(
$rs->feed_name
);
$core->activityReport->addLog(
'zoneclearFeedServer',
'updatefeedrecords',
$logs
);
}
}
public static function delFeed($id)
{
global $core;
$zc = new zoneclearFeedServer($core);
$rs = $zc->getFeeds(array('feed_id' => $id));
$logs = array(
$rs->feed_name,
$rs->feed_feed,
$core->auth->getInfo('user_cn')
);
$core->activityReport->addLog(
'zoneclearFeedServer',
'delete',
$logs
);
}
public static function enableFeed($id, $enable, $time)
{
global $core;
$zc = new zoneclearFeedServer($core);
$rs = $zc->getFeeds(array('feed_id' => $id));
$logs = array(
$rs->feed_name,
$rs->feed_feed,
$enable ? 'enable' : 'disable'
);
$core->activityReport->addLog(
'zoneclearFeedServer',
'status',
$logs
);
}
}

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief zoneclearFeedServer, a plugin for Dotclear 2
# This file is part of zoneclearFeedServer, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis, BG, Pierre Van Glabeke
# 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
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {