1,5 → 1,5 |
<?php |
// $Id: Syndication.php,v 1.6 2006-09-13 09:56:02 alexandre_tb Exp $ |
// $Id: Syndication.php,v 1.7 2006-11-21 13:35:19 jp_milcent Exp $ |
|
|
/** |
15,11 → 15,11 |
*/ |
class Text_Wiki_Parse_Syndication extends Text_Wiki_Parse { |
|
var $regex = '/\{\{Syndication titre="(.+?)" url="(.+?)" nb=(.+?) nouvellefenetre=(.+?) formatdate="(.+?)"( template="(.+?)")?\}\}/'; |
var $regex = '/\{\{Syndication titre="([^"]+)" url="([^"]+)"( nb=(?:"|)\d+(?:"|))?( nouvellefenetre=(?:"|)(?:0|1)(?:"|))?( formatdate="[^"]+")?( template="[^"]+")?\}\}/'; |
|
/** |
* |
* Remplace l'action par une liste des dernières pages modifiées |
* Remplace l'action par une liste des dernières pages modifièes |
* Les options sont: |
* |
* 'site' => le code alphanumérique du ou des sites que l'on veut afficher |
34,10 → 34,16 |
*/ |
function process(&$matches) |
{ |
$options = array( |
'titre' => $matches[1], 'url' => $matches[2], 'nb' => $matches[3], 'nouvellefenetre' => $matches[4], 'formatdate' => $matches[5], |
); |
if (isset ($matches['7']) && $matches['7'] != "") $options['template'] = $matches[7]; |
// Gestion des paramêtres obligatoires |
$options = array('titre' => $matches[1], 'url' => $matches[2]); |
|
// Gestion des paramêtres optionnels |
$tab_param_optionel = array('nb', 'nouvellefenetre', 'formatdate', 'template'); |
for ($i = 3; $i < count($matches); $i++) { |
$tab_param = explode('=', $matches[$i]); |
$options[trim($tab_param[0])] = str_replace('"', '', $tab_param[1]); |
} |
|
return $this->wiki->addToken($this->rule, $options); |
} |
|