Dotclear


Ignore:
Timestamp:
12/17/14 08:04:25 (11 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
2.7
Message:

Add tags into inject ckeditor for adminPostEditor behavior
Addresses #2011

@TODO : need to find a way to add multiple context: for example comment tab on admin/post.php page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcCKEditor/inc/dc.ckeditor.behaviors.php

    r2852 r2854  
    1616    protected static $config_url = 'plugin.php?p=dcCKEditor&config=1'; 
    1717 
    18     public static function adminPostEditor($editor='',$context='') { 
     18    /** 
     19     * adminPostEditor add javascript to the DOM to load ckeditor depending on context 
     20     * 
     21     * @param editor   <b>string</b> wanted editor 
     22     * @param context  <b>string</b> page context (post,page,comment,event,...) 
     23     * @param tags     <b>array</b>  array of ids into inject editor 
     24     */ 
     25    public static function adminPostEditor($editor='',$context='',array $tags=array()) { 
    1926        if (empty($editor) || $editor!='dcCKEditor') { return;} 
    2027 
     
    2734            '<script type="text/javascript">'."\n". 
    2835            "//<![CDATA[\n". 
     36            dcPage::jsVar('dotclear.ckeditor_context', $context). 
     37            'dotclear.ckeditor_tags_context = '.sprintf('{%s:["%s"]};'."\n", $context, implode('","', $tags)). 
    2938            'var CKEDITOR_BASEPATH = "'.DC_ADMIN_URL.self::$p_url.'/js/ckeditor/";'."\n". 
    3039            dcPage::jsVar('dotclear.base_url', $GLOBALS['core']->blog->host). 
     
    7079        } 
    7180    } 
     81 
     82    public static function getTagsContext() { 
     83        return self::$tagsContext; 
     84    } 
    7285} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map