cf changelog
This commit is contained in:
brol 2014-12-14 15:11:06 +01:00
parent a5a9c6e047
commit d06c4f5e6c
8 changed files with 83 additions and 37 deletions

View file

@ -13,7 +13,7 @@ if (!defined('DC_RC_PATH')) {
return; return;
} }
class ConstCategoriesPage { class ConstCategoriesPage {
const VERSION = '0.1'; const VERSION = '0.2';
const NS = 'CategoriesPage'; const NS = 'CategoriesPage';
const PARAM = 'CategoriesPage'; const PARAM = 'CategoriesPage';
} }

View file

@ -7,10 +7,6 @@ Ce plugin ajoute un widget permettant d'accèder à une page listant les catégo
Ce plugin est basé sur le plugin [CategoriesMode] (http://plugins.dotaddict.org/dc2/details/categoriesMode) de Adjaya, Pierre Van Glabeke. Ce plugin est basé sur le plugin [CategoriesMode] (http://plugins.dotaddict.org/dc2/details/categoriesMode) de Adjaya, Pierre Van Glabeke.
Compatibilité
============
Ce plugin a été testé avec les versions 2.5 et 2.6 de [Dotclear] (http://fr.dotclear.org/).
Auteurs Auteurs
======= =======

View file

@ -16,13 +16,13 @@ $this->registerModule(
/* Name */ 'Categories Page', /* Name */ 'Categories Page',
/* Description*/ 'Add a category list page / Ajoute une page listant les catégories', /* Description*/ 'Add a category list page / Ajoute une page listant les catégories',
/* Author */ 'Pierre Van Glabeke, Bernard Le Roux', /* Author */ 'Pierre Van Glabeke, Bernard Le Roux',
/* Version */ '0.1', /* Version */ '0.2',
/* Properties */ /* Properties */
array( array(
'permissions' => 'admin', 'permissions' => 'admin',
'type' => 'plugin', 'type' => 'plugin',
'dc_min' => '2.5', 'dc_min' => '2.7',
'support' => 'http://forum.dotclear.org/viewforum.php?id=16', 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=326224#p326224',
'details' => 'http://plugins.dotaddict.org/dc2/details/categoriesPage' 'details' => 'http://plugins.dotaddict.org/dc2/details/categoriesPage'
) )
); );

View file

@ -58,8 +58,12 @@ class tplCategories {
class behaviorCategoriesPage { class behaviorCategoriesPage {
public static function addTplPath($core) { public static function addTplPath($core) {
$tpl = $core->tpl; $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset');
$tpl->setPath($tpl->getPath(), dirname(__FILE__) . '/default-templates'); if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) {
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset);
} else {
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET);
}
} }
} }

View file

@ -34,29 +34,21 @@ class widgetsCategoriesPage {
$url = $core->url; $url = $core->url;
if ($widget->offline)
return;
if (($widget->homeonly == 1 && $url->type !== 'default') || if (($widget->homeonly == 1 && $url->type !== 'default') ||
($widget->homeonly == 2 && $url->type === 'default')) { ($widget->homeonly == 2 && $url->type === 'default')) {
return; return;
} }
$class = $divB = $divE = $title = ''; $res =
if ($widget->class) { ($widget->title ? $widget->renderTitle(html::escapeHTML($widget->title)) : '').
$class = html::escapeHTML($widget->class); '<p><a href="'.$core->blog->url.$core->url->getBase('categories').'">'.
} ($widget->link_title ? html::escapeHTML($widget->link_title) : __('All categories')).
if ( !$widget->content_only) { '</a></p>';
$divB = '<div class="categories '. $class . '">';
$divE = '</div>';
}
if ( $widget->title ) {
$title = '<h2>' . html::escapeHTML($widget->title) . '</h2>';
}
return $divB . $title . return $widget->renderDiv($widget->content_only,'categories '.$widget->class,'',$res);
'<ul><li><strong><a href="' .
$core->blog->url . $core->url->getBase("categories") . '">' .
__('All categories') .
'</a></strong></li></ul>' .
$divE;
} }
public static function initWidgets($widget) { public static function initWidgets($widget) {
@ -72,6 +64,7 @@ class widgetsCategoriesPage {
); );
$categoriesPage->setting('content_only', __('Content only'), 0, 'check'); $categoriesPage->setting('content_only', __('Content only'), 0, 'check');
$categoriesPage->setting('class', __('CSS class:'), ''); $categoriesPage->setting('class', __('CSS class:'), '');
$categoriesPage->setting('offline',__('Offline'),0,'check');
} }
} }

8
changelog Normal file
View file

@ -0,0 +1,8 @@
v0.2 - 14-12-2014 : Pierre Van Glabeke
Ajout case hors ligne
Ajout tpl pour currywurst
Compatibilité dc2.7
v0.1 - 28-12-2013 : Pierre Van Glabeke, Bernard Le Roux
Refonte du code depuis CategoriesMode
Compatibilité dc2.5 et 2.6

View file

@ -0,0 +1,47 @@
{{tpl:extends parent="__layout.html"}}
<tpl:Block name="head-title">
<title>{{tpl:lang Categories Page}} - {{tpl:BlogName encode_html="1"}}</title>
</tpl:Block>
<tpl:Block name="meta-robots">
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
</tpl:Block>
<tpl:Block name="dc-entry">
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Categories page}} - {{tpl:BlogName encode_html="1"}}" />
<meta property="dc.language" content="{{tpl:BlogLanguage}}" />
</tpl:Block>
<tpl:Block name="head-linkrel">
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
<tpl:Categories>
<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
</tpl:Categories>
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
</tpl:Block>
<tpl:Block name="body-tag"><body class="dc-categories"></tpl:Block>
<tpl:Block name="main-content">
<div id="content-info">
<h2>{{tpl:lang Categories}}</h2>
<tpl:Categories>
<h3><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> ({{tpl:CategoryCount}})</h3>
<div>{{tpl:CategoryDescription}}</div>
<p><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}"
title="{{tpl:lang This category's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a>
<tpl:SysIf operator="or" comments_active="1" pings_active="1">
- <a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}/comments"
title="{{tpl:lang This category's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a>
</tpl:SysIf>
</p>
</tpl:Categories>
</div>
</tpl:Block>

View file

@ -1,25 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="{{tpl:BlogLanguage}}">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta charset="UTF-8" />
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" /> <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
<title>{{tpl:lang Categories Page}} - {{tpl:BlogName encode_html="1"}}</title> <title>{{tpl:lang Categories Page}} - {{tpl:BlogName encode_html="1"}}</title>
<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" /> <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" /> <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
<meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" /> <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Categories page}} - {{tpl:BlogName encode_html="1"}}" /> <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Categories page}} - {{tpl:BlogName encode_html="1"}}" />
<meta name="dc.language" content="{{tpl:BlogLanguage}}" /> <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
<meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" /> <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
<meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" /> <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
<meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
<meta name="dc.type" content="text" /> <meta name="dc.type" content="text" />
<meta name="dc.format" content="text/html" /> <meta name="dc.format" content="text/html" />
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" /> <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" /> <link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
<tpl:Categories> <tpl:Categories>
<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" /> <link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
</tpl:Categories> </tpl:Categories>