diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb1823e..925bfd4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,18 @@
-v1.5 (23/04/2015) Pierre Van Glabeke :
-modification url support
+1.6 - 2022.12.15
+- update to dotclear 2.24
-v1.4 (06/02/2015) Pierre Van Glabeke :
-modifications localisation
+1.5 - 2015.04.23 - Pierre Van Glabeke :
+- modification url support
-v1.3 (14/12/2014) Pierre Van Glabeke :
-compatibilité dc2.7
+1.4 - 2015.02.06 - Pierre Van Glabeke :
+- modifications localisation
-v1.2 (17/02/2014) :
-reprise par Pierre Van Glabeke
-correction bug (waning_crescent_moon)
-images refaites (merci à 999Diaoul)
-compatibilité dc2.6
-fin de ligne unix
\ No newline at end of file
+1.3 - 2014.12.14 - Pierre Van Glabeke :
+- compatibilité dc2.7
+
+1.2 2014.02.17 :
+- reprise par Pierre Van Glabeke
+- correction bug (waning_crescent_moon)
+- images refaites (merci à 999Diaoul)
+- compatibilité dc2.6
+- fin de ligne unix
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 8cdb845..d511905 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -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
the "copyright" line and a pointer to where the full notice is found.
- {description}
- Copyright (C) {year} {fullname}
+
+ Copyright (C)
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
@@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
- {signature of Ty Coon}, 1 April 1989
+ , 1 April 1989
Ty Coon, President of Vice
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
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-
diff --git a/README.md b/README.md
index 317b263..a2d6e33 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,44 @@
-# lunarPhase
-Afficher les phases lunaire et autres données
+# README
+
+[![Release](https://img.shields.io/github/v/release/JcDenis/lunarPhase)](https://github.com/JcDenis/lunarPhase/releases)
+[![Date](https://img.shields.io/github/release-date/JcDenis/lunarPhase)](https://github.com/JcDenis/lunarPhase/releases)
+[![Issues](https://img.shields.io/github/issues/JcDenis/lunarPhase)](https://github.com/JcDenis/lunarPhase/issues)
+[![Dotclear](https://img.shields.io/badge/dotclear-v2.24-blue.svg)](https://fr.dotclear.org/download)
+[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/lunarPhase)
+[![License](https://img.shields.io/github/license/JcDenis/lunarPhase)](https://github.com/JcDenis/lunarPhase/blob/master/LICENSE)
+
+## WHAT IS LUNARPHASE ?
+
+_lunarPhase_ is a plugin for the open-source
+web publishing software called Dotclear.
+
+It shows lunar phases on a widget.
+
+## REQUIREMENTS
+
+ _lunarPhase_ requires:
+
+ * content admin permissions to manage widgets
+ * Dotclear 2.24
+
+## USAGE
+
+First install _lunarPhase_, manualy from a zip package or from
+Dotaddict repository. (See Dotclear's documentation to know how do this)
+
+You should add widget to show lunar phases on your blog.
+
+## LINKS
+
+ * License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
+ * Source & contribution : [GitHub Page](https://github.com/JcDenis/lunarPhase)
+ * Packages & details : [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/lunarPhase)
+ * Discuss and help : [Dotclear Forum](http://forum.dotclear.org/viewtopic.php?pid=332971#p332971)
+
+## CONTRIBUTORS
+
+ * Tomtom (author)
+ * Pierre Van Glabeke
+ * Jean-Christian Denis
+
+ You are welcome to contribute to this code.
\ No newline at end of file
diff --git a/_admin.php b/_admin.php
new file mode 100644
index 0000000..5651eab
--- /dev/null
+++ b/_admin.php
@@ -0,0 +1,17 @@
+registerModule(
- /* Name */ 'lunarPhase',
- /* Description */ 'Display the moon phases',
- /* Author */ 'Tomtom, Pierre Van Glabeke',
- /* Verion */ '1.5',
- /* Properties */
- array(
- 'permissions' => 'usage,contentadmin',
- 'type' => 'plugin',
- 'dc_min' => '2.7',
- 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332971#p332971',
- 'details' => 'http://plugins.dotaddict.org/dc2/details/lunarPhase'
- )
-);
\ No newline at end of file
+ 'lunarPhase',
+ 'Display the moon phases on a widget',
+ 'Tomtom, Pierre Van Glabeke and Contributors',
+ '1.6',
+ [
+ 'requires' => [['core', '2.24']],
+ 'permissions' => dcCore::app()->auth->makePermissions([
+ dcAuth::PERMISSION_USAGE,
+ dcAuth::PERMISSION_CONTENT_ADMIN,
+ ]),
+ 'type' => 'plugin',
+ 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332971#p332971',
+ 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__),
+ 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml',
+ ]
+);
diff --git a/_prepend.php b/_prepend.php
index 99ee36c..0cfee3f 100644
--- a/_prepend.php
+++ b/_prepend.php
@@ -1,16 +1,50 @@
autoload(['lunarPhase' => __DIR__ . '/inc/class.lunarphase.php']);
-require dirname(__FILE__).'/_widgets.php';
+// Register lunarphase CSS URL
+dcCore::app()->url->register(
+ 'lunarphase',
+ 'lunarphase.css',
+ '^lunarphase\.css',
+ function ($args) {
+ $phases = [
+ 'new_moon' => 'nm',
+ 'waxing_crescent_moon' => 'wcm1',
+ 'first_quarter_moon' => 'fqm',
+ 'waxing_gibbous_moon' => 'wgm1',
+ 'full_moon' => 'fm',
+ 'waning_gibbous_moon' => 'wgm2',
+ 'last_quarter_moon' => 'tqm',
+ 'waning_crescent_moon' => 'wcm2',
+ ];
+
+ header('Content-Type: text/css; charset=UTF-8');
+ echo "/* lunarphase widget style */\n";
+
+ foreach ($phases as $phase => $image) {
+ echo
+ sprintf(
+ '#sidebar .lunarphase ul li.%s{background:transparent url(%s) no-repeat left 0.2em;padding-left:2em;}',
+ $phase,
+ dcCore::app()->blog->getPF(basename(__dir__) . '/img/' . $image . '.png')
+ ) . "\n";
+ }
+
+ exit;
+ }
+);
diff --git a/_public.php b/_public.php
index b87d0f0..d9dff90 100644
--- a/_public.php
+++ b/_public.php
@@ -1,203 +1,22 @@
addBehavior('publicHeadContent',array('lunarPhaseBehaviors','addCss'));
-
-class lunarPhaseBehaviors
-{
- /**
- This function add CSS file in the public header
- */
- public static function addCss()
- {
- global $core;
-
- $url = $core->blog->getQMarkURL().'pf='.basename(dirname(__FILE__)).'/style.css';
-
- echo '';
- }
+/**
+ * @brief lunarPhase, a plugin for Dotclear 2
+ *
+ * @package Dotclear
+ * @subpackage Plugin
+ *
+ * @author Tomtom, Pierre Van Glabeke and Contributors
+ *
+ * @copyright Jean-Crhistian Denis
+ * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
+ */
+if (!defined('DC_RC_PATH')) {
+ return null;
}
-class lunarPhasePublic
-{
- /**
- Displays lunarphase widget
-
- @param w dcWidget dcWidget object
- @return string HTML code of widget
- */
- public static function widget($w)
- {
- global $core;
+require __DIR__ . '/_widgets.php';
- if ($w->offline)
- return;
-
- $lp = new lunarPhase();
-
- if (($w->homeonly == 1 && $core->url->type != 'default') ||
- ($w->homeonly == 2 && $core->url->type == 'default')) {
- return;
- }
-
- $res =
- ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '');
-
- # Get live content
- $res .= lunarPhasePublic::getLive($w,$lp);
- # Get prevision content
- $res .= lunarPhasePublic::getPrevisions($w,$lp);
-
- return $w->renderDiv($w->content_only,'lunarphase '.$w->class,'',$res);
-
- }
-
- /**
- Returns "live" part of lunarphase widget
-
- @param w dcWidget dcWidget object
- @param lp lunarPhaset lunarPhase object
- @return string Live HTML part
- */
- public static function getLive($w,$lp)
- {
- $ul_mask = '