You are here

function wysiwyg_openwysiwyg_version in Wysiwyg 5.2

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_openwysiwyg_version'
wysiwyg_openwysiwyg_editor in editors/openwysiwyg.inc
Plugin implementation of hook_editor().

File

editors/openwysiwyg.inc, line 46
Editor integration functions for openWYSIWYG.

Code

function wysiwyg_openwysiwyg_version($editor) {

  // 'library path' has '/scripts' appended already.
  $changelog = $editor['editor path'] . '/changelog';
  if (!file_exists($changelog)) {
    return;
  }
  $changelog = fopen($changelog, 'r');
  $line = fgets($changelog, 20);
  if (preg_match('@v([\\d\\.]+)@', $line, $version)) {
    fclose($changelog);
    return $version[1];
  }
  fclose($changelog);
}