Dotclear

Changeset 1947


Ignore:
Timestamp:
12/09/09 00:57:12 (13 years ago)
Author:
franck
Message:

Typo plugin 1.5 for Dotclear 2

  • PHP 5.3 Compliance
  • DC 2.2 new setting namespace
Location:
plugins/typo
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • plugins/typo/CHANGELOG

    r655 r1947  
     1Typo plugin 1.5 for Dotclear 2 
     2=========================================== 
     3* PHP 5.3 Compliance 
     4* DC 2.2 new setting namespace 
     5 
    16Typo plugin 1.4 for Dotclear 2 
    27=========================================== 
  • plugins/typo/CREDITS

    r1820 r1947  
    22 
    33Dotclear Typo plugin 
    4 Copyright (c) 2008 Franck Paul 
     4Copyright (c) 2009 Franck Paul 
    55<http://open-time.net/> 
    66All rights reserved. 
  • plugins/typo/_admin.php

    r1820 r1947  
    3232class adminTypo 
    3333{ 
    34      public static function adminPostsActionsCombo(&$args) 
     34     public static function adminPostsActionsCombo($args) 
    3535     { 
    3636          global $core; 
     
    5050 
    5151               '<p><label class="classic">'. 
    52                form::checkbox('set_typo','1',$core->blog->settings->typo_active). 
     52               form::checkbox('set_typo','1',$core->blog->settings->typo->typo_active). 
    5353               ' '.__('Apply typographic replacements for selected entries').'</label></p>'. 
    5454                
     
    6363     } 
    6464      
    65      public static function adminPostsActions(&$core,$posts,$action,$redir) 
     65     public static function adminPostsActions($core,$posts,$action,$redir) 
    6666     { 
    6767          if ($action == 'typo' && !empty($_POST['set_typo']) 
     
    106106                         $excerpt = &$ref['excerpt_xhtml']; 
    107107                         if ($excerpt) { 
    108                               if ($core->blog->settings->typo_entries) { 
     108                              if ($core->blog->settings->typo->typo_entries) { 
    109109                                   $excerpt = SmartyPants($excerpt); 
    110110                              } 
     
    115115                         $content = &$ref['content_xhtml']; 
    116116                         if ($content) { 
    117                               if ($core->blog->settings->typo_entries) { 
     117                              if ($core->blog->settings->typo->typo_entries) { 
    118118                                   $content = SmartyPants($content); 
    119119                              } 
     
    124124     } 
    125125      
    126      public static function updateTypoComments(&$blog,&$cur) 
     126     public static function updateTypoComments($blog,$cur) 
    127127     { 
    128128          global $core; 
    129           if ($core->blog->settings->typo_active && $core->blog->settings->typo_comments) 
     129          if ($core->blog->settings->typo->typo_active && $core->blog->settings->typo->typo_comments) 
    130130          { 
    131131               /* Transform typo for comment content (XHTML) */ 
    132132               if (!(boolean)$cur->comment_trackback) { 
    133133                    if ($cur->comment_content != null) { 
    134                          if ($core->blog->settings->typo_comments) 
     134                         if ($core->blog->settings->typo->typo_comments) 
    135135                              $cur->comment_content = SmartyPants($cur->comment_content); 
    136136                    } 
  • plugins/typo/_define.php

    r1820 r1947  
    1515     /* Description*/         "Brings smart typographic replacements for your blog entries and comments", 
    1616     /* Author */             "Franck Paul", 
    17      /* Version */            '1.4', 
     17     /* Version */            '1.5', 
    1818     /* Permissions */        'contentadmin' 
    1919); 
  • plugins/typo/_public.php

    r1820 r1947  
    1919class dcTypo 
    2020{ 
    21      public static function updateTypoComments(&$blog,&$cur) 
     21     public static function updateTypoComments($blog,$cur) 
    2222     { 
    2323          global $core; 
    2424 
    25           if ($core->blog->settings->typo_active && $core->blog->settings->typo_comments) 
     25          if ($core->blog->settings->typo->typo_active && $core->blog->settings->typo->typo_comments) 
    2626          { 
    2727               /* Transform typo for comment content (XHTML) */ 
    2828               if (!(boolean)$cur->comment_trackback) { 
    2929                    if ($cur->comment_content != null) { 
    30                          if ($core->blog->settings->typo_comments) 
     30                         if ($core->blog->settings->typo->typo_comments) 
    3131                              $cur->comment_content = SmartyPants($cur->comment_content); 
    3232                    } 
     
    3434          } 
    3535     } 
    36      public static function previewTypoComments(&$prv) 
     36     public static function previewTypoComments($prv) 
    3737     { 
    3838          global $core; 
    3939 
    40           if ($core->blog->settings->typo_active && $core->blog->settings->typo_comments) 
     40          if ($core->blog->settings->typo->typo_active && $core->blog->settings->typo->typo_comments) 
    4141          { 
    4242               /* Transform typo for comment content (XHTML) */ 
    4343               if ($prv['content'] != null) { 
    44                     if ($core->blog->settings->typo_comments) 
     44                    if ($core->blog->settings->typo->typo_comments) 
    4545                         $prv['content'] = SmartyPants($prv['content']); 
    4646               } 
  • plugins/typo/index.php

    r1820 r1947  
    1414 
    1515// Setting default parameters if missing configuration 
    16 if (is_null($core->blog->settings->typo_active)) { 
     16if (is_null($core->blog->settings->typo->typo_active)) { 
    1717     try { 
    18           $core->blog->settings->setNameSpace('typo'); 
     18          $core->blog->settings->addNamespace('typo'); 
    1919 
    2020          // Default state is active for entries content and inactive for comments 
    21           $core->blog->settings->put('typo_active',true,'boolean'); 
    22           $core->blog->settings->put('typo_entries',true,'boolean'); 
    23           $core->blog->settings->put('typo_comments',false,'boolean'); 
     21          $core->blog->settings->typo->put('typo_active',true,'boolean'); 
     22          $core->blog->settings->typo->put('typo_entries',true,'boolean'); 
     23          $core->blog->settings->typo->put('typo_comments',false,'boolean'); 
    2424          $core->blog->triggerBlog(); 
    2525          http::redirect(http::getSelfURI()); 
     
    3030} else { 
    3131     // Setting new 1.3 parameter if missing in configuration 
    32      if (is_null($core->blog->settings->typo_entries)) { 
     32     if (is_null($core->blog->settings->typo->typo_entries)) { 
    3333          try { 
    3434               // Default state is active for entries content 
    35                $core->blog->settings->setNameSpace('typo'); 
    36                $core->blog->settings->put('typo_entries',true,'boolean'); 
     35               $core->blog->settings->addNamespace('typo'); 
     36               $core->blog->settings->typo->put('typo_entries',true,'boolean'); 
    3737               $core->blog->triggerBlog(); 
    3838               http::redirect(http::getSelfURI()); 
     
    4545 
    4646// Getting current parameters 
    47 $typo_active = (boolean)$core->blog->settings->typo_active; 
    48 $typo_entries = (boolean)$core->blog->settings->typo_entries; 
    49 $typo_comments = (boolean)$core->blog->settings->typo_comments; 
     47$typo_active = (boolean)$core->blog->settings->typo->typo_active; 
     48$typo_entries = (boolean)$core->blog->settings->typo->typo_entries; 
     49$typo_comments = (boolean)$core->blog->settings->typo->typo_comments; 
    5050 
    5151// Saving new configuration 
     
    5353     try 
    5454     { 
    55           $core->blog->settings->setNameSpace('typo'); 
     55          $core->blog->settings->addNamespace('typo'); 
    5656 
    5757          $typo_active = (empty($_POST['active']))?false:true; 
    5858          $typo_entries = (empty($_POST['entries']))?false:true; 
    5959          $typo_comments = (empty($_POST['comments']))?false:true; 
    60           $core->blog->settings->put('typo_active',$typo_active,'boolean'); 
    61           $core->blog->settings->put('typo_entries',$typo_entries,'boolean'); 
    62           $core->blog->settings->put('typo_comments',$typo_comments,'boolean'); 
     60          $core->blog->settings->typo->put('typo_active',$typo_active,'boolean'); 
     61          $core->blog->settings->typo->put('typo_entries',$typo_entries,'boolean'); 
     62          $core->blog->settings->typo->put('typo_comments',$typo_comments,'boolean'); 
    6363          $core->blog->triggerBlog(); 
    6464          $msg = __('Configuration successfully updated.'); 
  • plugins/typo/locales/fr/main.po

    r1820 r1947  
    88"Report-Msgid-Bugs-To: \n" 
    99"POT-Creation-Date: 2009-01-05 19:57+0100\n" 
    10 "PO-Revision-Date: 2009-10-30 08:18+0100\n" 
    11 "Last-Translator: Kozlika <kozlika@free.fr>\n" 
     10"PO-Revision-Date: 2009-10-30 08:24+0100\n" 
     11"Last-Translator: Franck Paul <carnet.franck.paul@gmail.com>\n" 
    1212"Language-Team: Franck Paul <franck.paul@free.fr>\n" 
    1313"MIME-Version: 1.0\n" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map