Dotclear

Changeset 2812


Ignore:
Timestamp:
12/23/10 09:57:18 (13 years ago)
Author:
Tomtom33
Message:

multiToc 1.6 :

  • Compatibility with stacker for post TOC
  • Fixed post TOC
  • Changed icons
  • Updated fr locales
Location:
plugins/multiToc/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • plugins/multiToc/trunk/_define.php

    r2808 r2812  
    1515          /* Description*/         "Makes posts or content's tables of content", 
    1616          /* Author */             "Tomtom (http://blog.zenstyle.fr), Kozlika, Franck Paul", 
    17           /* Version */            '1.5', 
     17          /* Version */            '1.6', 
    1818          /* Permissions */        'usage,contentadmin' 
    1919); 
  • plugins/multiToc/trunk/_install.php

    r2808 r2812  
    1515$m_version = $core->plugins->moduleInfo('multiToc','version'); 
    1616$i_version = $core->getVersion('multiToc'); 
    17 if (version_compare($i_version,$m_version,'>=')) { 
     17if (version_compare($i_version,$m_version,'<=')) { 
    1818     return; 
    1919} 
  • plugins/multiToc/trunk/_prepend.php

    r2808 r2812  
    1414$__autoload['multiTocUi'] = dirname(__FILE__).'/inc/class.multi.toc.php'; 
    1515 
     16$core->addBehavior('publicBeforeDocument',array('multiTocBehaviors','addTplPath')); 
     17$core->addBehavior('coreBlogGetPosts',array('multiTocBehaviors','coreBlogGetPosts')); 
     18$core->addBehavior('initStacker',array('multiTocBehaviors','initStacker')); 
     19 
    1620$core->url->register('multitoc','multitoc','^multitoc/(.*)$',array('multiTocUrl','multiToc')); 
    1721 
     
    2125{ 
    2226     public static function addTplPath() 
    23      {          
     27     { 
    2428          $GLOBALS['core']->tpl->setPath($GLOBALS['core']->tpl->getPath(), dirname(__FILE__).'/default-templates'); 
    2529     } 
     
    2731     public static function coreBlogGetPosts($rs) 
    2832     { 
    29           $s = unserialize($GLOBALS['core']->blog->settings->multiToc->multitoc_settings); 
    30            
    31           if (isset($s['post']['enable']) && $s['post']['enable']) { 
    32                $rs->extend('rsMultiTocPost'); 
    33           } 
     33          $rs->extend('rsMultiTocPost'); 
    3434     } 
    3535      
     
    4747               "</script>\n" : ''; 
    4848     } 
     49      
     50     public static function initStacker($core) 
     51     { 
     52          $core->stacker->addFilter( 
     53               'multiTocFilter', 
     54               'multiTocBehaviors', 
     55               'multiTocFilter', 
     56               'any', 
     57               100, 
     58               'multiToc', 
     59               __('Add post TOC') 
     60          ); 
     61     } 
     62      
     63     public static function multiTocFilter($rs,$text,$absolute_urls = false) 
     64     { 
     65          if ($rs->hasToc()) { 
     66               $toc = new multiTocPost($rs); 
     67               $text = $toc->process($text); 
     68               unset($toc); 
     69          } 
     70           
     71          return $text; 
     72     } 
     73} 
     74 
     75class rsMultiTocPost 
     76{ 
     77     public static function hasToc($rs) 
     78     { 
     79          if (preg_match('/<p>::TOC::<\/p>/',$rs->post_excerpt_xhtml.$rs->post_content_xhtml)) { 
     80               return true; 
     81          } 
     82          else { 
     83               return false; 
     84          } 
     85     } 
    4986} 
    5087 
  • plugins/multiToc/trunk/_public.php

    r2808 r2812  
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
    13 $core->addBehavior('publicBeforeDocument',array('multiTocBehaviors','addTplPath')); 
    14 $core->addBehavior('coreBlogGetPosts',array('multiTocBehaviors','coreBlogGetPosts')); 
     13if (!defined('DC_RC_PATH')) { return; } 
    1514 
    1615$core->tpl->addValue('MultiTocUrl', array('multiTocTpl','multiTocUrl')); 
     
    3332$core->tpl->addBlock('MultiTocMetaData',array('multiTocTpl','multiTocMetaData')); 
    3433 
    35 class rsMultiTocPost extends rsExtPostPublic 
    36 { 
    37      public static function getExcerpt($rs,$absolute_urls=false) 
    38      { 
    39           $c = parent::getExcerpt($rs,$absolute_urls); 
    40            
    41           if ($rs->hasToc()) { 
    42                $toc = new multiTocPost($rs); 
    43                $c = $toc->process($c); 
    44                unset($toc); 
    45           } 
    46            
    47           return $c; 
    48      } 
    49       
    50      public static function getContent($rs,$absolute_urls=false) 
    51      { 
    52           $c = parent::getContent($rs,$absolute_urls); 
    53            
    54           if ($rs->hasToc()) { 
    55                $toc = new multiTocPost($rs); 
    56                $c = $toc->process($c); 
    57                unset($toc); 
    58           } 
    59            
    60           return $c; 
    61      } 
    62       
    63      public static function hasToc($rs) 
    64      { 
    65           if (preg_match('/<p>::TOC::<\/p>/',$rs->post_excerpt_xhtml.$rs->post_content_xhtml)) { 
    66                return true; 
    67           } 
    68           else { 
    69                return false; 
    70           } 
    71      } 
    72 } 
    73  
    7434class multiTocUrl extends dcUrlHandlers 
    7535{ 
     
    13999          } elseif (file_exists($tagada)) { 
    140100               $css = 
    141                     $core->blog->settings->system->themes_url.'/default/multitoc.min.css'; 
     101                    $core->blog->settings->system->themes_url.'/default/multitoc.css'; 
    142102          } else { 
    143103               $css = 
  • plugins/multiToc/trunk/index.php

    r2808 r2812  
    5656     echo 
    5757     '<p class="message">'. 
    58      __('Setup has been saved successfully'). 
     58     __('Configuration has been saved successfully'). 
    5959     '</p>'; 
    6060} 
  • plugins/multiToc/trunk/locales/fr/main.po

    r1904 r2812  
    1 # Language: français 
    2 # Module: multiToc - 1.4 
    3 # Date: 2009-11-25 09:13:58 
    4 # Translated with translater 1.3 
     1# Language: Français 
     2# Module: multiToc - 1.6 
     3# Date: 2010-12-23 08:57:50 
     4# Translated with translater 1.5 
    55 
    66msgid "" 
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: multiToc 1.4\n" 
     9"Project-Id-Version: multiToc 1.6\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2009-11-25T09:13:58+00:00\n" 
    12 "Last-Translator: Thomas Bouron\n" 
     11"PO-Revision-Date: 2010-12-23T08:57:50+00:00\n" 
     12"Last-Translator: Tomtom\n" 
    1313"Language-Team: \n" 
    1414"MIME-Version: 1.0\n" 
     
    1616 
    1717#: _admin.php:19 
    18 #: index.php:95 
    19 #: index.php:98 
     18#: index.php:49 
     19#: index.php:52 
    2020msgid "Tables of content" 
    2121msgstr "Tables des matières" 
    2222 
    23 #: _public.php:344 
     23#: _prepend.php:45 
     24#: _public.php:343 
    2425#: _widgets.php:21 
    2526#: _widgets.php:22 
    26 #: inc/class.multi.toc.php:38 
    2727msgid "Table of content" 
    2828msgstr "Table des matières" 
    2929 
    30 #: _public.php:347 
     30#: _prepend.php:59 
     31msgid "Add post TOC" 
     32msgstr "Ajouter une table des matières à un billet" 
     33 
     34#: _public.php:346 
    3135#: _widgets.php:44 
    3236msgid "By category" 
    3337msgstr "Par catégorie" 
    3438 
    35 #: _public.php:349 
     39#: _public.php:348 
    3640#: _widgets.php:48 
    3741msgid "By tag" 
    3842msgstr "Par tag" 
    3943 
    40 #: _public.php:351 
     44#: _public.php:350 
    4145#: _widgets.php:52 
    4246msgid "By alpha order" 
     
    5963msgstr "Cliquez sur le nom de chacun des groupes pour afficher ou cacher la liste des billets" 
    6064 
    61 #: inc/class.multi.toc.php:144 
     65#: inc/class.multi.toc.php:166 
    6266msgid "Title up" 
    6367msgstr "Titres croissants" 
    6468 
    65 #: inc/class.multi.toc.php:145 
     69#: inc/class.multi.toc.php:167 
    6670msgid "Title down" 
    6771msgstr "Titres décroissants" 
    6872 
    69 #: inc/class.multi.toc.php:146 
     73#: inc/class.multi.toc.php:168 
    7074msgid "Date up" 
    7175msgstr "Dates croissantes" 
    7276 
    73 #: inc/class.multi.toc.php:147 
     77#: inc/class.multi.toc.php:169 
    7478msgid "Date down" 
    7579msgstr "Dates décroissantes" 
    7680 
    77 #: inc/class.multi.toc.php:148 
     81#: inc/class.multi.toc.php:170 
    7882msgid "Author up" 
    7983msgstr "Auteurs croissants" 
    8084 
    81 #: inc/class.multi.toc.php:149 
     85#: inc/class.multi.toc.php:171 
    8286msgid "Author down" 
    8387msgstr "Auteurs décroissants" 
    8488 
    85 #: inc/class.multi.toc.php:150 
     89#: inc/class.multi.toc.php:172 
    8690msgid "Comments number up" 
    8791msgstr "Nombre de commentaires croissant" 
    8892 
    89 #: inc/class.multi.toc.php:151 
     93#: inc/class.multi.toc.php:173 
    9094msgid "Comments number down" 
    9195msgstr "Nombre de commentaires décroissant" 
    9296 
    93 #: inc/class.multi.toc.php:152 
     97#: inc/class.multi.toc.php:174 
    9498msgid "Trackbacks number up" 
    9599msgstr "Nombre de rétroliens croissant" 
    96100 
    97 #: inc/class.multi.toc.php:153 
     101#: inc/class.multi.toc.php:175 
    98102msgid "Trackbacks number down" 
    99103msgstr "Nombre de rétroliens décroissant" 
    100104 
    101 #: inc/class.multi.toc.php:159 
     105#: inc/class.multi.toc.php:181 
    102106msgid "TOC by tags" 
    103107msgstr "Table des matières par tag" 
    104108 
    105 #: inc/class.multi.toc.php:160 
     109#: inc/class.multi.toc.php:182 
    106110msgid "Enable TOC by tags" 
    107111msgstr "Activer la table des matières par tag" 
    108112 
    109 #: inc/class.multi.toc.php:161 
     113#: inc/class.multi.toc.php:183 
    110114msgid "Order of tags" 
    111115msgstr "Ordre des tags" 
    112116 
    113 #: inc/class.multi.toc.php:162 
    114 #: inc/class.multi.toc.php:172 
    115 #: inc/class.multi.toc.php:186 
     117#: inc/class.multi.toc.php:184 
     118#: inc/class.multi.toc.php:194 
     119#: inc/class.multi.toc.php:209 
    116120msgid "Order of entries" 
    117121msgstr "Ordre des billets" 
    118122 
    119 #: inc/class.multi.toc.php:164 
     123#: inc/class.multi.toc.php:186 
    120124msgid "Name up" 
    121125msgstr "Noms croissants" 
    122126 
    123 #: inc/class.multi.toc.php:165 
     127#: inc/class.multi.toc.php:187 
    124128msgid "Name down" 
    125129msgstr "Noms décroissants" 
    126130 
    127 #: inc/class.multi.toc.php:169 
     131#: inc/class.multi.toc.php:191 
    128132msgid "TOC by alpha list" 
    129133msgstr "Tables des matières par lettre" 
    130134 
    131 #: inc/class.multi.toc.php:170 
     135#: inc/class.multi.toc.php:192 
    132136msgid "Enable TOC by alpha list" 
    133137msgstr "Activer la table des matières par lettre" 
    134138 
    135 #: inc/class.multi.toc.php:171 
     139#: inc/class.multi.toc.php:193 
    136140msgid "Order of alpha list" 
    137141msgstr "Ordre de la liste des lettres" 
    138142 
    139 #: inc/class.multi.toc.php:174 
     143#: inc/class.multi.toc.php:196 
    140144msgid "Alpha up" 
    141145msgstr "Lettres croissantes" 
    142146 
    143 #: inc/class.multi.toc.php:175 
     147#: inc/class.multi.toc.php:197 
    144148msgid "Alpha down" 
    145149msgstr "Lettres décroissantes" 
    146150 
    147 #: inc/class.multi.toc.php:179 
     151#: inc/class.multi.toc.php:201 
    148152msgid "Post TOC" 
    149153msgstr "Table des matières pour les billets" 
    150154 
    151 #: inc/class.multi.toc.php:180 
     155#: inc/class.multi.toc.php:202 
    152156msgid "Enable post TOC" 
    153157msgstr "Activer la table des matières pour les billets" 
    154158 
    155 #: inc/class.multi.toc.php:183 
     159#: inc/class.multi.toc.php:203 
     160msgid "Auto numbering" 
     161msgstr "Numérotation automatique" 
     162 
     163#: inc/class.multi.toc.php:206 
    156164msgid "TOC by category" 
    157165msgstr "Tables des matières par catégorie" 
    158166 
    159 #: inc/class.multi.toc.php:184 
     167#: inc/class.multi.toc.php:207 
    160168msgid "Enable TOC by category" 
    161169msgstr "Activer la table des matières par catégorie" 
    162170 
    163 #: inc/class.multi.toc.php:185 
     171#: inc/class.multi.toc.php:208 
    164172msgid "Order of categories" 
    165173msgstr "Ordre des catégories" 
    166174 
    167 #: inc/class.multi.toc.php:188 
     175#: inc/class.multi.toc.php:211 
    168176msgid "No option" 
    169177msgstr "Aucune option" 
    170178 
    171 #: inc/class.multi.toc.php:205 
     179#: inc/class.multi.toc.php:229 
    172180msgid "Display entry number of each group" 
    173181msgstr "Afficher le nombre de billets pour chaque groupe" 
    174182 
    175 #: inc/class.multi.toc.php:213 
     183#: inc/class.multi.toc.php:237 
    176184msgid "Display date" 
    177185msgstr "Afficher la date" 
    178186 
    179 #: inc/class.multi.toc.php:216 
     187#: inc/class.multi.toc.php:241 
    180188msgid "Format date :" 
    181189msgstr "Format de la date" 
    182190 
    183 #: inc/class.multi.toc.php:221 
     191#: inc/class.multi.toc.php:247 
    184192msgid "Display author" 
    185193msgstr "Afficher l'auteur" 
    186194 
    187 #: inc/class.multi.toc.php:225 
     195#: inc/class.multi.toc.php:251 
    188196msgid "Display category" 
    189197msgstr "Afficher la catégorie" 
    190198 
    191 #: inc/class.multi.toc.php:229 
     199#: inc/class.multi.toc.php:255 
    192200msgid "Display comment number" 
    193201msgstr "Afficher le nombre de commentaires" 
    194202 
    195 #: inc/class.multi.toc.php:233 
     203#: inc/class.multi.toc.php:259 
    196204msgid "Display trackback number" 
    197205msgstr "Afficher le nombre de rétroliens" 
    198206 
    199 #: inc/class.multi.toc.php:237 
     207#: inc/class.multi.toc.php:263 
    200208msgid "Display tags" 
    201209msgstr "Afficher les tags" 
    202210 
    203 #: index.php:77 
    204 msgid "Setup saved" 
    205 msgstr "Configuration enregistrée" 
    206  
    207 #: index.php:106 
    208 msgid "Save setup" 
    209 msgstr "Enregistrer la configuration" 
    210  
     211#: index.php:58 
     212msgid "Configuration has been saved successfully" 
     213msgstr "La configuration a été enregistrée avec succès" 
     214 
Note: See TracChangeset for help on using the changeset viewer.

Sites map