Commit 7e34b4ff authored by Julien de Nas de Tourris's avatar Julien de Nas de Tourris
Browse files

Reindent ckeditor_advanced_tab.install, update README.md, add icon

parent 68c406c8
CKEditor Advanced Tab for Dialogs
CKEDITOR ADVANCED TAB FOR DIALOGS
====================
INTRODUCTION
......@@ -7,8 +7,10 @@ INTRODUCTION
This module integrates the [dialogadvtab](
https://ckeditor.com/cke4/addon/dialogadvtab) CKEditor plugin for Drupal 8.
This plugin provides the Advanced dialog window tab to extend some editor dialog windows.
Thanks to this other plugins do not need to implement the same features for their dialog windows.
This plugin provides the Advanced dialog window tab to extend
some editor dialog windows.
Thanks to this other plugins do not need to implement
the same features for their dialog windows.
Among the plugins that implement the Advanced tab are:
* The [Link](https://ckeditor.com/cke4/addon/link) plugin
......@@ -70,8 +72,7 @@ entry for `type:drupal-library`. For example:
CKEditor Advanced Tab module, and enable it [as per usual](
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules).
### Install Manually
Install Manually
* Download the [dialogadvtab](https://ckeditor.com/cke4/addon/dialogadvtab)
CKEditor plugin.
......@@ -82,6 +83,14 @@ CKEditor plugin.
* Install the CKEditor Advanced Tab module [as per usual](
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules).
CONFIGURATION
-------------
* Configure the WYSIWYG buttons in
Administration » Configuration » Content authoring » Text formats and editors:
- Drag the advanced icon button to your toolbar and save
MAINTAINERS
-----------
Current maintainers:
......
......@@ -9,33 +9,34 @@
* Implements hook_requirements().
*/
function ckeditor_advanced_tab_requirements($phase) {
$requirements = [];
if ($phase == 'install' || $phase == 'runtime') {
$path = '/libraries/ckeditor/plugins/dialogadvtab/';
$plugin_detected = file_exists(DRUPAL_ROOT . $path . 'plugin.js');
$requirements = [];
if ($plugin_detected) {
$requirements['dialogadvtab'] = [
'title' => t('CKEditor Advanced Tab'),
'value' => t('Plugin detected'),
'severity' => REQUIREMENT_OK,
];
}
else {
$requirements['dialogadvtab'] = [
'title' => t('CKEditor Advanced Tab'),
'value' => t('Plugin not detected'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The CKEditor plugin <b>Dialog Advanced Tab</b> is
required. Download <a href=":url">here</a> and copy to
<code>:path</code>.', [
':url' => 'https://ckeditor.com/cke4/addon/dialogadvtab',
':path' => $path,
]),
];
}
if ($phase == 'install' || $phase == 'runtime') {
$path = '/libraries/ckeditor/plugins/dialogadvtab/';
$plugin_detected = file_exists(DRUPAL_ROOT . $path . 'plugin.js');
if ($plugin_detected) {
$requirements['dialogadvtab'] = [
'title' => t('CKEditor Advanced Tab'),
'value' => t('Plugin detected'),
'severity' => REQUIREMENT_OK,
];
}
else {
$requirements['dialogadvtab'] = [
'title' => t('CKEditor Advanced Tab'),
'value' => t('Plugin not detected'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The CKEditor plugin <b>Dialog Advanced Tab</b> is
required. Download <a href=":url">here</a> and copy to
<code>:path</code>.', [
':url' => 'https://ckeditor.com/cke4/addon/dialogadvtab',
':path' => $path,
]),
];
}
}
return $requirements;
return $requirements;
}
icons/link.png

533 Bytes

......@@ -19,17 +19,27 @@ class CKEditorAdvancedTab extends CKEditorPluginBase {
* {@inheritdoc}
*/
public function getFile() {
return 'libraries/ckeditor/plugins/dialogadvtab/plugin.js';
$path = 'libraries/ckeditor/plugins/dialogadvtab/plugin.js';
if (file_exists($path)) {
return 'libraries/ckeditor/plugins/dialogadvtab/plugin.js';
}
else {
drupal_set_message(t("The plugin.js file can't be found in libraries/ckeditor/plugins/dialogadvtab. Please check README for installation."), 'error');
}
}
/**
* {@inheritdoc}
*/
public function getButtons() {
$path = drupal_get_path('module', 'ckeditor_advanced_tab') . '/icons';
return [
'CreateDiv' => [
'AdvancedTab' => [
'label' => t('Advanced Tab'),
'image' => 'libraries/ckeditor/plugins/dialogadvtab/icons/table.png',
'image' => $path . '/link.png',
],
];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment