There’s a hidden feature in SPAW v.1.2.3. I didn’t announce it by any “official” means because it was developed to fulfill our current need in a way that might not be the best overall (but it was enough in our situation so it might be fine in yours too).
What it does is adds a dropdown to the toolbar and when you select an item from that dropdown SPAW surrounds currently selected content (or replaces it if you want) with some predefined code. For example you can add a snippet that surrounds currently selected image with a frame that includes predefined place for image caption.
So, in case you are interested in using this feature you’ll need to do the following:
1) Add your snippets to config file or to your script like this:
$spaw_dropdown_data[’codesnippet’][htmlentities(’<b><i><u>%%CURRENT_CONTENT%%</u></i></b>’)] = “Bold, italic, underline”;
Here $spaw_dropdown_data[’codesnippet’] determines that this goes to ‘codesnippet’ dropdown, htmlentities(’<b><i><u>%%CURRENT_CONTENT%%</u></i></b>’) is the actual code snippet (this is a weak place because this goes as a value for the dropdown option, so use it wisely) and “Bold, italic, underline” is what is shown in the dropdown. %%CURRENT_CONTENT%% is a pseudo tag which will be replaced by currently selected content. You can omit %%CURRENT_CONTENT%% if you just want current content to be replaced by the snippet. You can have as many lines like this as you want.
2) Add ‘codesnippet’ dropdown to your toolbar. Add the following code to the toolbar file of your choice
array(
’name’ => ‘codesnippet’,
’type’ => SPAW_TBI_DROPDOWN
),
And this is it.