Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 344 → Rev 345

/trunk/api/text/wiki_papyrus/Parse/Plan.php
New file
0,0 → 1,51
<?php
// $Id: Plan.php,v 1.1 2005-04-18 16:42:02 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_Plan extends Text_Wiki_Parse {
var $regex = '/\{\{Plan site="((?i:[,-]|\w|\s)+)"(?: permalien="(oui|non)"|)\}\}/';
/**
*
* 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)
{
if ($matches[2] == 'oui') {
$matches[2] = true;
} else {
$matches[2] = false;
}
$options = array(
'site' => $matches[1],
'permalien' => $matches[2]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/trunk/api/text/wiki_papyrus/Parse/Syndication.php
New file
0,0 → 1,45
<?php
// $Id: Syndication.php,v 1.1 2005-04-18 16:42:02 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_Syndication extends Text_Wiki_Parse {
var $regex = '/\{\{Syndication url="((?i:[,:\/.-]|\w|\s)+)"\}\}/';
/**
*
* 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)
{
$options = array(
'url' => $matches[1]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>