Changeset 3977:a79dd101e851 for plugins/dcCKEditor/inc
- Timestamp:
- 06/21/19 14:03:55 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcCKEditor/inc/dc.ckeditor.behaviors.php
r3915 r3977 20 20 * @param editor <b>string</b> wanted editor 21 21 * @param context <b>string</b> page context (post,page,comment,event,...) 22 * @param tags <b>array</b> array of ids intoinject editor22 * @param tags <b>array</b> array of elt ids (textarea) where inject editor 23 23 * @param syntax <b>string</b> wanted syntax (xhtml) 24 24 */ … … 33 33 34 34 $res = 35 '<script type="text/javascript">' . "\n" . 36 dcPage::jsVar('dotclear.ckeditor_context', $context) . 37 'dotclear.ckeditor_tags_context = ' . sprintf('{%s:["%s"]};' . "\n", $context, implode('","', $tags)) . 38 'var CKEDITOR_BASEPATH = "' . DC_ADMIN_URL . self::$p_url . '/js/ckeditor/";' . "\n" . 39 dcPage::jsVar('dotclear.admin_base_url', DC_ADMIN_URL) . 40 dcPage::jsVar('dotclear.base_url', $GLOBALS['core']->blog->host) . 41 dcPage::jsVar('dotclear.dcckeditor_plugin_url', DC_ADMIN_URL . self::$p_url) . 42 dcPage::jsVar('dotclear.user_language', $GLOBALS['core']->auth->getInfo('user_lang')) . 43 'CKEDITOR_GETURL = function(resource) { 44 // If this is not a full or absolute path. 45 if ( resource.indexOf(":/") == -1 && resource.indexOf("/") !== 0 ) { 46 resource = this.basePath + resource; 47 } 48 return resource; 49 };' . "\n" . 50 "dotclear.msg.img_select_title = '" . html::escapeJS(__('Media chooser')) . "'; " . "\n" . 51 "dotclear.msg.img_select_accesskey = '" . html::escapeJS(__('m')) . "'; " . "\n" . 52 "dotclear.msg.post_link_title = '" . html::escapeJS(__('Link to an entry')) . "'; " . "\n" . 53 "dotclear.msg.link_title = '" . html::escapeJS(__('Link')) . "'; " . "\n" . 54 "dotclear.msg.link_accesskey = '" . html::escapeJS(__('l')) . "'; " . "\n" . 55 "dotclear.msg.img_title = '" . html::escapeJS(__('External image')) . "'; " . "\n" . 56 "dotclear.msg.url_cannot_be_empty = '" . html::escapeJS(__('URL field cannot be empty.')) . "';" . "\n" . 57 "</script>\n" . 35 dcPage::jsJson('ck_editor_ctx', [ 36 'ckeditor_context' => $context, 37 'ckeditor_tags_context' => [$context => $tags], 38 'admin_base_url' => DC_ADMIN_URL, 39 'base_url' => $GLOBALS['core']->blog->host, 40 'dcckeditor_plugin_url' => DC_ADMIN_URL . self::$p_url, 41 'user_language' => $GLOBALS['core']->auth->getInfo('user_lang') 42 ]) . 43 dcPage::jsJson('ck_editor_var', [ 44 'CKEDITOR_BASEPATH' => DC_ADMIN_URL . self::$p_url . '/js/ckeditor/' 45 ]) . 46 dcPage::jsJson('ck_editor_msg', [ 47 'img_select_title' => __('Media chooser'), 48 'img_select_accesskey' => __('m'), 49 'post_link_title' => __('Link to an entry'), 50 'link_title' => __('Link'), 51 'link_accesskey' => __('l'), 52 'img_title' => __('External image'), 53 'url_cannot_be_empty' => __('URL field cannot be empty.') 54 ]) . 55 dcPage::jsLoad(self::$p_url . '/js/_post_editor.js') . 58 56 dcPage::jsLoad(self::$p_url . '/js/ckeditor/ckeditor.js') . 59 57 dcPage::jsLoad(self::$p_url . '/js/ckeditor/adapters/jquery.js') .
Note: See TracChangeset
for help on using the changeset viewer.