DrupalFontAwesome.php in Font Awesome Icons 8.2
File
src/Plugin/CKEditorPlugin/DrupalFontAwesome.php
View source
<?php
namespace Drupal\fontawesome\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
class DrupalFontAwesome extends CKEditorPluginBase {
public function getFile() {
return drupal_get_path('module', 'fontawesome') . '/js/plugins/drupalfontawesome/plugin.js';
}
public function getLibraries(Editor $editor) {
return [
'core/drupal.ajax',
];
}
public function getConfig(Editor $editor) {
return [
'drupalFontAwesome_dialogTitleAdd' => $this
->t('Insert Font Awesome Icon'),
];
}
public function getButtons() {
return [
'DrupalFontAwesome' => [
'label' => $this
->t('Font Awesome'),
'image' => drupal_get_path('module', 'fontawesome') . '/js/plugins/drupalfontawesome/icons/drupalfontawesome.png',
],
];
}
public function isEnabled(Editor $editor) {
return TRUE;
}
}