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 = '
'. + ($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 Entries feed}}
+
+