function wysiwyg_fckeditor_version in Wysiwyg 5
Same name and namespace in other branches
- 5.2 editors/fckeditor.inc \wysiwyg_fckeditor_version()
- 6.2 editors/fckeditor.inc \wysiwyg_fckeditor_version()
- 6 editors/fckeditor.inc \wysiwyg_fckeditor_version()
- 7.2 editors/fckeditor.inc \wysiwyg_fckeditor_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_fckeditor_version'
- wysiwyg_fckeditor_editor in editors/
fckeditor.inc - Plugin implementation of hook_editor().
File
- editors/
fckeditor.inc, line 47 - Editor integration functions for FCKeditor.
Code
function wysiwyg_fckeditor_version($editor) {
$library = $editor['library path'] . '/fckeditor.js';
$library = fopen($library, 'r');
$max_lines = 100;
while ($max_lines && ($line = fgets($library, 60))) {
if (preg_match('@^FCKeditor.prototype.Version\\s*= \'([\\d\\.]+)@', $line, $version)) {
fclose($library);
return $version[1];
}
$max_lines--;
}
fclose($library);
}