setOpt('active_auto_urls',1); # Activation de la reconnaissance d'url $this->setOpt('active_macros',1); # Activation des macros «««..»»» $this->setOpt('active_wikiwords',0); # Activation des mots wiki $this->setOpt('active_blockattr',1); # Activation des attributs de blocs °°..°° $this->setOpt('active_auto_img',0); # Activation des images automatiques dans les liens [] $this->setOpt('words_pattern','((?setOpt('mail_pattern','/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/'); $this->setOpt('url_pattern','/^(?registerFunction('macro:flash',array($this,'wikiFlash')); $this->registerFunction('macro:importpage',array($this,'importPage')); $this->registerFunction('macro:importitem',array($this,'importItem')); $this->registerFunction('macro:includephp',array($this,'includephp')); $this->registerFunction('macro:ww',array($this,'wikiwikiWords')); } function parseWikiWord($str,&$tag,&$attr,&$type) { $tag = 'span'; $attr = ' class="wiki" onclick="wLink(this);" title="'.$str.'"'; return $str; } function parseMacro($str,&$tag,&$attr,&$type) { $data = $this->__splitTagsAttr($str); if (count($data) == 1) { $item = trim($str); $content = $str; } elseif (count($data) > 1) { $item = $data[0]; $content = trim($data[1]); } $tag = 'span'; $attr = ' class="wiki" onclick="wLink(this);" title="'.$content.'"'; $str = $item; return $str; } function __specialUrls() { $res['#^google://(.*)$#'] = 'http://www.google.com/search?q=$1&start=0&start=0'; $res['#^wikipedia://(.*)$#'] = 'http://fr.wikipedia.org/wiki/$1'; $res['#^wiki://(.*)$#'] = './?$1'; return $res; } function InsertLinks ( $Text ) { $Result = preg_replace( $Expr, "$0", $Text ); return $Result; } function wikiFlash($s,$args) { if ((list($src,$w,$h) = explode("|",preg_replace('/^flash (.+?) ([0-9]+?)x([0-9]+?)$/','$1|$2|$3',$args))) !== false) { return ''; } return null; } function importPage($s,$args) //importe le contenu d'une page à l'intérieur de la page courante { if (($src = preg_replace('/^importpage (.+?)$/','$1',$args)) !== false) { $tmp.=""; if ( $fd = fopen( $src, "r") ) { while ($line=fgets($fd,1000)) { $tmp.=$line; } fclose ($fd); } //$tmp=str_replace( 'images/', $src.'images/', $tmp ); return $tmp; } return null; } function importItem($s,$args) //importe le contenu d'un item l'intérieur de la page courante { if (($src = preg_replace('/^importitem (.+?)$/','$1',$args)) !== false) { $tmp.=""; $tmp.='