mirror of https://git.dotclear.org/dev/dotclear
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 #18962.10
parent
07c0bd6c2f
commit
9148ba88a6
|
@ -73,6 +73,14 @@ $bad_dt = false;
|
|||
$TB = new dcTrackback($core);
|
||||
$tb_urls = $tb_excerpt = '';
|
||||
|
||||
if (count($formaters_combo)==0 || !$core->auth->getOption('editor') || $core->auth->getOption('editor')=='') {
|
||||
dcPage::addNotice("message",
|
||||
sprintf(__('Choose an active editor in %s.'),
|
||||
'<a href="preferences.php#user-options">'.__('your preferences').'</a>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
# Get entry informations
|
||||
if (!empty($_REQUEST['id']))
|
||||
{
|
||||
|
@ -448,10 +456,12 @@ if (!$can_view_page) {
|
|||
-------------------------------------------------------- */
|
||||
if ($can_edit_post)
|
||||
{
|
||||
if (count($formaters_combo)>0) {
|
||||
if (count($formaters_combo)>0 && ($core->auth->getOption('editor') && $core->auth->getOption('editor')!='')) {
|
||||
$post_format_field = form::combo('post_format',$formaters_combo,$post_format,'maximal');
|
||||
} else {
|
||||
$post_format_field = '<a href="preferences.php#user-options">'.__('Choose an activated editor').'</a>';
|
||||
$post_format_field = sprintf(__('Choose an active editor in %s.'),
|
||||
'<a href="preferences.php#user-options">'.__('your preferences').'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
$sidebar_items = new ArrayObject(array(
|
||||
|
|
|
@ -66,6 +66,7 @@ $editors = array_keys($editors_combo);
|
|||
|
||||
# Formaters combo
|
||||
$formaters_combo = dcAdminCombos::getFormatersCombo();
|
||||
$formaters_combo_editor = array();
|
||||
|
||||
if (!empty($user_options['editor']) && !empty($formaters_combo[$user_options['editor']])) {
|
||||
$formaters_combo_editor = $formaters_combo[$user_options['editor']];
|
||||
|
@ -435,7 +436,7 @@ $core->formNonce().
|
|||
echo '<div class="multi-part" id="user-options" title="'.__('My options').'">';
|
||||
|
||||
echo
|
||||
'<form action="preferences.php" method="post" id="opts-forms">'.
|
||||
'<form action="preferences.php#user-options" method="post" id="opts-forms">'.
|
||||
'<h3>'.__('My options').'</h3>';
|
||||
|
||||
echo
|
||||
|
@ -467,22 +468,15 @@ if ($core->auth->isSuperAdmin()) {
|
|||
echo
|
||||
'</div>';
|
||||
|
||||
// hide editor selector if less than 2 editors
|
||||
if (count($editors)<2) {
|
||||
$editor_class = ' hidden';
|
||||
} else {
|
||||
$editor_class = '';
|
||||
}
|
||||
|
||||
echo
|
||||
'<div class="fieldset">'.
|
||||
'<h4>'.__('Edition').'</h4>'.
|
||||
|
||||
'<p class="field'.$editor_class.'"><label for="user_editor">'.__('Preferred editor:').'</label>'.
|
||||
form::combo('user_editor',$editors_combo,$user_options['editor']).'</p>'.
|
||||
'<p class="field"><label for="user_editor">'.__('Preferred editor:').'</label>'.
|
||||
form::combo('user_editor',array_merge(array(__('Choose an editor') => ''),$editors_combo),$user_options['editor']).'</p>'.
|
||||
|
||||
'<p class="field"><label for="user_post_format">'.__('Preferred format:').'</label>'.
|
||||
form::combo('user_post_format',$formaters_combo_editor,$user_options['post_format']).'</p>'.
|
||||
form::combo('user_post_format',array_merge(array('' => ''), $formaters_combo_editor),$user_options['post_format']).'</p>'.
|
||||
|
||||
'<p class="field"><label for="user_post_status">'.__('Default entry status:').'</label>'.
|
||||
form::combo('user_post_status',$status_combo,$user_post_status).'</p>'.
|
||||
|
|
|
@ -3663,6 +3663,12 @@ msgstr "<p>Cela signifie soit que les informations d'identifiant ou de mot de pa
|
|||
msgid "The following error was encountered while trying to read the database:"
|
||||
msgstr "L'erreur suivante a été rencontrée lors de la tentative d'accès à la base de données :"
|
||||
|
||||
msgid "Choose an active editor in %s."
|
||||
msgstr "Choisissez un éditeur dans %s."
|
||||
|
||||
msgid "your preferences"
|
||||
msgstr "vos préférences"
|
||||
|
||||
#~ msgid "You don't have permissions to deactivate this plugin."
|
||||
#~ msgstr "Vous n'avez pas les permissions pour désactiver ce plugin."
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ $redir_url = $p_url.'&act=page';
|
|||
$post_id = '';
|
||||
$post_dt = '';
|
||||
$post_format = $core->auth->getOption('post_format');
|
||||
$editor = $core->auth->getOption('editor');
|
||||
$post_password = '';
|
||||
$post_url = '';
|
||||
$post_lang = $core->auth->getInfo('user_lang');
|
||||
|
@ -57,16 +58,24 @@ $status_combo = dcAdminCombos::getPostStatusesCombo();
|
|||
$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
|
||||
|
||||
# Formaters combo
|
||||
$formaters_combo = dcAdminCombos::getFormatersCombo();
|
||||
$formaters_combo = dcAdminCombos::getFormatersCombo($editor);
|
||||
|
||||
# Languages combo
|
||||
$rs = $core->blog->getLangs(array('order'=>'asc'));
|
||||
$lang_combo = dcAdminCombos::getLangsCombo($rs,true);
|
||||
|
||||
|
||||
# Validation flag
|
||||
$bad_dt = false;
|
||||
|
||||
if (count($formaters_combo)==0 || !$core->auth->getOption('editor') || $core->auth->getOption('editor')=='') {
|
||||
dcPage::addNotice("message",
|
||||
sprintf(__('Choose an active editor in %s.'),
|
||||
'<a href="preferences.php#user-options">'.__('your preferences').'</a>'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
# Get page informations
|
||||
if (!empty($_REQUEST['id']))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue