Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 23
DrupalLink
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 23
 getFile
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getLibraries
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 4
 getConfig
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 getButtons
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 12
<?php
/**
 * @file
 * Contains \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalLink.
 */
namespace Drupal\ckeditor\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
/**
 * Defines the "drupallink" plugin.
 *
 * @CKEditorPlugin(
 *   id = "drupallink",
 *   label = @Translation("Drupal link"),
 *   module = "ckeditor"
 * )
 */
class DrupalLink extends CKEditorPluginBase {
  /**
   * {@inheritdoc}
   */
  public function getFile() {
    return drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink/plugin.js';
  }
  /**
   * {@inheritdoc}
   */
  public function getLibraries(Editor $editor) {
    return array(
      'core/drupal.ajax',
    );
  }
  /**
   * {@inheritdoc}
   */
  public function getConfig(Editor $editor) {
    return array(
      'drupalLink_dialogTitleAdd' => t('Add Link'),
      'drupalLink_dialogTitleEdit' => t('Edit Link'),
    );
  }
  /**
   * {@inheritdoc}
   */
  public function getButtons() {
    $path = drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink';
    return array(
      'DrupalLink' => array(
        'label' => t('Link'),
        'image' => $path . '/link.png',
      ),
      'DrupalUnlink' => array(
        'label' => t('Unlink'),
        'image' => $path . '/unlink.png',
      ),
    );
  }
}