Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / plugin / _ckeditor / ckeditor.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }}\Plugin\CKEditorPlugin;
4
5 use Drupal\ckeditor\CKEditorPluginBase;
6 use Drupal\editor\Entity\Editor;
7
8 /**
9  * Defines the "{{ plugin_label }}" plugin.
10  *
11  * @CKEditorPlugin(
12  *   id = "{{ plugin_id }}",
13  *   label = @Translation("{{ plugin_label }}"),
14  *   module = "{{ machine_name }}"
15  * )
16  */
17 class {{ class }} extends CKEditorPluginBase {
18
19   /**
20    * {@inheritdoc}
21    */
22   public function getFile() {
23     return drupal_get_path('module', '{{ machine_name }}') . '/js/plugins/{{ short_plugin_id }}/plugin.js';
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function getConfig(Editor $editor) {
30     return [];
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   public function getButtons() {
37     $module_path = drupal_get_path('module', '{{ machine_name }}');
38     return [
39       '{{ short_plugin_id }}' => [
40         'label' => $this->t('{{ plugin_label }}'),
41         'image' => $module_path . '/js/plugins/{{ short_plugin_id }}/icons/{{ short_plugin_id }}.png',
42       ],
43     ];
44   }
45
46 }