From d06c4f5e6cf3fc25d85ec7e0968bb37658321de3 Mon Sep 17 00:00:00 2001 From: brol Date: Sun, 14 Dec 2014 15:11:06 +0100 Subject: [PATCH] v0.2 cf changelog --- ConstCategoriesPage.php | 2 +- README.md | 4 -- _define.php | 6 +-- _public.php | 8 +++- _widgets.php | 29 +++++------- changelog | 8 ++++ default-templates/currywurst/categories.html | 47 +++++++++++++++++++ .../{ => mustek}/categories.html | 16 +++---- 8 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 changelog create mode 100644 default-templates/currywurst/categories.html rename default-templates/{ => mustek}/categories.html (82%) diff --git a/ConstCategoriesPage.php b/ConstCategoriesPage.php index f843470..2fae832 100644 --- a/ConstCategoriesPage.php +++ b/ConstCategoriesPage.php @@ -13,7 +13,7 @@ if (!defined('DC_RC_PATH')) { return; } class ConstCategoriesPage { - const VERSION = '0.1'; + const VERSION = '0.2'; const NS = 'CategoriesPage'; const PARAM = 'CategoriesPage'; } diff --git a/README.md b/README.md index 8f026bd..1828a33 100644 --- a/README.md +++ b/README.md @@ -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. -Compatibilité -============ - -Ce plugin a été testé avec les versions 2.5 et 2.6 de [Dotclear] (http://fr.dotclear.org/). Auteurs ======= diff --git a/_define.php b/_define.php index 14d0edd..c68c783 100644 --- a/_define.php +++ b/_define.php @@ -16,13 +16,13 @@ $this->registerModule( /* Name */ 'Categories Page', /* Description*/ 'Add a category list page / Ajoute une page listant les catégories', /* Author */ 'Pierre Van Glabeke, Bernard Le Roux', - /* Version */ '0.1', + /* Version */ '0.2', /* Properties */ array( 'permissions' => 'admin', 'type' => 'plugin', - 'dc_min' => '2.5', - 'support' => 'http://forum.dotclear.org/viewforum.php?id=16', + 'dc_min' => '2.7', + 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=326224#p326224', 'details' => 'http://plugins.dotaddict.org/dc2/details/categoriesPage' ) ); diff --git a/_public.php b/_public.php index ecfab79..2cccd7d 100644 --- a/_public.php +++ b/_public.php @@ -58,8 +58,12 @@ class tplCategories { class behaviorCategoriesPage { public static function addTplPath($core) { - $tpl = $core->tpl; - $tpl->setPath($tpl->getPath(), dirname(__FILE__) . '/default-templates'); + $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); + 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); + } } } diff --git a/_widgets.php b/_widgets.php index c548db1..245e9e3 100644 --- a/_widgets.php +++ b/_widgets.php @@ -33,30 +33,22 @@ class widgetsCategoriesPage { $core = $GLOBALS['core']; $url = $core->url; + + if ($widget->offline) + return; if (($widget->homeonly == 1 && $url->type !== 'default') || ($widget->homeonly == 2 && $url->type === 'default')) { return; } - $class = $divB = $divE = $title = ''; - if ($widget->class) { - $class = html::escapeHTML($widget->class); - } - if ( !$widget->content_only) { - $divB = '
'; - $divE = '
'; - } - if ( $widget->title ) { - $title = '

' . html::escapeHTML($widget->title) . '

'; - } - - return $divB . $title . - '' . - $divE; + $res = + ($widget->title ? $widget->renderTitle(html::escapeHTML($widget->title)) : ''). + '

'. + ($widget->link_title ? html::escapeHTML($widget->link_title) : __('All categories')). + '

'; + + return $widget->renderDiv($widget->content_only,'categories '.$widget->class,'',$res); } public static function initWidgets($widget) { @@ -72,6 +64,7 @@ class widgetsCategoriesPage { ); $categoriesPage->setting('content_only', __('Content only'), 0, 'check'); $categoriesPage->setting('class', __('CSS class:'), ''); + $categoriesPage->setting('offline',__('Offline'),0,'check'); } } diff --git a/changelog b/changelog new file mode 100644 index 0000000..fa4de1e --- /dev/null +++ b/changelog @@ -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 \ No newline at end of file diff --git a/default-templates/currywurst/categories.html b/default-templates/currywurst/categories.html new file mode 100644 index 0000000..5b2fd4e --- /dev/null +++ b/default-templates/currywurst/categories.html @@ -0,0 +1,47 @@ +{{tpl:extends parent="__layout.html"}} + + + {{tpl:lang Categories Page}} - {{tpl:BlogName encode_html="1"}} + + + + + + + + + + + + + + + + + + + + + + + +
+

{{tpl:lang Categories}}

+ + +

{{tpl:CategoryTitle encode_html="1"}} ({{tpl:CategoryCount}})

+
{{tpl:CategoryDescription}}
+ +

{{tpl:lang Entries feed}} + + + - {{tpl:lang Comments feed}} + +

+
+
+ + +
\ No newline at end of file diff --git a/default-templates/categories.html b/default-templates/mustek/categories.html similarity index 82% rename from default-templates/categories.html rename to default-templates/mustek/categories.html index 0296064..195c493 100644 --- a/default-templates/categories.html +++ b/default-templates/mustek/categories.html @@ -1,32 +1,30 @@ - - + + - + {{tpl:lang Categories Page}} - {{tpl:BlogName encode_html="1"}} - + - - + - + - + {{tpl:include src="_head.html"}}