release 1.9 for dotclear 2.24

master
Jean-Christian Paul Denis 2022-12-16 23:14:52 +01:00
parent 830a563e1d
commit 4484d2ed5e
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
9 changed files with 237 additions and 186 deletions

View File

@ -1,19 +1,23 @@
v1.8.1 - 29-06-2015 - Pierre Van Glabeke
1.9 - 2022.12.17
* update to dotclear 2.24
* fix phpstan errors
1.8.1 - 2015.06.29 - Pierre Van Glabeke
* correction validation html
v1.8 - 08-06-2015 - Pierre Van Glabeke
1.8 - 2015.06.08 - Pierre Van Glabeke
* ajout lien vers toutes les archives
v1.7 - 28-05-2015 - Kozlika & Nikrou
1.7 - 2015.05.28 - Kozlika & Nikrou
* suppression d'image et gestion de l'indicateur via css
* ajout de classes sur chaque liste (année/mois)
* application de la class .open sur l'item ouvert par défaut
* application de la class .open sur l'item correspondant au mois actif en cas de consulation des archives
v1.6 - 25-04-2015 - Pierre Van Glabeke
1.6 - 2015.04.25 - Pierre Van Glabeke
* modif appel css
* ajout localisation
* ajout identification widget
v1.5 - 14-12-2014 - Pierre Van Glabeke
1.5 - 2014.12.14 - Pierre Van Glabeke
* compatibilité dc2.7

23
LICENSE
View File

@ -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., <http://fsf.org/>
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}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
<signature of Ty Coon>, 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.

View File

@ -1,7 +1,44 @@
# shortArchives
# README
Widget d'affichage des archives pour le blog des news de Dotclear. Le principe de l'accordéon originel revisité pour un affichage des mois à côté de la date "ouverte".
[![Release](https://img.shields.io/github/v/release/JcDenis/shortArchives)](https://github.com/JcDenis/shortArchives/releases)
[![Date](https://img.shields.io/github/release-date/JcDenis/shortArchives)](https://github.com/JcDenis/shortArchives/releases)
[![Issues](https://img.shields.io/github/issues/JcDenis/shortArchives)](https://github.com/JcDenis/shortArchives/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/shortArchives)
[![License](https://img.shields.io/github/license/JcDenis/shortArchives)](https://github.com/JcDenis/shortArchives/blob/master/LICENSE)
Todo:
## WHAT IS SHORTARCHIVES ?
* Ajouter les attributs ARIA kivonbien.
_shortArchives_ is a plugin for the open-source
web publishing software called Dotclear.
Add a public widget that list links to archives by year.
## REQUIREMENTS
_shortArchives_ requires:
* content admin permissions to manage widgets
* Dotclear 2.24
## USAGE
First install _shortArchives_, 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/shortArchives)
* Packages & details : [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/shortArchives)
* Discuss and help : [Dotclear Forum](http://forum.dotclear.org/viewtopic.php?pid=321044#p321044)
## CONTRIBUTORS
* annso (author)
* Pierre Van Glabeke
* Jean-Christian Denis
You are welcome to contribute to this code.

View File

@ -1,15 +1,17 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of shortArchives, a plugin for Dotclear.
#
# Copyright (c) 2009-2015 - annso and contributors
# contact@as-i-am.fr
#
# 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 ------------------------------------
/**
* @brief shortArchives, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author annso, 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_CONTEXT_ADMIN')) {
return null;
}
if (!defined('DC_CONTEXT_ADMIN')) {return;}
require dirname(__FILE__).'/_widgets.php';
require __DIR__ . '/_widgets.php';

View File

@ -1,28 +1,32 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of shortArchives, a plugin for Dotclear.
#
# Copyright (c) 2009-2015 - annso and contributors
# contact@as-i-am.fr
#
# 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;}
/**
* @brief shortArchives, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author annso, 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;
}
$this->registerModule(
/* Name */ "shortArchives",
/* Description*/ "Display blog archives in an accordion menu, sorted by year",
/* Author */ "annso, Pierre Van Glabeke",
/* Version */ "1.8.1",
/* Properties */
array(
'permissions' => 'usage,contentadmin',
'type' => 'plugin',
'dc_min' => '2.7',
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=321044#p321044',
'details' => 'http://plugins.dotaddict.org/dc2/details/shortArchives'
)
);
'shortArchives',
'Display blog archives in an accordion menu, sorted by year',
'annso, Pierre Van Glabeke and Contributors',
'1.9',
[
'requires' => [['core', '2.24']],
'permissions' => dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_ADMIN,
]),
'type' => 'plugin',
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=321044#p321044',
'details' => 'http://plugins.dotaddict.org/dc2/details/' . basename(__DIR__),
'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml',
]
);

View File

@ -1,93 +1,23 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of shortArchives, a plugin for Dotclear.
#
# Copyright (c) 2009-2015 - annso and contributors
# contact@as-i-am.fr
#
# 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;}
require dirname(__FILE__).'/_widgets.php';
$core->addBehavior('publicHeadContent',array('publicShortArchives','publicHeadContent'));
class publicShortArchives
{
public static function publicHeadContent($core)
{
$url = $core->blog->getQmarkURL().'pf='.basename(dirname(__FILE__));
echo '<script type="text/javascript" src="'.$url.'/js/accordion.js"></script>'."\n";
echo '<link rel="stylesheet" type="text/css" media="screen" href="'.$url."/css/shortArchives.css\" />\n";
}
/**
* @brief shortArchives, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author annso, 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 tplShortArchives
{
public static function shortArchivesWidgets($w)
{
global $core;
require __DIR__ . '/_widgets.php';
if ($w->offline)
return;
if (($w->homeonly == 1 && $core->url->type != 'default') ||
($w->homeonly == 2 && $core->url->type == 'default')) {
return;
}
$params = array();
$params['type'] = 'month';
$rs = $core->blog->getDates($params);
unset($params);
if ($rs->isEmpty()) {
return;
}
$active_year = null;
if (($core->url->type == 'archive') && preg_match('`^/([0-9]{4})/([0-9]{2})$`',$core->url->args,$matches)) {
$active_year = $matches[1];
}
$posts = array();
while ($rs->fetch()) {
$posts[dt::dt2str(__('%Y'),$rs->dt)][] = array('url' => $rs->url($core),
'date' => html::escapeHTML(dt::dt2str(__('%B'),$rs->dt)),
'nbpost' => $rs->nb_post);
}
$res =
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '').
'<ul class="arch-years">';
foreach($posts as $annee => $post) {
if (!is_null($active_year) && $active_year == $annee) {
$res .= '<li class="open">';
} else {
$res .= '<li>';
}
$res .= '<span>'.$annee.'</span><ul class="arch-months">';
for($i=0; $i<sizeof($post); $i++) {
$res .=
'<li><a href="'.$post[$i]['url'].'">'.$post[$i]['date'].'</a>'.
($w->postcount ? ' ('.$post[$i]['nbpost'].')' : '').
'</li>';
}
$res .= '</ul></li>';
}
$res .= '</ul>';
if ($core->url->getBase('archive') && !is_null($w->allarchivesslinktitle) && $w->allarchivesslinktitle !== '')
{
$res .=
'<p><strong><a href="'.$core->blog->url.$core->url->getURLFor("archive").'">'.
html::escapeHTML($w->allarchivesslinktitle).'</a></strong></p>';
}
return $w->renderDiv($w->content_only,'shortArchives '.$w->class,'',$res);
}
}
dcCore::app()->addBehavior('publicHeadContent', function () {
echo
dcUtils::jsModuleLoad(basename(__DIR__) . '/js/accordion.js') .
dcUtils::cssModuleLoad(basename(__DIR__) . '/css/shortArchives.css');
});

View File

@ -1,37 +1,98 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of shortArchives, a plugin for Dotclear.
#
# Copyright (c) 2009-2015 - annso and contributors
# contact@as-i-am.fr
#
# 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; }
/**
* @brief shortArchives, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author annso, 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;
}
$core->addBehavior('initWidgets',array('shortArchivesWidgets','initWidgets'));
dcCore::app()->addBehavior('initWidgets', ['shortArchivesWidgets','initWidgets']);
class shortArchivesWidgets
{
public static function initWidgets($w)
{
$w->create('shortArchives',__('Short Archives'), array('tplShortArchives','shortArchivesWidgets'),
null,
__('Blog Archive List an accordion menu, sorted by year'));
$w->shortArchives->setting('title',__('Title:'),__('Archives'));
$w->shortArchives->setting('postcount',__('With entries counts'),1,'check');
$w->shortArchives->setting('allarchivesslinktitle',__('Link to all archives:'),__('All archives'));
$w->shortArchives->setting('homeonly',__('Display on:'),0,'combo',
array(
__('All pages') => 0,
__('Home page only') => 1,
__('Except on home page') => 2
)
);
$w->shortArchives->setting('content_only',__('Content only'),0,'check');
$w->shortArchives->setting('class',__('CSS class:'),'');
$w->shortArchives->setting('offline',__('Offline'),0,'check');
}
}
public static function initWidgets($w)
{
$w->create(
'shortArchives',
__('Short Archives'),
['shortArchivesWidgets', 'shortArchivesWidgets'],
null,
__('Blog Archive List an accordion menu, sorted by year')
)
->addTitle(__('Archives'))
->setting('postcount', __('With entries counts'), 1, 'check')
->setting('allarchivesslinktitle', __('Link to all archives:'), __('All archives'))
->addHomeOnly()
->addContentOnly()
->addClass()
->addOffline();
}
public static function shortArchivesWidgets($w)
{
if ($w->offline) {
return;
}
if (!$w->checkHomeOnly(dcCore::app()->url->type)) {
return;
}
$rs = dcCore::app()->blog->getDates(['type' => 'month']);
if ($rs->isEmpty()) {
return;
}
$active_year = null;
if ((dcCore::app()->url->type == 'archive') && preg_match('`^/([0-9]{4})/([0-9]{2})$`', dcCore::app()->url->args, $matches)) {
$active_year = $matches[1];
}
$posts = [];
while ($rs->fetch()) {
$posts[dt::dt2str(__('%Y'), $rs->dt)][] = [
'url' => $rs->url(),
'date' => html::escapeHTML(dt::dt2str(__('%B'), $rs->dt)),
'nbpost' => $rs->nb_post,
];
}
$res = '<ul class="arch-years">';
foreach ($posts as $annee => $post) {
if (!is_null($active_year) && $active_year == $annee) {
$res .= '<li class="open">';
} else {
$res .= '<li>';
}
$res .= '<span>' . $annee . '</span><ul class="arch-months">';
for ($i = 0; $i < sizeof($post); $i++) {
$res .= '<li><a href="' . $post[$i]['url'] . '">' . $post[$i]['date'] . '</a>' .
($w->postcount ? ' (' . $post[$i]['nbpost'] . ')' : '') .
'</li>';
}
$res .= '</ul></li>';
}
$res .= '</ul>';
if (dcCore::app()->url->getBase('archive') && !is_null($w->allarchivesslinktitle) && $w->allarchivesslinktitle !== '') {
$res .= '<p><strong><a href="' . dcCore::app()->blog->url . dcCore::app()->url->getURLFor('archive') . '">' .
html::escapeHTML($w->allarchivesslinktitle) . '</a></strong></p>';
}
return $w->renderDiv(
$w->content_only,
'shortArchives ' . $w->class,
'',
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '') . $res
);
}
}

13
dcstore.xml 100644
View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<modules xmlns:da="http://dotaddict.org/da/">
<module id="shortArchives">
<name>shortArchives</name>
<version>1.9</version>
<author>annso, Pierre Van Glabeke and Contributors</author>
<desc>Display blog archives in an accordion menu, sorted by year</desc>
<file>https://github.com/JcDenis/shortArchives/releases/download/v1.9/plugin-shortArchives.zip</file>
<da:dcmin>2.24</da:dcmin>
<da:details>http://plugins.dotaddict.org/dc2/details/shortArchives</da:details>
<da:support>http://forum.dotclear.org/viewtopic.php?pid=321044#p321044</da:support>
</module>
</modules>

View File

@ -1,16 +1,14 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: \n"
"Project-Id-Version: shortArchives 1.9\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: brol <contact@brol.info>\n"
"PO-Revision-Date: 2022-12-16T22:00:09+00:00\n"
"Last-Translator: Jean-Crhistian Denis\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Display blog archives in an accordion menu, sorted by year"
msgstr "Afficher les archives du blog dans un menu accordéon, trié par années"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "Blog Archive List an accordion menu, sorted by year"
msgstr "Liste des archives du blog dans un menu accordéon, trié par années"
@ -21,3 +19,6 @@ msgstr "Lien vers toutes les archives :"
msgid "All archives"
msgstr "Toutes les archives"
msgid "Display blog archives in an accordion menu, sorted by year"
msgstr "Afficher les archives du blog dans un menu accordéon, trié par années"