Dotclear

Changeset 2694:1873a0e11790 for admin


Ignore:
Timestamp:
04/05/14 14:46:47 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Children:
2700:4ded6c327e04, 3280:d258c9f4317b
Message:

Add link to preferences when no editor has been choosen.
Add an empty option in editor select to see directly no editor has been choosen.
Addresses #1896

Location:
admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r2682 r2694  
    7373$TB = new dcTrackback($core); 
    7474$tb_urls = $tb_excerpt = ''; 
     75 
     76if (count($formaters_combo)==0 || !$core->auth->getOption('editor') || $core->auth->getOption('editor')=='') { 
     77     dcPage::addNotice("message",  
     78                           sprintf(__('Choose an active editor in %s.'),  
     79                                          '<a href="preferences.php#user-options">'.__('your preferences').'</a>' 
     80                                          ) 
     81                           ); 
     82} 
    7583 
    7684# Get entry informations 
     
    449457if ($can_edit_post) 
    450458{ 
    451      if (count($formaters_combo)>0) { 
     459     if (count($formaters_combo)>0 && ($core->auth->getOption('editor') && $core->auth->getOption('editor')!='')) { 
    452460          $post_format_field = form::combo('post_format',$formaters_combo,$post_format,'maximal'); 
    453461     } else { 
    454           $post_format_field = '<a href="preferences.php#user-options">'.__('Choose an activated editor').'</a>'; 
     462          $post_format_field = sprintf(__('Choose an active editor in %s.'),  
     463          '<a href="preferences.php#user-options">'.__('your preferences').'</a>' 
     464          ); 
    455465     } 
    456466 
  • admin/preferences.php

    r2682 r2694  
    6767# Formaters combo 
    6868$formaters_combo = dcAdminCombos::getFormatersCombo(); 
     69$formaters_combo_editor = array(); 
    6970 
    7071if (!empty($user_options['editor']) && !empty($formaters_combo[$user_options['editor']])) { 
     
    436437 
    437438echo 
    438 '<form action="preferences.php" method="post" id="opts-forms">'. 
     439'<form action="preferences.php#user-options" method="post" id="opts-forms">'. 
    439440'<h3>'.__('My options').'</h3>'; 
    440441 
     
    468469'</div>'; 
    469470 
    470 // hide editor selector if less than 2 editors 
    471 if (count($editors)<2) { 
    472     $editor_class = ' hidden';     
    473 } else { 
    474     $editor_class = ''; 
    475 } 
    476  
    477471echo 
    478472'<div class="fieldset">'. 
    479473'<h4>'.__('Edition').'</h4>'. 
    480474 
    481 '<p class="field'.$editor_class.'"><label for="user_editor">'.__('Preferred editor:').'</label>'. 
    482 form::combo('user_editor',$editors_combo,$user_options['editor']).'</p>'. 
     475'<p class="field"><label for="user_editor">'.__('Preferred editor:').'</label>'. 
     476form::combo('user_editor',array_merge(array(__('Choose an editor') => ''),$editors_combo),$user_options['editor']).'</p>'. 
    483477 
    484478'<p class="field"><label for="user_post_format">'.__('Preferred format:').'</label>'. 
    485 form::combo('user_post_format',$formaters_combo_editor,$user_options['post_format']).'</p>'. 
     479form::combo('user_post_format',array_merge(array('' => ''), $formaters_combo_editor),$user_options['post_format']).'</p>'. 
    486480 
    487481'<p class="field"><label for="user_post_status">'.__('Default entry status:').'</label>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map