Dotclear

Changeset 2776:75004db1c37c for inc


Ignore:
Timestamp:
11/10/14 16:31:35 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Comment mandatory preview before submit may be disabled, using new <tpl:IfCommentPreviewOptional> instead of <tpl:IfCommentPreview> for displaying submit button. Applied only in currywurst templateset in order to insure backward compatibility. Fixes #1963

Location:
inc/public
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/public/class.dc.template.php

    r2774 r2776  
    118118          # Comment preview 
    119119          $this->addBlock('IfCommentPreview',array($this,'IfCommentPreview')); 
     120          $this->addBlock('IfCommentPreviewOptional',array($this,'IfCommentPreviewOptional')); 
    120121          $this->addValue('CommentPreviewName',array($this,'CommentPreviewName')); 
    121122          $this->addValue('CommentPreviewEmail',array($this,'CommentPreviewEmail')); 
     
    24092410     /* Comment preview -------------------------------- */ 
    24102411     /*dtd 
     2412     <!ELEMENT tpl:IfCommentPreviewOptional - - -- Container displayed if comment preview is optional or currently previewed --> 
     2413     */ 
     2414     public function IfCommentPreviewOptional($attr,$content) 
     2415     { 
     2416          return 
     2417          '<?php if ($core->blog->settings->system->comment_preview_optional || ($_ctx->comment_preview !== null && $_ctx->comment_preview["preview"])) : ?>'. 
     2418          $content. 
     2419          '<?php endif; ?>'; 
     2420     } 
     2421 
     2422     /*dtd 
    24112423     <!ELEMENT tpl:IfCommentPreview - - -- Container displayed if comment is being previewed --> 
    24122424     */ 
  • inc/public/default-templates/currywurst/_simple-entry.html

    r2641 r2776  
    164164               <p class="buttons"> 
    165165                    <button type="submit" class="preview" name="preview" value="{{tpl:lang Preview}}">{{tpl:lang Preview}}</button> 
    166                   <tpl:IfCommentPreview> 
     166                  <tpl:IfCommentPreviewOptional> 
    167167                    <button type="submit" class="submit" value="{{tpl:lang Send}}">{{tpl:lang Send}}</button> 
    168                   </tpl:IfCommentPreview> 
     168                  </tpl:IfCommentPreviewOptional> 
    169169               </p> 
    170170     </form> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map