[Openfirst-cvscommit] base/includes edit.php,1.3,1.4
Brought to you by:
xtimg
From: Jamie <ast...@us...> - 2005-10-19 06:05:25
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12388/includes Modified Files: edit.php Log Message: Updated names for naming scheme Index: edit.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/edit.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit.php 29 Jun 2005 21:20:41 -0000 1.3 --- edit.php 19 Oct 2005 06:05:17 -0000 1.4 *************** *** 1,93 **** ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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. ! * ! * 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 ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! #$ofRegisteredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module dir and the display name. ! */ ! /*function registerEditor($dir, $Name) { ! global $ofRegisteredEditors; ! $ofRegisteredEditors[$dir] = $Name; ! }*/ ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function selectEditor($dir) { ! global $ogModuleManager; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getEditorObject')) { ! $GLOBALS['ofEditorPlugin'] =& $module->getEditorObject(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! * The suggested function of this is to strip markup. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $ofEditorPlugin = new Editor; ! ?> --- 1,93 ---- ! <?php ! /* ! * openFIRST.base - includes/mdoules.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: Jamie Bliss <ja...@op...> ! * ! * 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. ! * ! * 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 ! * ! */ ! // Purpose: Defines the Editor class, which allows a module to create a new ! // markup language and the editor for it, as well as global functions ! // to handle it. ! ! #$ofRegisteredEditors = array(); ! ! /** Registers an editor. ! * Should be handled by a module include. ! * Allows for multiple editors to co-exist. ! * Pass the module dir and the display name. ! */ ! /*function registerEditor($dir, $Name) { ! global $ofRegisteredEditors; ! $ofRegisteredEditors[$dir] = $Name; ! }*/ ! ! /** Selects an editor for use. ! * Should only be called by system, not by ! * modules. ! * @todo Write module code to support this. ! */ ! function ofSelectEditor($dir) { ! global $ogModuleManager; ! $module =& $ogModuleManager->getModuleFromDir($dir); ! if (method_exists($module, 'getEditorObject')) { ! $GLOBALS['ofEditorPlugin'] =& $module->getEditorObject(); ! return true; ! } else { ! // This indicates a serious coding error on the part of the plugin. ! // _Some_ kind of alert is probably needed. ! return false; ! } ! } ! ! /** Handles editors and parsers. ! */ ! class Editor { ! /** Returns the HTML to paste on a page. ! * The return should not be modified in any way, ! * else you may break the software. ! */ ! function getEditField($fieldname,$height,$width,$init) { ! return '<textarea name="'.htmlentities($fieldname).'" cols="'.htmlentities($width).'" rows="'.htmlentities($height).'">'. ! htmlentities($init). ! '</textarea>'; ! } ! ! /** Returns the text posted. ! */ ! function getFieldValue($fieldname) { ! return $_REQUEST[$fieldname]; ! } ! ! /** Returns the plain text version, eg for search indeces. ! * The suggested function of this is to strip markup. ! */ ! function getPlainText($text) { ! return $text; ! } ! ! /** Returns the HTML version for display. ! */ ! function parseText($text) { ! return htmlentities($text); ! } ! } ! ! #Default ! $ogEditorPlugin = new Editor; ! ?> |