DrupalUrl::getFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @file
5
 * Contains \Drupal\url_embed\Plugin\CKEditorPlugin\DrupalUrl.
6
 */
7
8
namespace Drupal\url_embed\Plugin\CKEditorPlugin;
9
10
use Drupal\editor\Entity\Editor;
11
use Drupal\embed\EmbedCKEditorPluginBase;
12
13
/**
14
 * Defines the "drupalurl" plugin.
15
 *
16
 * @CKEditorPlugin(
17
 *   id = "drupalurl",
18
 *   label = @Translation("URL"),
19
 *   embed_type_id = "url"
20
 * )
21
 */
22
class DrupalUrl extends EmbedCKEditorPluginBase {
23
24
  /**
25
   * {@inheritdoc}
26
   */
27
  public function getFile() {
28
    return drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/plugin.js';
29
  }
30
31
  /**
32
   * {@inheritdoc}
33
   */
34
  public function getConfig(Editor $editor) {
35
    return array(
36
      'DrupalUrl_dialogTitleAdd' => t('Insert Url'),
37
      'DrupalUrl_dialogTitleEdit' => t('Edit Url'),
38
      'DrupalUrl_buttons' => $this->getButtons(),
39
    );
40
  }
41
42
}
43