Dotclear

Changeset 1096:3c0cfbe684cc for themes


Ignore:
Timestamp:
01/19/13 12:20:15 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Preview of comment may not be mandatory before posting for Ductile theme (new option in config)

Location:
themes/ductile
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_config.php

    r1081 r1096  
    229229     'subtitle_hidden' => null, 
    230230     'logo_src' => null, 
     231     'preview_not_mandatory' => null, 
    231232     // CSS 
    232233     'body_font' => null, 
     
    337338               $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']); 
    338339               $ductile_user['logo_src'] = $_POST['logo_src']; 
     340               $ductile_user['preview_not_mandatory'] = (integer) !empty($_POST['preview_not_mandatory']); 
    339341 
    340342               $ductile_stickers = array(); 
     
    510512echo '</fieldset>'; 
    511513 
     514echo '<fieldset><legend>'.__('Miscellaneous options').'</legend>'; 
     515echo '<p class="field"><label for="preview_not_mandatory">'.__('Comment preview is not mandatory:').' '. 
     516form::checkbox('preview_not_mandatory',1,$ductile_user['preview_not_mandatory']).'</label>'.'</p>'; 
     517echo '</fieldset>'; 
     518 
    512519echo '<input type="hidden" name="conf_tab" value="html">'; 
    513520echo '<p class="clear">'.form::hidden('ds_order','').'<input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>'; 
  • themes/ductile/_public.php

    r1081 r1096  
    2323$core->tpl->addValue('ductileNbEntryPerPage',array('tplDuctileTheme','ductileNbEntryPerPage')); 
    2424$core->tpl->addValue('ductileLogoSrc',array('tplDuctileTheme','ductileLogoSrc')); 
     25$core->tpl->addBlock('IfPreviewIsNotMandatory',array('tplDuctileTheme','IfPreviewIsNotMandatory')); 
    2526 
    2627class tplDuctileTheme 
     
    175176           
    176177          return $img_url; 
     178     } 
     179 
     180     public static function IfPreviewIsNotMandatory($attr,$content) 
     181     { 
     182          $s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_style'); 
     183          if ($s !== null) { 
     184               $s = @unserialize($s); 
     185               if (is_array($s)) { 
     186                    if (isset($s['preview_not_mandatory'])) { 
     187                         if ($s['preview_not_mandatory']) { 
     188                              return $content; 
     189                         } 
     190                    } 
     191               } 
     192          } 
     193          return ''; 
    177194     } 
    178195 
  • themes/ductile/locales/fr/admin.po

    r1081 r1096  
    6464msgid "Full" 
    6565msgstr "Complet" 
     66 
     67msgid "Miscellaneous options" 
     68msgstr "Options diverses" 
     69 
     70msgid "Comment preview is not mandatory:" 
     71msgstr "Prévisualisation du commentaire optionnelle :" 
    6672 
    6773msgid "Presentation" 
  • themes/ductile/tpl/_simple-entry.html

    r881 r1096  
    164164               <p class="buttons"> 
    165165                    <input type="submit" class="preview" name="preview" value="{{tpl:lang preview}}" /> 
    166                     <tpl:IfCommentPreview> 
     166                    <tpl:IfPreviewIsNotMandatory> 
    167167                         <input type="submit" class="submit" value="{{tpl:lang send}}" /> 
    168                     </tpl:IfCommentPreview> 
     168                    </tpl:IfPreviewIsNotMandatory> 
    169169               </p> 
    170170          </fieldset> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map