This is a demo page for outdated version 1 of SPAW Editor PHP Edition. To see the demo for the current SPAW Editor version 2 visit the demo page on our site

Hi... this script shows various ways of using Solmetra SPAW web based WYSIWYG editor control.

Below you will see various modes of the control and parameters that caused it to look like this.

Pay attention that you can use multiple instances of the control on the same page and with completely different settings... pretty cool ;)

ATTENTION: Image upload is disabled in these demos


DEMO #1

This is the simpliest usage of the control with all the default parameters

$sw = new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1']));
$sw->show();

DEMO #2

Now let's try something else... let's specify width and height of the control, German language and "sidetable" toolbar mode.

$sw = new SPAW_Wysiwyg('spaw2' /*name*/,stripslashes($HTTP_POST_VARS['spaw2']) /*value*/,
                       'de' /*language*/, 'sidetable' /*toolbar mode*/, 'default' /*theme*/,
                       '550px' /*width*/, '350px' /*height*/);
$sw->show();

DEMO #3

This time we will check our 'classic' (not so nice ;) theme with 'full' toolbar.

$sw = new SPAW_Wysiwyg('spaw3' /*name*/,stripslashes($HTTP_POST_VARS['spaw3']) /*value*/,
                       'en' /*language*/, 'full' /*toolbar mode*/, 'classic' /*theme*/,
                       '550px' /*width*/, '150px' /*height*/);
$sw->show();

DEMO #4

There's also a 'mini' toolbar (with minimum features without possibility to switch to code (html) mode) useful for short summary text fields.

$sw = new SPAW_Wysiwyg('spaw4' /*name*/,stripslashes($HTTP_POST_VARS['spaw4']) /*value*/,
                       'en' /*language*/, 'mini' /*toolbar mode*/, '' /*theme*/,
                       '250px' /*width*/, '50px' /*height*/);
$sw->show();

DEMO #5

You can pass an url of the stylesheet file to be used for control's content to the consturctor like we do below

$sw = new SPAW_Wysiwyg('spaw5' /*name*/,stripslashes($HTTP_POST_VARS['spaw5']) /*value*/,
                       'en' /*language*/, 'mini' /*toolbar mode*/, '' /*theme*/,
                       '250px' /*width*/, '90px' /*height*/, '/spaw/demo/demo_red.css' /*stylesheet file*/);
$sw->show();

DEMO #6

There is a way to customize the content of the dropdowns like styles, fonts, etc. You can customize it for all instances of the control by modifying $spaw_dropdown_data array in config file or you can do it for all instances of control on the page by modifying same array but this time in your current script or you can specify specific data for dropdowns of one specific instance. This example show how...

// make a copy of $spaw_dropdown_data array
$demo_array = $spaw_dropdown_data;
// unset current styles
unset($demo_array['style']);
// set new styles
$demo_array['style']['default'] = 'Default';
$demo_array['style']['crazystyle1'] = 'Crazy style no. 1';
$demo_array['style']['crazystyle2'] = 'Crazy style no. 2';
$demo_array['style']['crazystyle3'] = 'Crazy style no. 3';

// pass $demo_array to the constructor
$sw = new SPAW_Wysiwyg('spaw6' /*name*/,stripslashes($HTTP_POST_VARS['spaw6']) /*value*/,
                       'en' /*language*/, 'default' /*toolbar mode*/, '' /*theme*/,
                       '550px' /*width*/, '90px' /*height*/, '' /*stylesheet file*/,
                       $demo_array /*dropdown data*/);
$sw->show();