[ Index ] |
|
Code source de Claroline 188 |
1 <?php // $Id: GenericEditor.class.php,v 1.2 2006/10/16 08:11:16 moosh Exp $ 2 if ( count( get_included_files() ) == 1 ) die( '---' ); 3 /** 4 * CLAROLINE 5 * 6 * @version 1.8 $Revision: 1.2 $ 7 * 8 * @copyright 2001-2006 Universite catholique de Louvain (UCL) 9 * 10 * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE 11 * 12 * @see http://www.claroline.net/wiki/config_def/ 13 * 14 * @package EDITOR 15 * 16 * @author Claro Team <cvs@claroline.net> 17 * @author Sébastien Piraux <pir@cerdecam.be> 18 * 19 */ 20 21 /** 22 * Class to manage htmlarea overring simple textarea html 23 * @package EDITOR 24 */ 25 class GenericEditor 26 { 27 /** 28 * @var $name content for attribute name and id of textarea 29 */ 30 var $name; 31 32 /** 33 * @var $content content of textarea 34 */ 35 var $content; 36 37 /** 38 * @var $rows number of lines of textarea 39 */ 40 var $rows; 41 42 /** 43 * @var $cols number of cols of textarea 44 */ 45 var $cols; 46 47 /** 48 * @var $optAttrib additionnal attributes that can be added to textarea 49 */ 50 var $optAttrib; 51 52 /** 53 * @var $webPath path to access via the web to the directory of the editor 54 */ 55 var $webPath; 56 57 function GenericEditor( $name,$content,$rows,$cols,$optAttrib,$webPath ) 58 { 59 $this->name = $name; 60 $this->content = $content; 61 $this->rows = $rows; 62 $this->cols = $cols; 63 $this->optAttrib = $optAttrib; 64 $this->webPath = $webPath; 65 } 66 67 68 /** 69 * Returns the html code needed to display an advanced (default) version of the editor 70 * ! Needs to be overloaded by extending classes 71 * $returnString .= $this->getTextArea(); 72 * @return string html code needed to display an advanced (default) version of the editor 73 */ 74 function getAdvancedEditor() 75 { 76 return $this->getTextArea(); 77 } 78 79 /** 80 * Returns the html code needed to display the default textarea 81 * 82 * @access private 83 * @return string html code needed to display the default textarea 84 */ 85 function getTextArea() 86 { 87 $textArea = "\n" 88 .'<textarea ' 89 .'id="'.$this->name.'" ' 90 .'name="'.$this->name.'" ' 91 .'style="width:100%" ' 92 .'rows="'.$this->rows.'" ' 93 .'cols="'.$this->cols.'" ' 94 .$this->optAttrib.' >' 95 ."\n".htmlspecialchars($this->content)."\n" 96 .'</textarea>'."\n"; 97 98 return $textArea; 99 } 100 } 101 102 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 14:38:42 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |