cleanup code

This commit is contained in:
Jean-Christian Paul Denis 2021-09-07 15:21:38 +02:00
parent e510c444d7
commit b21e286961
16 changed files with 2077 additions and 2086 deletions

View File

@ -1,59 +1,50 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }
require_once dirname(__FILE__) . '/_widgets.php'; require_once dirname(__FILE__) . '/_widgets.php';
# Admin menu
$_menu['Plugins']->addItem( $_menu['Plugins']->addItem(
__('My cinecturlink'), __('My cinecturlink'),
'plugin.php?p=cinecturlink2', $core->adminurl->get('admin.plugin.cinecturlink2'),
'index.php?pf=cinecturlink2/icon.png', dcPage::getPF('cinecturlink2/icon.png'),
preg_match( preg_match(
'/plugin.php\?p=cinecturlink2(&.*)?$/', '/' . preg_quote($core->adminurl->get('admin.plugin.dcAdvancedCleaner')) . '(&.*)?$/',
$_SERVER['REQUEST_URI']) $_SERVER['REQUEST_URI']
, ),
$core->auth->check('contentadmin', $core->blog->id) $core->auth->check('contentadmin', $core->blog->id)
); );
$core->addBehavior( $core->addBehavior(
'adminDashboardFavorites', 'adminDashboardFavorites',
array('cinecturlink2AdminBehaviors', 'adminDashboardFavorites') ['cinecturlink2AdminBehaviors', 'adminDashboardFavorites']
); );
class cinecturlink2AdminBehaviors class cinecturlink2AdminBehaviors
{ {
public static function adminDashboardFavorites($core, $favs) public static function adminDashboardFavorites($core, $favs)
{ {
$favs->register('cinecturlink2', array( $favs->register('cinecturlink2', [
'title' => __('My cinecturlink'), 'title' => __('My cinecturlink'),
'url' => 'plugin.php?p=cinecturlink2#links', 'url' => $core->adminurl->get('admin.plugin.cinecturlink2').'#links',
'small-icon' => 'index.php?pf=cinecturlink2/icon.png', 'small-icon' => dcPage::getPF('cinecturlink2/icon.png'),
'large-icon' => 'index.php?pf=cinecturlink2/icon-big.png', 'large-icon' => dcPage::getPF('cinecturlink2/icon-big.png'),
'permissions' => $core->auth->check( 'permissions' => $core->auth->check('contentadmin', $core->blog->id),
'contentadmin', 'active_cb' => ['cinecturlink2AdminBehaviors', 'adminDashboardFavoritesActive']
$core->blog->id ]);
),
'active_cb' => array(
'cinecturlink2AdminBehaviors',
'adminDashboardFavoritesActive'
)
));
} }
public static function adminDashboardFavoritesActive($request, $params) public static function adminDashboardFavoritesActive($request, $params)

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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')) {

View File

@ -1,19 +1,17 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return null; return null;
} }

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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')) {

12
dcstore.xml Normal file
View File

@ -0,0 +1,12 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="cinecturlink2">
<name>Cinecturlink 2</name>
<version>0.7.1</version>
<author>Jean-Christian Denis and Contributors</author>
<desc>Widgets and pages about books, musics, films, blogs you are interested in</desc>
<file>https://github.com/JcDenis/cinecturlink2/releases/download/v0.7.1/plugin-cinecturlink2.zip</file>
<da:dcmin>2.19</da:dcmin>
<da:details>https://plugins.dotaddict.org/dc2/details/cinecturlink2</da:details>
<da:support>https://github.com/JcDenis/cinecturlink2</da:support>
</module>
</modules>

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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')) {

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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 ------------------------------------
class cinecturlink2Context class cinecturlink2Context
{ {

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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 ------------------------------------
class sitemapsCinecturlink2 class sitemapsCinecturlink2
{ {

View File

@ -1,16 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief cinecturlink2, a plugin for Dotclear 2
# This file is part of cinecturlink2, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors * @subpackage Plugin
# contact@jcdenis.fr http://jcd.lv *
# * @author 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 * @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_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {

View File

@ -323,5 +323,3 @@ $GLOBALS['__l10n']['Check to delete'] = 'Cocher pour supprimer';
#index.php:638 #index.php:638
$GLOBALS['__l10n']['update categories'] = 'mettre à jour les catégories'; $GLOBALS['__l10n']['update categories'] = 'mettre à jour les catégories';
?>