Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 334 → Rev 335

/trunk/api/text/wiki_papyrus/Parse/Nouveaute.php
New file
0,0 → 1,47
<?php
// $Id: Nouveaute.php,v 1.1 2005-04-14 16:35:36 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* an Interwiki link. See the regex for a detailed explanation of the
* text matching procedure; e.g., "InterWikiName:PageName".
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
class Text_Wiki_Parse_Nouveaute extends Text_Wiki_Parse {
var $regex = '/\{\{Nouveaute nombre="([1-9][0-9]*)"(?: type="(mineure|majeure)"|)(?: site="((?i:[,-]|\w|\s)+)"|)\}\}/';
/**
*
* Remplace l'action par une liste des dernières pages modifiées
* Les options sont:
*
* 'nombre' => le nombre de dernière page modifiée 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)
{
$options = array(
'nombre' => $matches[1],
'type' => $matches[2],
'site' => $matches[3]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/trunk/api/text/wiki_papyrus/Parse/Categorie.php
New file
0,0 → 1,45
<?php
// $Id: Categorie.php,v 1.1 2005-04-14 16:35:36 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* an Interwiki link. See the regex for a detailed explanation of the
* text matching procedure; e.g., "InterWikiName:PageName".
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
class Text_Wiki_Parse_Categorie extends Text_Wiki_Parse {
var $regex = '/\{\{Categorie mots="((?i:[,-]|\w|\s)+)"\}\}/';
/**
*
* Remplace l'action par une liste des pages contenant les mots clés choisis
* Les options sont:
*
* 'mots' => les mots clés séparés par des virgules
*
* @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)
{
$options = array(
'mots' => $matches[1]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/trunk/api/text/wiki_papyrus/Parse/Motcles.php
New file
0,0 → 1,45
<?php
// $Id: Motcles.php,v 1.1 2005-04-14 16:35:36 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* an Interwiki link. See the regex for a detailed explanation of the
* text matching procedure; e.g., "InterWikiName:PageName".
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
class Text_Wiki_Parse_Motcles extends Text_Wiki_Parse {
var $regex = '/\{\{MotCles mots="((?i:[,-]|\w|\s)+)"\}\}/';
/**
*
* Remplace l'action par une liste des pages contenant les mots clés choisis
* Les options sont:
*
* 'mots' => les mots clés séparés par des virgules
*
* @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)
{
$options = array(
'mots' => $matches[1]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>