openImageLibrary addon (PHP)
Here we want to explain how you can use the openImageLibrary addon (for now PHP only) to let your users uploading, browsing and selecting images on your webserver.
First you have to download the latest version of the openWYSIWYG modification, which includes the openImageLibrary addon.
You will find a directory called addons in the root of the openWYSIWYG directory. If it not there you do not have the latest version of the openWYSIWYG editor.
To enable the openImageLibrary addon you have to customize the insert image popup implementation of the openWYSIWYG.
The following shows how you change the implementation of the insert image popup.
var mysettings = new WYSIWYG.Settings();
// define the location of the openImageLibrary addon
mysettings.ImagePopupFile = "addons/imagelibrary/insert_image.php";
// define the width of the insert image popup
mysettings.ImagePopupWidth = 600;
// define the height of the insert image popup
mysettings.ImagePopupHeight = 245;
Attach the editor on the textarea with the previously defined mysettings object.
<script language="javascript1.2">
WYSIWYG.attach('textareaID', mysettings);
</script>
Now try it out!
|