You are here

function wysiwyg_tinymce_themes in Wysiwyg 7.2

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

Determine available editor themes or check/reset a given one.

Parameters

$editor: A processed hook_editor() array of editor properties.

$profile: A wysiwyg editor profile.

Return value

An array of theme names. The first returned name should be the default theme name.

1 string reference to 'wysiwyg_tinymce_themes'
wysiwyg_tinymce_editor in editors/tinymce.inc
Plugin implementation of hook_editor().

File

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

Code

function wysiwyg_tinymce_themes($editor, $profile) {

  /*
  $themes = array();
  $dir = $editor['library path'] . '/themes/';
  if (is_dir($dir) && $dh = opendir($dir)) {
    while (($file = readdir($dh)) !== FALSE) {
      if (!in_array($file, array('.', '..', 'CVS', '.svn')) && is_dir($dir . $file)) {
        $themes[$file] = $file;
      }
    }
    closedir($dh);
    asort($themes);
  }
  return $themes;
  */
  if (version_compare($editor['installed version'], '4', '>=')) {
    return array(
      'modern',
    );
  }
  else {
    return array(
      'advanced',
      'simple',
    );
  }
}