Dotclear

Changeset 2737:23dda5f89c36


Ignore:
Timestamp:
08/25/14 14:40:28 (10 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Missing test for editor from behavior callback
Apply changes to page plugin
Addresses #1896

Location:
plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcLegacyEditor/inc/dc.legacy.editor.behaviors.php

    r2736 r2737  
    1515     protected static $p_url = 'index.php?pf=dcLegacyEditor'; 
    1616 
    17      public static function adminPostEditor($editor) { 
     17     public static function adminPostEditor($editor='') { 
    1818          global $core; 
    1919 
    20           if ($editor!='dcLegacyEditor') { 
     20          if (empty($editor) || $editor!='dcLegacyEditor') { 
    2121               return; 
    2222          } 
  • plugins/pages/page.php

    r2694 r2737  
    5959 
    6060# Formaters combo 
    61 $formaters_combo = dcAdminCombos::getFormatersCombo($editor); 
     61$core_formaters = $core->getFormaters(); 
     62$available_formats = array('' => ''); 
     63foreach ($core_formaters as $editor => $formats) { 
     64     foreach ($formats as $format) { 
     65        $available_formats[$format] = $format; 
     66    } 
     67} 
    6268 
    6369# Languages combo 
     
    6773# Validation flag 
    6874$bad_dt = false; 
    69  
    70 if (count($formaters_combo)==0 || !$core->auth->getOption('editor') || $core->auth->getOption('editor')=='') { 
    71      dcPage::addNotice("message",  
    72                            sprintf(__('Choose an active editor in %s.'),  
    73                                           '<a href="preferences.php#user-options">'.__('your preferences').'</a>' 
    74                                           ) 
    75                            ); 
    76  
    77 } 
    7875 
    7976# Get page informations 
     
    287284} 
    288285 
     286$admin_post_behavior = ''; 
     287if (!empty($core->auth->getOption('editor')) && !empty($core->auth->getOption('editor')[$post_format])) { 
     288     $admin_post_behavior = $core->callBehavior('adminPostEditor', $core->auth->getOption('editor')[$post_format]); 
     289} 
     290 
    289291?> 
    290292<html> 
     
    300302  dcPage::jsModal(). 
    301303  dcPage::jsLoad('js/_post.js'). 
    302   $core->callBehavior('adminPostEditor'). 
     304  $admin_post_behavior. 
    303305  dcPage::jsConfirmClose('entry-form','comment-form'). 
    304306  # --BEHAVIOR-- adminPageHeaders 
     
    413415                         '<div>'. 
    414416                         '<h5 id="label_format"><label for="post_format" class="classic">'.__('Text formatting').'</label></h5>'. 
    415                          '<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal'). 
    416                          '</p>'. 
     417                         '<p>'.form::combo('post_format',$available_formats,$post_format,'maximal').'</p>'. 
    417418                         '<p class="format_control control_wiki">'. 
    418419                         '<a id="convert-xhtml" class="button'.($post_id && $post_format != 'wiki' ? ' hide' : ''). 
Note: See TracChangeset for help on using the changeset viewer.

Sites map