Dotclear

Changeset 2194


Ignore:
Timestamp:
04/15/10 23:52:50 (13 years ago)
Author:
Moe
Message:

@ Reply 1.4.1-alpha1 :

  • call AtReplyThread?.js before atReply.js, may fix bugs with "append replies"
  • moved Javascript files to js directory
  • fixed bug with incorrect type of settings
Location:
plugins/atReply
Files:
2 added
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • plugins/atReply/_admin.php

    r1607 r2194  
    33# 
    44# This file is part of @ Reply, a plugin for Dotclear 2 
    5 # Copyright 2008,2009 Moe (http://gniark.net/) and buns 
     5# Copyright 2008,2009,2010 Moe (http://gniark.net/) and buns 
    66# 
    77# @ Reply is free software; you can redistribute it and/or modify 
  • plugins/atReply/_define.php

    r1494 r2194  
    33# 
    44# This file is part of @ Reply, a plugin for Dotclear 2 
    5 # Copyright 2008,2009 Moe (http://gniark.net/) and buns 
     5# Copyright 2008,2009,2010 Moe (http://gniark.net/) and buns 
    66# 
    77# @ Reply is free software; you can redistribute it and/or modify 
     
    3030  /* Description*/  'Easily reply to comments', 
    3131  /* Author */           'Moe (http://gniark.net/) append extension by buns.fr', 
    32   /* Version */               '1.4', 
     32  /* Version */               '1.4.1-alpha1', 
    3333  /* Permissions */ 'admin' 
    3434); 
  • plugins/atReply/_public.php

    r1542 r2194  
    33# 
    44# This file is part of @ Reply, a plugin for Dotclear 2 
    5 # Copyright 2008,2009 Moe (http://gniark.net/) and buns 
     5# Copyright 2008,2009,2010 Moe (http://gniark.net/) and buns 
    66# 
    77# @ Reply is free software; you can redistribute it and/or modify 
     
    3737class AtReplyTpl 
    3838{ 
    39      public static function templateBeforeValue(&$core,$v,$attr) 
     39     public static function templateBeforeValue($core,$v,$attr) 
    4040     { 
    4141          if ($v == 'CommentAuthorLink') 
     
    4747     } 
    4848 
    49      public static function templateAfterValue(&$core,$v,$attr) 
     49     public static function templateAfterValue($core,$v,$attr) 
    5050     { 
    5151          if ($v == 'CommentAuthorLink') 
     
    5555     } 
    5656      
    57      public static function publicHeadContent(&$core) 
     57     public static function publicHeadContent($core) 
    5858     { 
    59           $settings = $core->blog->settings; 
     59          $set = $core->blog->settings; 
    6060           
    61           # default image 
    62           $image_url = $core->blog->getQmarkURL().'pf=atReply/img/reply.png'; 
    63  
     61          $QmarkURL = $core->blog->getQmarkURL(); 
     62           
    6463          # personalized image 
    65           if (strlen($settings->atreply_color) > 1) 
     64          if ((strlen($set->atreply_color) > 1) 
     65               && (file_exists($core->blog->public_path.'/atReply/reply.png'))) 
    6666          { 
    67                $personalized_image = $settings->public_url. 
    68                     '/atReply/reply.png'; 
    69                if (file_exists($core->blog->public_path.'/atReply/reply.png')); 
    70                { 
    71                     $image_url = $personalized_image; 
    72                } 
     67               $image_url = $set->public_url.'/atReply/reply.png'; 
     68          } 
     69          else 
     70          { 
     71               # default image 
     72               $image_url = $QmarkURL.'pf=atReply/img/reply.png'; 
    7373          } 
    7474           
    75           $title = (($settings->atreply_display_title) ? 'true' : 'false'); 
     75          $title = (($set->atreply_display_title) ? 'true' : 'false'); 
    7676           
    77           # Javascript variables 
     77          # Javascript 
    7878          echo( 
    7979               '<script type="text/javascript">'."\n". 
     
    8989               '\'<span class="at_reply_title" style="display:none;">\'+'. 
    9090                    'atReplyTitle+\'</span></a>\';'."\n". 
    91                'var atreply_append = '.($core->blog->settings->atreply_append ? '1' : '0').';'."\n". 
    92                'var atreply_show_switch = '.($core->blog->settings->atreply_show_switch ? '1' : '0').';'."\n". 
     91               'var atreply_append = '.($set->atreply_append ? '1' : '0').';'."\n". 
     92               'var atreply_show_switch = '.($set->atreply_show_switch ? '1' : '0').';'."\n". 
    9393               '//]]>'."\n". 
    94                '</script>'."\n". 
    95                '<script type="text/javascript" src="'.$core->blog->getQmarkURL(). 
    96                'pf=atReply/atReply.js'.'"></script>'."\n"); 
     94               '</script>'."\n" 
     95          ); 
    9796           
    98           if ($core->blog->settings->atreply_append) 
     97          if ($set->atreply_append) 
    9998          { 
    10099               echo (  
    101                     '<script type="text/javascript" src="'.$core->blog->getQmarkURL(). 
    102                     'pf=atReply/atReplyThread.js'.'"></script>'."\n". 
     100                    '<script type="text/javascript" src="'.$QmarkURL. 
     101                    'pf=atReply/js/atReplyThread.js'.'"></script>'."\n". 
    103102                    '<style type="text/css"> 
    104103                    <!-- 
     
    117116                    } 
    118117                    --> 
    119                     </style>'. 
    120                     "\n"); 
     118                    </style>'."\n" 
     119               ); 
    121120          } 
     121           
     122          echo('<script type="text/javascript" src="'.$QmarkURL. 
     123               'pf=atReply/js/atReply.js'.'"></script>'."\n"); 
    122124     } 
    123125      
    124      public static function publicCommentBeforeContent(&$core, &$ctx) 
     126     public static function publicCommentBeforeContent($core,$ctx) 
    125127     { 
    126                echo '<span id="atReplyComment'.$ctx->comments->f('comment_id').'" style="display:none;"></span>'; 
    127            
     128               echo '<span id="atReplyComment'.$ctx->comments->f('comment_id'). 
     129                    '" style="display:none;"></span>'; 
    128130     } 
    129131} 
  • plugins/atReply/index.php

    r1608 r2194  
    33# 
    44# This file is part of @ Reply, a plugin for Dotclear 2 
    5 # Copyright 2008,2009 Moe (http://gniark.net/) and buns 
     5# Copyright 2008,2009,2010 Moe (http://gniark.net/) and buns 
    66# 
    77# @ Reply is free software; you can redistribute it and/or modify 
     
    4444               'string','@ Reply arrow\'s color'); 
    4545          $settings->put('atreply_append',!empty($_POST['atreply_append']), 
    46                'string','Append replies to appropriate comments'); 
     46               'boolean','Append replies to appropriate comments'); 
    4747          $settings->put('atreply_show_switch',!empty($_POST['atreply_show_switch']), 
    48                'string','Display a switch to toggle threading'); 
     48               'boolean','Display a switch to toggle threading'); 
    4949 
    5050          # inspired by lightbox/admin.php 
     
    152152               # public_path is located at the root of the website 
    153153               $image_url = $core->blog->host.'/'.$personalized_image; 
     154          } 
     155          elseif (substr($settings->public_url,0,4) == 'http') 
     156          { 
     157               $image_url = $personalized_image; 
    154158          } else { 
    155159               $image_url = $core->blog->url.$personalized_image; 
     
    207211                    </label> 
    208212               </p> 
     213               <p class="form-note"> 
     214                    <?php printf(__('Requires %s.'), 
     215                         __('Append replies to appropriate comments')); ?> 
     216               </p> 
    209217                
    210218               <p> 
     
    216224               </p> 
    217225               <p class="form-note"> 
    218                     <?php echo(__('Leave empty to cancel this feature.').' '. 
     226                    <?php echo(__('Leave blank to disable this feature.').' '. 
    219227                         __('The default image will be used.')); ?> 
    220228               </p> 
  • plugins/atReply/js/atReplyThread.js

    r1542 r2194  
    77 
    88$(document).ready(function () { 
    9      if (atreply_show_switch) setSwitchTag(); 
     9     if (atreply_show_switch) {setSwitchTag();} 
    1010     getCommentsChildren(); 
    11      if (atreply_append) appendReplies(atreply_append); 
     11     if (atreply_append) {appendReplies(atreply_append);} 
    1212}); 
    1313 
     
    147147          } 
    148148     } 
    149      atReplySimple(); 
     149     //atReplySimple(); 
    150150} 
    151151 
  • plugins/atReply/locales/fr/main.po

    r1611 r2194  
    8585msgstr "Enregistrer la configuration" 
    8686 
    87 #~ msgid "Enable %s" 
    88 #~ msgstr "Activer %s" 
     87msgid "Requires %s." 
     88msgstr "Nécessite %s." 
    8989 
Note: See TracChangeset for help on using the changeset viewer.

Sites map