You are here

function _wysiwyg_tinymce_plugin_name in Wysiwyg 6.2

Same name and namespace in other branches
  1. 5.2 editors/tinymce.inc \_wysiwyg_tinymce_plugin_name()
  2. 5 editors/tinymce.inc \_wysiwyg_tinymce_plugin_name()
  3. 6 editors/tinymce.inc \_wysiwyg_tinymce_plugin_name()
  4. 7.2 editors/tinymce.inc \_wysiwyg_tinymce_plugin_name()

Add or remove leading hiven to/of external plugin names.

TinyMCE requires that external plugins, which should not be loaded from its own plugin repository are prefixed with a hiven in the name.

Parameters

string $op: Operation to perform, 'add' or 'remove' (hiven).

string $name: A plugin name.

File

editors/tinymce.inc, line 1126
Editor integration functions for TinyMCE.

Code

function _wysiwyg_tinymce_plugin_name($op, $name) {
  if ($op == 'add') {
    if (strpos($name, '-') !== 0) {
      return '-' . $name;
    }
    return $name;
  }
  elseif ($op == 'remove') {
    if (strpos($name, '-') === 0) {
      return substr($name, 1);
    }
    return $name;
  }
}