You are here

function collapse_text_wysiwyg_plugin in Collapse Text 7.2

Implements hook_wysiwyg_plugin().

File

./collapse_text.module, line 920
collapse_text is an input filter that allows text to be collapsible

Code

function collapse_text_wysiwyg_plugin($editor) {
  if ($editor == 'ckeditor') {

    // Provide support for strings translation: keep them out of plugin file.
    drupal_add_js(array(
      'collapse_text' => array(
        'pluginStrings' => array(
          'buttonLabel' => t('Insert collapsible text'),
          'windowLabel' => t('Collapsible text settings'),
          'titleLabel' => t('Collapsible text title'),
          'titleValidateError' => t('Collapsible text title should be provided.'),
          'contentLabel' => t('Collapsible text content'),
          'contentValidateError' => t('Collapsible text content should be provided.'),
          'stateLabel' => t('Initially expanded (not collapsed)'),
          'classesLabel' => t('Optional class'),
        ),
      ),
    ), 'setting');
    return array(
      'collapse_text' => array(
        // A URL to the plugin's homepage.
        'url' => 'http://drupal.org/project/collapse_text',
        // The full path to the native editor plugin, no trailing slash.
        'path' => drupal_get_path('module', 'collapse_text') . '/wysiwyg/ckeditor/',
        // A list of buttons provided by this native plugin.
        'buttons' => array(
          'collapse_text' => t('Collapse Text - Insert Collapsible Text tags [collapsed][/collapsed]'),
        ),
        // Boolean whether the editor needs to load this plugin.
        'load' => TRUE,
      ),
    );
  }
}