0e16747fb8bfb1a4af095624e7a3accab74c110e
[yaffs-website] / vendor / drupal / console / templates / module / src / Plugin / CKEditorPlugin / ckeditorbutton.php.twig
1 {% extends "base/class.php.twig" %}
2
3 {% block file_path %}
4 \Drupal\{{ module }}\Plugin\CKEditorPlugin\{{ class_name }}.
5 {% endblock %}
6
7 {% block namespace_class %}
8 namespace Drupal\{{ module }}\Plugin\CKEditorPlugin;
9 {% endblock %}
10
11 {% block use_class %}
12 use Drupal\ckeditor\CKEditorPluginBase;
13 use Drupal\editor\Entity\Editor;
14 {% endblock %}
15
16 {% block class_declaration %}
17 /**
18  * Defines the "{{ plugin_id }}" plugin.
19  *
20  * NOTE: The plugin ID ('id' key) corresponds to the CKEditor plugin name.
21  * It is the first argument of the CKEDITOR.plugins.add() function in the
22  * plugin.js file.
23  *
24  * @CKEditorPlugin(
25  *   id = "{{ plugin_id }}",
26  *   label = @Translation("{{ label }}")
27  * )
28  */
29 class {{ class_name }} extends CKEditorPluginBase {% endblock %}
30 {% block class_methods %}
31
32   /**
33    * {@inheritdoc}
34    *
35    * NOTE: The keys of the returned array corresponds to the CKEditor button
36    * names. They are the first argument of the editor.ui.addButton() or
37    * editor.ui.addRichCombo() functions in the plugin.js file.
38    */
39   public function getButtons() {
40     // Make sure that the path to the image matches the file structure of
41     // the CKEditor plugin you are implementing.
42     return [
43       '{{ button_name }}' => [
44         'label' => t('{{ label }}'),
45         'image' => '{{ button_icon_path }}',
46       ],
47     ];
48   }
49
50   /**
51    * {@inheritdoc}
52    */
53   public function getFile() {
54     // Make sure that the path to the plugin.js matches the file structure of
55     // the CKEditor plugin you are implementing.
56     return drupal_get_path('module', '{{ module }}') . '/js/plugins/{{ plugin_id }}/plugin.js';
57   }
58
59   /**
60    * {@inheritdoc}
61    */
62   public function isInternal() {
63     return FALSE;
64   }
65
66   /**
67    * {@inheritdoc}
68    */
69   public function getDependencies(Editor $editor) {
70     return [];
71   }
72
73   /**
74    * {@inheritdoc}
75    */
76   public function getLibraries(Editor $editor) {
77     return [];
78   }
79
80   /**
81    * {@inheritdoc}
82    */
83   public function getConfig(Editor $editor) {
84     return [];
85   }
86 {% endblock %}