You are here

function wysiwyg_whizzywig_version in Wysiwyg 6

Same name and namespace in other branches
  1. 5.2 editors/whizzywig.inc \wysiwyg_whizzywig_version()
  2. 5 editors/whizzywig.inc \wysiwyg_whizzywig_version()
  3. 6.2 editors/whizzywig.inc \wysiwyg_whizzywig_version()
  4. 7.2 editors/whizzywig.inc \wysiwyg_whizzywig_version()

Detect editor version.

Parameters

$editor: An array containing editor properties as returned from hook_editor().

Return value

The installed editor version.

1 string reference to 'wysiwyg_whizzywig_version'
wysiwyg_whizzywig_editor in editors/whizzywig.inc
Plugin implementation of hook_editor().

File

editors/whizzywig.inc, line 41

Code

function wysiwyg_whizzywig_version($editor) {
  $script = wysiwyg_get_path('whizzywig') . '/whizzywig.js';
  $script = fopen($script, 'r');
  $line = fgets($script, 43);
  if (preg_match('@Whizzywig v([0-9]+)@', $line, $version)) {
    fclose($script);
    return $version[1];
  }
}