[Openfirst-cvscommit] SF.net SVN: openfirst: [199] trunk/src
Brought to you by:
xtimg
From: <ast...@us...> - 2006-06-23 05:12:06
|
Revision: 199 Author: astronouth7303 Date: 2006-06-22 22:11:49 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/openfirst/?rev=199&view=rev Log Message: ----------- Moving Wysiwyg editor to its own module. Note that it is not ready for anything, as it has major XSS vectors. This is just to simplify code and debugging. Added Paths: ----------- trunk/src/wysiwyg/ trunk/src/wysiwyg/DHTMLEditor Info.txt trunk/src/wysiwyg/css/ trunk/src/wysiwyg/dialog/ trunk/src/wysiwyg/gecko/ trunk/src/wysiwyg/images/ trunk/src/wysiwyg/js/ trunk/src/wysiwyg/modules/ trunk/src/wysiwyg/openfirst.info.xml trunk/src/wysiwyg/wysiwyg.php Removed Paths: ------------- trunk/src/includes/functions/wysiwyg/ trunk/src/includes/functions/wysiwyg.php Deleted: trunk/src/includes/functions/wysiwyg.php =================================================================== --- trunk/src/includes/functions/wysiwyg.php 2006-06-23 05:06:03 UTC (rev 198) +++ trunk/src/includes/functions/wysiwyg.php 2006-06-23 05:11:49 UTC (rev 199) @@ -1,51 +0,0 @@ -<?php -/* - * openFIRST.base - config/functions/wysiwyg.php - * - * Copyright (C) 2003, - * openFIRST Project - * Original Author: David Di Biase<dav...@ea...> and DHTMLEditor Author: Hans-J\xFCrgen Petrich <pe...@tr...> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - // A complete function to create the Javascript command for loading of the WYSIWYG - function make_wysiwyg($fieldname,$height,$width,$init){ - global $basepath; -?> -<SCRIPT TYPE="text/javascript" language="JavaScript1.3"> -<!-- !!!! important comment this !!!! - document.dhtmlEditors_home='<?php echo $basepath; ?>/config/functions/wysiwyg/'; - document.writeln('<'+'SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'js/lib.js">'+'<'+'/SCRIPT'+'>'); - document.writeln('<'+'SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'modules/button_html.js">'+'<'+'/SCRIPT'+'>'); - -// --> -</SCRIPT> -<textarea id="<?php echo $fieldname; ?>" name="<?php echo $fieldname; ?>" style="width:<?php echo $height; ?>px; height:<?php echo $width; ?>px;"><?php echo $init; ?></textarea> -<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> -<!-- - var myEditor = new dhtmlEditor; - myEditor.registerApiModul(MODUL__toggleEditModeGetApiInfoArray('<?php echo $basepath; ?>/config/functions/wysiwyg/images/newdoc.gif')); - myEditor.make_andReplaceTextarea('<?php echo $fieldname; ?>'); -//--> -</SCRIPT> -<?php - } -?> Copied: trunk/src/wysiwyg/DHTMLEditor Info.txt (from rev 180, trunk/src/includes/functions/wysiwyg/DHTMLEditor Info.txt) =================================================================== --- trunk/src/wysiwyg/DHTMLEditor Info.txt (rev 0) +++ trunk/src/wysiwyg/DHTMLEditor Info.txt 2006-06-23 05:11:49 UTC (rev 199) @@ -0,0 +1,58 @@ +// Copyright 2002,2003 by Hans-J\xFCrgen Petrich - Germany Berlin <pe...@tr...> +// Free for Private use ;-) if not removing or changing the (contents of)lincense.txt and copyrights in the source +// For any kind of commercial usage this script's requires a license +// Please contact pe...@tr... for a license request + +// Special thanks to Hans-J\xFCrgen Petrich for allowing the openFIRST team to include his very powerful +// WYSIWYG editor. We extend our thanks to him on behalf of the USFIRST teams who will be using +// this source in the development of their site. + +// USAGE REQUEST FROM DAVID DI BIASE TO HANS PETRICH + +Hi David, + +>> Would you allow us to use your source code and implement it into our +>> open-source project to distribute to students? + +Yes (i'm proud that the Editor may help you with your great project) + +Best Greetings from Germany(Munich) to you and all your Developers + +Hans-J\xFCrgen Petrich + +----- Original Message ----- +From: "David M.Di Biase" <dav...@ea...> +To: <pe...@tr...> +Sent: Tuesday, August 19, 2003 11:42 PM +Subject: DHTMLEditor Use in Open-Source Project + +>> Hi, +>> +>> I am e-mailing you in regards to your DHTMLEditor open-source WYSIWYG. I +>> am apart of the openFIRST development team (http://www.openfirst.org). +>> We are a sourceforge.net listed open-source development group that is +>> coding a complete portal system for teams of a robotics competition (the +>> USFIRST Robotics Competition: http://www.usfirst.org). +>> +>> Our source code will be released in a few weeks to over 600 teams in +>> this robotics competition. The uses of our source are completely +>> non-commercial and completely educational. +>> +>> Our team needed a solution for a WYSIWYG that is compatible with our +>> system and works well when tested over different OS's and browsers. We +>> found that DHTMLEditor worked best in our testing. +>> +>> Would you allow us to use your source code and implement it into our +>> open-source project to distribute to students? All your source will be +>> kept in tact, with the license agreement and credit, following a link +>> within the source. +>> +>> Great work btw, we hope that you will allow us to put it to use in our +>> system. +>> +>> Thanks, +>> +>> David Di Biase +>> The openFIRST Development Team +>> +>> \ No newline at end of file Copied: trunk/src/wysiwyg/css (from rev 180, trunk/src/includes/functions/wysiwyg/css) Copied: trunk/src/wysiwyg/dialog (from rev 180, trunk/src/includes/functions/wysiwyg/dialog) Copied: trunk/src/wysiwyg/gecko (from rev 180, trunk/src/includes/functions/wysiwyg/gecko) Copied: trunk/src/wysiwyg/images (from rev 180, trunk/src/includes/functions/wysiwyg/images) Copied: trunk/src/wysiwyg/js (from rev 180, trunk/src/includes/functions/wysiwyg/js) Copied: trunk/src/wysiwyg/modules (from rev 180, trunk/src/includes/functions/wysiwyg/modules) Added: trunk/src/wysiwyg/openfirst.info.xml =================================================================== --- trunk/src/wysiwyg/openfirst.info.xml (rev 0) +++ trunk/src/wysiwyg/openfirst.info.xml 2006-06-23 05:11:49 UTC (rev 199) @@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<module xmlns="http://openfirst.org/xml/module/1.0" id="openfirst.wysiwyg"> + <!-- Info --> + <!-- This is not used, except as meta data --> + <name>WYSIWYG</name> + <version>Devel</version> + <author>David Di Biase</author> + <maintainer>Jamie Bliss</maintainer> + + <includes> + <include>$fModPath/wysiwyg.php</include> + </includes> +</module> Property changes on: trunk/src/wysiwyg/openfirst.info.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + LF Copied: trunk/src/wysiwyg/wysiwyg.php (from rev 180, trunk/src/includes/functions/wysiwyg.php) =================================================================== --- trunk/src/wysiwyg/wysiwyg.php (rev 0) +++ trunk/src/wysiwyg/wysiwyg.php 2006-06-23 05:11:49 UTC (rev 199) @@ -0,0 +1,81 @@ +<?php +/* + * openFIRST.wysiwyg - wysiwyg.php + * + * Copyright (C) 2003, + * openFIRST Project + * Original Author: David Di Biase<dav...@ea...> and DHTMLEditor Author: Hans-J\xFCrgen Petrich <pe...@tr...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +class WysiwygModule extends Module { + function &getEditorObject() { + return new WysiwygEditor(&$this); + } +} + + +class WysiwygEditor extends Editor { + var $module; + /*private*/ function WysiwygEditor(&$module) { + $this->module =& $module; + } + + // A complete function to create the Javascript command for loading of the WYSIWYG + function getEditField($fieldname,$height,$width,$init){ + global $BasePath; + $dir = $BasePath.'/'.$this->module->getDir(); + ob_start(); +?> +<script type="text/javascript" language="JavaScript1.3"> +//<!-- !!!! important comment this !!!! + document.writeln('<'+'script language="JavaScript" type="text/javascript" src="<?php echo htmlentities($dir); ?>/js/lib.js">'+'<'+'/script'+'>'); + document.writeln('<'+'script language="JavaScript" type="text/javascript" src="<?php echo htmlentities($dir); ?>/modules/button_html.js">'+'<'+'/script'+'>'); +// --> +</script> +<textarea id="<?php echo htmlentities($fieldname); ?>" name="<?php echo htmlentities($fieldname); ?>" style="width:<?php echo htmlentities($width); ?>; height:<?php echo htmlentities($height); ?>;"><?php echo htmlentities($init); ?></textarea> +<script language="JavaScript" type="text/javascript"> +//<!-- + var myEditor = new dhtmlEditor; + myEditor.registerApiModul(MODUL__toggleEditModeGetApiInfoArray('<?php echo $dir; ?>/images/newdoc.gif')); + myEditor.make_andReplaceTextarea('<?php echo htmlentities($fieldname); ?>'); +//--> +</script> +<?php + $text = ob_get_clean(); + return $text; + } + + function getPlainText($text) { + return strip_tags($text); + } + + function parseText($text) { + #FIXME: XSS VECTOR! + return $text; + } +} + +$wysiwygmod =& new WysiwygModule(basename(dirname(__FILE__))); +$ogModuleManager->addModuleFromObject($wysiwygmod); +unset($wysiwygmod); +?> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |