* * @package Text_Wiki * */ class Text_Wiki_Parse_Syndication extends Text_Wiki_Parse { var $regex = '/\{\{Syndication titre="([^"]+)" url="([^"]+)"( nb=(?:"|)\d+(?:"|))?( nouvellefenetre=(?:"|)(?:0|1)(?:"|))?( formatdate="[^"]+")?( template="[^"]+")?\}\}/'; /** * * 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 * * @access public * * @param array &$matches The array of matches from parse(). * * @return A delimited token to be used as a placeholder in * the source text, plus any text priot to the match. * */ function process(&$matches) { // 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); } } ?>