HubspotForms.php in Hubspot forms 8
File
src/Plugin/CKEditorPlugin/HubspotForms.php
View source
<?php
namespace Drupal\hubspot_forms\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginInterface;
use Drupal\ckeditor\CKEditorPluginButtonsInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\editor\Entity\Editor;
class HubspotForms extends PluginBase implements CKEditorPluginInterface, CKEditorPluginButtonsInterface {
public function getDependencies(Editor $editor) {
return [];
}
public function getLibraries(Editor $editor) {
return [
'core/drupal.ajax',
];
}
public function isInternal() {
return FALSE;
}
public function getFile() {
return drupal_get_path('module', 'hubspot_forms') . '/assets/hubspot_forms.js';
}
public function getButtons() {
return [
'hubspot_forms' => [
'label' => t('Hubspot Forms'),
'image' => drupal_get_path('module', 'hubspot_forms') . '/assets/icon.png',
],
];
}
public function getConfig(Editor $editor) {
return [
'hubspot_forms_dialog_title' => t('Hubspot Forms'),
];
}
}