PDA

View Full Version : Wysiwyg Spaw Editor



michael_s
11-12-2007, 02:10 AM
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 = '';

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_POS T_VARS[$name]));
}
} elseif (tep_not_null($text)) {
$field .= tep_output_string_protected($text);
}

$field .= '

More... (http://addons.oscommerce.com/info/2963)