Dotclear

Changeset 1464


Ignore:
Timestamp:
09/16/09 10:39:06 (14 years ago)
Author:
Tomtom33
Message:

spliPost 0.3 :

  • Adds plugin configuration in blog pref panel
  • Adds auto insert post pagination
  • Fixes regex's pattern bug
Location:
plugins/splitPost
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/splitPost/_admin.php

    r1420 r1464  
    1414 
    1515$core->addBehavior('adminPostHeaders',array('splitPostBehaviors','postHeaders')); 
     16$core->addBehavior('adminPageHeaders',array('splitPostBehaviors','postHeaders')); 
     17$core->addBehavior('adminBlogPreferencesForm',array('splitPostBehaviors','adminBlogPreferencesForm')); 
     18$core->addBehavior('adminBeforeBlogSettingsUpdate',array('splitPostBehaviors','adminBeforeBlogSettingsUpdate')); 
    1619 
    1720?> 
  • plugins/splitPost/_define.php

    r1423 r1464  
    1515          /* Description*/         "Split your entries in many parts", 
    1616          /* Author */             "Tomtom (http://blog.zenstyle.fr)", 
    17           /* Version */            '0.2', 
     17          /* Version */            '0.3', 
    1818          /* Permissions */        'usage', 
    1919          /* Priority */           100010 
  • plugins/splitPost/_prepend.php

    r1420 r1464  
    1616 
    1717if (!isset($core->post_page_pattern)) { 
    18      $core->post_page_pattern = '#---#'; 
     18     $core->post_page_pattern = '#<p>---</p>#'; 
    1919} 
    2020 
  • plugins/splitPost/_public.php

    r1423 r1464  
    1414 
    1515$core->tpl->addValue('PostPagination',array('splitPostTpl','PostPagination')); 
     16$core->tpl->addValue('EntryContent',array('splitPostTpl','EntryContent')); 
    1617 
    1718$core->url->register('post','post','^post/(.+)$',array('splitPostUrl','post')); 
     
    197198class splitPostTpl 
    198199{ 
     200     public static function EntryContent($attr) 
     201     { 
     202          $urls = '0'; 
     203          if (!empty($attr['absolute_urls'])) { 
     204               $urls = '1'; 
     205          } 
     206           
     207          $f = $GLOBALS['core']->tpl->getFilters($attr); 
     208           
     209          $res = ''; 
     210           
     211           
     212          if (!empty($attr['full'])) { 
     213               $res = '<?php echo '.sprintf($f, 
     214                    '$_ctx->posts->getExcerpt('.$urls.')." ".$_ctx->posts->getContent('.$urls.')').'; ?>'; 
     215          } else { 
     216               $res = '<?php echo '.sprintf($f,'$_ctx->posts->getContent('.$urls.')').'; ?>'; 
     217          } 
     218           
     219          $res .= "<?php if (\$core->blog->settings->splitpost_auto_insert) : ?>\n"; 
     220          $res .= splitPostTpl::PostPagination($attr); 
     221          $res .= "<?php endif; ?>\n"; 
     222 
     223          return $res; 
     224     } 
     225      
    199226     public static function PostPagination($attr) 
    200227     { 
     
    219246          $res .= "\$pager = new splitPostPager(\$_ctx->post_page_current,\$_ctx->post_page_count,".$max.");\n"; 
    220247          $res .= "\$pager->init(\$params);\n"; 
    221           $res .= "echo \$pager->getLinks();\n"; 
     248          $res .= "echo ".sprintf($f,'$pager->getLinks()').";\n"; 
    222249          $res .= "?>\n"; 
    223250           
  • plugins/splitPost/inc/class.split.post.php

    r1423 r1464  
    3939 
    4040          return 
    41           '<script type="text/javascript" src="index.php?pf=splitPost/js/post.min.js"></script>'. 
    42           '<script type="text/javascript">'."\n". 
    43           "//<![CDATA[\n". 
    44           dcPage::jsVar('jsToolBar.prototype.elements.splitPost.title',__('Post pager')). 
    45           "\n//]]>\n". 
    46           "</script>\n"; 
     41               $core->blog->settings->splitpost_enable ? 
     42               '<script type="text/javascript" src="index.php?pf=splitPost/js/post.min.js"></script>'. 
     43               '<script type="text/javascript">'."\n". 
     44               "//<![CDATA[\n". 
     45               dcPage::jsVar('jsToolBar.prototype.elements.splitPost.title',__('Post pager')). 
     46               "\n//]]>\n". 
     47               "</script>\n" : ''; 
     48     } 
     49      
     50     public static function adminBlogPreferencesForm($core,$settings) 
     51     { 
     52          echo 
     53          '<fieldset><legend>'.__('SplitPost').'</legend>'. 
     54          '<p><label class="classic">'. 
     55          form::checkbox('splitpost_enable','1',$settings->splitpost_enable). 
     56          __('Enable plugin').'</label></p>'. 
     57          '<p><label class="classic">'. 
     58          form::checkbox('splitpost_auto_insert','1',$settings->splitpost_auto_insert). 
     59          __('Auto insert post pagination').'</label></p>'. 
     60          '</fieldset>'; 
     61     } 
     62 
     63     public static function adminBeforeBlogSettingsUpdate($settings) 
     64     { 
     65          $settings->setNameSpace('splitpost'); 
     66          $settings->put('splitpost_enable',!empty($_POST['splitpost_enable']),'boolean'); 
     67          $settings->put('splitpost_auto_insert',!empty($_POST['splitpost_auto_insert']),'boolean'); 
     68          $settings->setNameSpace('system'); 
    4769     } 
    4870} 
  • plugins/splitPost/locales/fr/main.po

    r1420 r1464  
    11# Language: français 
    2 # Module: splitPost - 0.1 
    3 # Date: 2009-09-02 16:14:24 
     2# Module: splitPost - 0.2 
     3# Date: 2009-09-16 08:36:50 
    44# Author: displayBouron, tbouron@gmail.com 
    55# Translated with dcTranslater - 0.2.4 
     
    1212msgstr "Pagination du billet" 
    1313 
     14#: inc/class.split.post.php:53 
     15msgid "SplitPost" 
     16msgstr "SplitPost" 
     17 
     18#: inc/class.split.post.php:56 
     19msgid "Enable plugin" 
     20msgstr "Activer l'extension" 
     21 
     22#: inc/class.split.post.php:59 
     23msgid "Auto insert post pagination" 
     24msgstr "Inserer automatiquement la pagination des billets" 
     25 
Note: See TracChangeset for help on using the changeset viewer.

Sites map