Révision 6fd71452
Ajouté par Julien Enselme il y a environ 10 ans
drupal7/sites/all/modules/ckeditor/includes/ckeditor.page.inc | ||
---|---|---|
35 | 35 |
*/ |
36 | 36 |
function ckeditor_help_delegate($path, $arg) { |
37 | 37 |
global $base_url; |
38 |
$is_url = false; |
|
39 |
$ckeditor_url = ckeditor_path('local'); |
|
40 |
if ($ckeditor_url == '<URL>') { |
|
41 |
$ckeditor_url = ckeditor_path('url'); |
|
42 |
$is_url = true; |
|
43 |
} |
|
44 |
|
|
45 |
$do_not_touch_configjs = ''; |
|
46 |
if (!$is_url) { |
|
47 |
$do_not_touch_configjs = '<p>' . |
|
48 |
t('It is recommended to not edit the !ckeditor_config_file (!ckeditor_config_path) configuration file that is distributed with CKEditor, because you may overwrite it accidentally when you update the editor.', array( |
|
49 |
'!ckeditor_config_path' => '<code>' . $ckeditor_url . '/config.js</code>', |
|
50 |
'!ckeditor_config_file' => '<code>config.js</code>', |
|
51 |
) |
|
52 |
) . |
|
53 |
'</p>'; |
|
54 |
} |
|
38 | 55 |
switch ($path) { |
39 | 56 |
case 'admin/config/content/help#description': |
40 | 57 |
$output = t('Enables the use of CKEditor (a rich text WYSIWYG editor) instead of plain text fields.'); |
... | ... | |
46 | 63 |
'!ckeditor_module_config' => '<code>' . ckeditor_module_path('local') . '/ckeditor.config.js</code>', |
47 | 64 |
) |
48 | 65 |
) . |
49 |
'</p><p>' . |
|
50 |
t('It is recommended to not edit the !ckeditor_config_file (!ckeditor_config_path) configuration file that is distributed with CKEditor, because you may overwrite it accidentally when you update the editor.', array( |
|
51 |
'!ckeditor_config_path' => '<code>' . ckeditor_path('local') . '/config.js</code>', |
|
52 |
'!ckeditor_config_file' => '<code>config.js</code>', |
|
53 |
) |
|
54 |
) . |
|
55 |
'</p>'; |
|
66 |
'</p>'.$do_not_touch_configjs; |
|
56 | 67 |
break; |
57 | 68 |
|
58 | 69 |
case 'admin/config/content/ckeditor/editg': |
... | ... | |
70 | 81 |
'</p><p>' . |
71 | 82 |
t('Useful links: !ckeditorlink | !devguidelink | !userguidelink.', array( |
72 | 83 |
'!ckeditorlink' => l(t('CKEditor website'), 'http://ckeditor.com'), |
73 |
'!devguidelink' => l(t('Developer\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Developers_Guide'),
|
|
84 |
'!devguidelink' => l(t('CKEditor for Drupal 7 Documentation'), 'http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7'),
|
|
74 | 85 |
'!userguidelink' => l(t('User\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Users_Guide') |
75 | 86 |
) |
76 | 87 |
) . |
... | ... | |
90 | 101 |
'<p>' . |
91 | 102 |
t('Useful links: !ckeditorlink | !devguidelink | !userguidelink.', array( |
92 | 103 |
'!ckeditorlink' => l(t('CKEditor website'), 'http://ckeditor.com'), |
93 |
'!devguidelink' => l(t('Developer\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Developers_Guide'),
|
|
104 |
'!devguidelink' => l(t('CKEditor for Drupal 7 Documentation'), 'http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7'),
|
|
94 | 105 |
'!userguidelink' => l(t('User\'s Guide'), 'http://docs.cksource.com/CKEditor_3.x/Users_Guide') |
95 | 106 |
) |
96 | 107 |
) . |
... | ... | |
111 | 122 |
) |
112 | 123 |
) . |
113 | 124 |
'<br /><code>' . |
114 |
htmlspecialchars('<a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tbody> <th> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <iframe>') .
|
|
125 |
htmlspecialchars('<a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <caption> <tbody> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike>') .
|
|
115 | 126 |
'</code><br />' . |
116 | 127 |
t('<strong>Note:</strong> be careful when granting users access to create tags like %iframe.<br />If you are going to use CKEditor with the <strong>Filtered HTML</strong> input format, please read the "Setting up filters" section in the !readme file.', array( |
117 | 128 |
'%iframe' => '<iframe>', |
... | ... | |
137 | 148 |
'</h3>' . |
138 | 149 |
'<p>' . |
139 | 150 |
t('Take a look at !listlink when installing CKEditor.', array( |
140 |
'!listlink' => l(t('the list of common problems'), 'http://docs.cksource.com/CKEditor_for_Drupal/Troubleshooting') |
|
151 |
'!listlink' => l(t('the list of common problems'), 'http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7/Troubleshooting')
|
|
141 | 152 |
) |
142 | 153 |
) . |
143 | 154 |
' ' . |
... | ... | |
147 | 158 |
) . |
148 | 159 |
' ' . |
149 | 160 |
t('More information about how to customize CKEditor for your theme can be found !herelink.', array( |
150 |
'!herelink' => l(t('here'), 'http://drupal.ckeditor.com/tricks')
|
|
161 |
'!herelink' => l(t('here'), 'http://docs.cksource.com/CKEditor_for_Drupal/Open_Source/Drupal_7/Tricks')
|
|
151 | 162 |
) |
152 | 163 |
) . |
153 | 164 |
'</p>' . |
154 | 165 |
'<h3>' . |
166 |
t('Plugins: Code Snippet and MathJax') . |
|
167 |
'</h3>' . |
|
168 |
'<p>' . |
|
169 |
t('Code Snippet and MathJax are special plugins for CKEditor that are using external JavaScript libraries to style content inside editing area. The result that is returned by CKEditor is just an HTML tag that needs to again processed by a filter (either server side or client side) in order to display it properly to the user.') . |
|
170 |
'</p>' . |
|
171 |
'<h4><a name="mathjax"></a>' . |
|
172 |
t('MathJax (Mathematical Formulas)') . |
|
173 |
'</h4>' . |
|
174 |
'<p>' . |
|
175 |
t('With mathjax plugin, CKEditor produces LaTeX code surrounded by !code. In order to have it properly rendered on your site you might need to add !mathjax on your website, the simplest way to do this is to add this to your theme: !script', array( |
|
176 |
'!code' => '<code>'.htmlspecialchars('<span class="math-tex"></span>').'</code>', |
|
177 |
'!mathjax' => l('MathJax', 'http://www.mathjax.org/'), |
|
178 |
'!script' => '<br /><code>'.htmlspecialchars('<script src="http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>').'</code>' |
|
179 |
)) . |
|
180 |
'</p>' . |
|
181 |
'<h4><a name="codesnippet"></a>' . |
|
182 |
t('Code Snippet') . |
|
183 |
'</h4>' . |
|
184 |
'<p>' . |
|
185 |
t('With codesnippet plugin, CKEditor produces code snippets surrounded by !code. <strong>Note:</strong> You might need to add !highlight on your website so that the displayed code was rendered nicely as in CKEditor. The simplest way to do this is to add this to your theme: !script', array( |
|
186 |
'!highlight' => l('highlight.js', 'http://highlightjs.org/'), |
|
187 |
'!code' => '<code>'.htmlspecialchars('<pre><code></code></pre>').'</code>', |
|
188 |
'!script' => '<br /><code>'.htmlspecialchars('<link rel="stylesheet" href="http://cdn.ckeditor.com/4.4.0/full-all/plugins/codesnippet/lib/highlight/styles/default.css">').'<br />'. |
|
189 |
htmlspecialchars('<script src="http://cdn.ckeditor.com/4.4.0/full-all/plugins/codesnippet/lib/highlight/highlight.pack.js" type="text/javascript"></script>').'<br />'. |
|
190 |
htmlspecialchars('<script>hljs.initHighlightingOnLoad();</script>').'</code>' |
|
191 |
)) . |
|
192 |
'</p>' . |
|
193 |
'<h3>' . |
|
155 | 194 |
t('Uploading images and files') . |
156 | 195 |
'</h3>' . |
157 | 196 |
'<p>' . |
... | ... | |
216 | 255 |
preg_match_all("|</?([a-z][a-z0-9]*)(?:\b[^>]*)>|i", $text, $matches); |
217 | 256 |
if ($matches[1]) { |
218 | 257 |
$tags = array_unique(array_merge($matches[1], array('!--'))); |
258 |
$tags = array_map('strtolower', $tags); |
|
219 | 259 |
$text = filter_xss($text, $tags); |
220 | 260 |
} |
221 | 261 |
continue; |
Formats disponibles : Unified diff
Update CKEditor