Contributions
WYSIWYG SPAW EDITOR
WYSIWYG SPAW EDITOR
Covers all Admin text fields
Edit_orders , newsletter_manager,Send_email,Banner_Manager
The editor have different layouts and 2 designs(classic and default).
A screenshot is added.
Have fun with it!!!
Expand All / Collapse All
I have come accross a serious bug with Spaw, once installed most activity in the admin side is mirrored back to your own server!! I noticed slow downs in the admin side & think this was cause, also its v-slow to load on each instance. I tried on second site & got same effect. I`m now using a different editor (FCK)
I would not reccomend using till someone finds the cause.
Attached is empty
We still haven't found a satasfactury solution to this annoying little bug, however i have got an update for people who are trying to get this stop gap solution to work on other pages other than on catagories.php.
Go to the page you want to add the fix to and then look at the source.
Do a search for:
onclick="SpawPGcore.codeCleanupClick
The is the onlick event of the clean up html button. Grab the whole of the on click event:
SpawPGcore.codeCleanupClick(content_obj.getTargetEditor(),content_obj.getToolbarItem('content_tools_0'), this);
and use this in the onload event. Don't forget to wrap it in a PHP if statement so that the code only fires when you are trying to edit or create a new product/category/newsletter or oyu will start to see javascript errors.
Another point to make is that i have found that sometimes i have needed to get the javascript to fire twice, as if you had clicked the button twice. Just add the code into the onload event twice.
Hope that helps some more people.
Regards
Inspired by the SPAW V1.0 installations below, a very simple guide to installing the newer SPAW V2.0 into your OSCommerce installation.
Updated to include Clean HTML paste in Category edits.
Here is a easier way to have a clear code in editor:
Open admin/includes/functions/html_output.php:
Change the output a form textarea field to following:
// Output a form textarea field with Spaw
function tep_draw_textarea_field1($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true){
include(DIR_FS_EDITOR . 'spaw.inc.php');
$editor = new SpawEditor($name, $text);
$editor->default_width = $width;
$editor->default_height = $height;
$editor->base_href = HTTP_SERVER . DIR_WS_CATALOG;
return $editor->show();
}
//Output a form textarea field without Editor
function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
$field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
} elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
$field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
}
} elseif (tep_not_null($text)) {
$field .= tep_output_string_protected($text);
}
$field .= '
I noticed that when you came to edit a spaw text area that contained HTML i needed to click the "cleanup html" button before i could do anything as the html entities had been encoded in plain text.
To combat this, add this bit of code into the body onload in admin/categories.php
<?php if ($action == 'new_product') { echo ("SpawPGcore.codeCleanupClick(products_description_1__1_obj.getTargetEditor(),products_description_1__1_obj.getToolbarItem('products_description_1__1_tools_0'), this);"); } ?>
My opening body tag now looks like:
<body bgcolor="#FFFFFF" onLoad="goOnLoad();<?php if ($action == 'new_product') { echo ("SpawPGcore.codeCleanupClick(products_description_1__1_obj.getTargetEditor(),products_description_1__1_obj.getToolbarItem('products_description_1__1_tools_0'), this);"); } ?>">
This will call the html cleanup function on load so you don't need to press the button
Inspired by the SPAW V1.0 installations below, a very simple guide to installing the newer SPAW V2.0 into your OSCommerce installation.
What does it do
SPAW Editor is a web based WYSIWYG editor control enabling web site
developers to replace a standard textarea html control with full-featured,
fully customizable, multilanguage, skinable web based WYSIWYG editor.
Required:
MS Internet Explorer 5.5 or above or
Gecko based browsers: Mozilla 1.3+, Firefox, etc.
To be used on a non-changed osCommerce 2.2-MS2
Included are as per structure:
- install.txt => complete instructions
- general.php
- html_output.php
- edit-wysiwyg.php
This is not a complete package.
See install.txt on HowTo download the /spaw/ directory.
Found the documentation for this so you can configure the size, tools, attributes etc.
This is to help with the installation of this contribution as I ran into problems install with some of the configurations I had to trail and error to get it working.
WYSIWYG SPAW EDITOR
Covers all Admin text fields
Edit_orders , newsletter_manager,Send_email,Banner_Manager
The editor have different layouts and 2 designs(classic and default).
A screenshot is added.
Have fun with it!!!
Note: Contributions are used at own risk.