Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /**
|
Chris@0
|
4 * @file
|
Chris@0
|
5 * Documentation for CKEditor module APIs.
|
Chris@0
|
6 */
|
Chris@0
|
7
|
Chris@0
|
8 use Drupal\editor\Entity\Editor;
|
Chris@0
|
9
|
Chris@0
|
10 /**
|
Chris@0
|
11 * @addtogroup hooks
|
Chris@0
|
12 * @{
|
Chris@0
|
13 */
|
Chris@0
|
14
|
Chris@0
|
15 /**
|
Chris@0
|
16 * Modify the list of available CKEditor plugins.
|
Chris@0
|
17 *
|
Chris@0
|
18 * This hook may be used to modify plugin properties after they have been
|
Chris@0
|
19 * specified by other modules.
|
Chris@0
|
20 *
|
Chris@0
|
21 * @param $plugins
|
Chris@0
|
22 * An array of all the existing plugin definitions, passed by reference.
|
Chris@0
|
23 *
|
Chris@0
|
24 * @see \Drupal\ckeditor\CKEditorPluginManager
|
Chris@0
|
25 */
|
Chris@0
|
26 function hook_ckeditor_plugin_info_alter(array &$plugins) {
|
Chris@0
|
27 $plugins['someplugin']['label'] = t('Better name');
|
Chris@0
|
28 }
|
Chris@0
|
29
|
Chris@0
|
30 /**
|
Chris@0
|
31 * Modify the list of CSS files that will be added to a CKEditor instance.
|
Chris@0
|
32 *
|
Chris@0
|
33 * Modules may use this hook to provide their own custom CSS file without
|
Chris@0
|
34 * providing a CKEditor plugin. This list of CSS files is only used in the
|
Chris@0
|
35 * iframe versions of CKEditor.
|
Chris@0
|
36 *
|
Chris@0
|
37 * Front-end themes (and base themes) can easily specify CSS files to be used in
|
Chris@0
|
38 * iframe instances of CKEditor through an entry in their .info.yml file:
|
Chris@0
|
39 *
|
Chris@0
|
40 * @code
|
Chris@0
|
41 * ckeditor_stylesheets:
|
Chris@0
|
42 * - css/ckeditor-iframe.css
|
Chris@0
|
43 * @endcode
|
Chris@0
|
44 *
|
Chris@0
|
45 * @param array &$css
|
Chris@0
|
46 * An array of CSS files, passed by reference. This is a flat list of file
|
Chris@0
|
47 * paths which can be either relative to the Drupal root or external URLs.
|
Chris@0
|
48 * @param $editor
|
Chris@0
|
49 * The text editor object as returned by editor_load(), for which these files
|
Chris@0
|
50 * are being loaded. Based on this information, it is possible to load the
|
Chris@0
|
51 * corresponding text format object.
|
Chris@0
|
52 *
|
Chris@0
|
53 * @see _ckeditor_theme_css()
|
Chris@0
|
54 */
|
Chris@0
|
55 function hook_ckeditor_css_alter(array &$css, Editor $editor) {
|
Chris@0
|
56 $css[] = drupal_get_path('module', 'mymodule') . '/css/mymodule-ckeditor.css';
|
Chris@0
|
57 }
|
Chris@0
|
58
|
Chris@0
|
59 /**
|
Chris@0
|
60 * @} End of "addtogroup hooks".
|
Chris@0
|
61 */
|