Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 394 → Rev 395

/trunk/api/text/wiki_papyrus/Parse/Motcles.php
1,5 → 1,5
<?php
// $Id: Motcles.php,v 1.2 2005-05-27 13:41:24 jpm Exp $
// $Id: Motcles.php,v 1.3 2005-06-08 18:43:34 jpm Exp $
 
 
/**
15,7 → 15,7
*/
class Text_Wiki_Parse_Motcles extends Text_Wiki_Parse {
var $regex = '/\{\{MotCles mots="(.+?)"\}\}/';
var $regex = '/\{\{MotCles mots="(.+?)"(?: condition="(ET|OU|et|ou)"|)(?: ordre="(ASC|DESC|asc|desc)"|)\}\}/';
/**
*
35,8 → 35,17
function process(&$matches)
{
$options = array(
'mots' => $matches[1]
'mots' => $matches[1],
'condition' => $matches[2],
'ordre' => $matches[3]
);
if (isset($options['condition'])) {
if ($options['condition'] == 'ET' || $options['condition'] == 'et') {
$options['condition'] = 'AND';
} elseif ($options['condition'] == 'OU' || $options['condition'] == 'ou') {
$options['condition'] = 'OR';
}
}
return $this->wiki->addToken($this->rule, $options);
}