function wysiwyg_jwysiwyg_version in Wysiwyg 5.2
Same name and namespace in other branches
- 5 editors/jwysiwyg.inc \wysiwyg_jwysiwyg_version()
- 6.2 editors/jwysiwyg.inc \wysiwyg_jwysiwyg_version()
- 6 editors/jwysiwyg.inc \wysiwyg_jwysiwyg_version()
- 7.2 editors/jwysiwyg.inc \wysiwyg_jwysiwyg_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_jwysiwyg_version'
- wysiwyg_jwysiwyg_editor in editors/
jwysiwyg.inc - Plugin implementation of hook_editor().
File
- editors/
jwysiwyg.inc, line 48 - Editor integration functions for jWYSIWYG.
Code
function wysiwyg_jwysiwyg_version($editor) {
$script = $editor['library path'] . '/jquery.wysiwyg.js';
if (!file_exists($script)) {
return;
}
$script = fopen($script, 'r');
fgets($script);
$line = fgets($script);
if (preg_match('@([0-9\\.]+)$@', $line, $version)) {
fclose($script);
return $version[1];
}
fclose($script);
}