Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
841 ddelon 1
<?php
842 ddelon 2
// $Id: Lien.php,v 1.2 2006-05-10 19:21:47 ddelon Exp $
841 ddelon 3
 
4
 
5
/**
6
*
7
* This class implements a Text_Wiki_Parse to find source text marked as
8
* an Interwiki link.  See the regex for a detailed explanation of the
9
* text matching procedure; e.g., "InterWikiName:PageName".
10
*
11
* @author Paul M. Jones <pmjones@ciaweb.net>
12
*
13
* @package Text_Wiki
14
*
15
*/
16
class Text_Wiki_Parse_Lien extends Text_Wiki_Parse {
17
 
842 ddelon 18
    var $regex = '/\{\{Lien ((?:menu)|(?:site))="((?:\w+)|(?:\d+))" (?:(?:titre)="(.*)")* *\}\}/';
841 ddelon 19
 
20
    /**
21
    *
22
    * Remplace l'action par une liste des dernières pages modifiées
23
    * Les options sont:
24
    *
25
    * 'site' => le code alphanumérique du ou des sites que l'on veut afficher
26
    *
27
    * @access public
28
    *
29
    * @param array &$matches The array of matches from parse().
30
    *
31
    * @return A delimited token to be used as a placeholder in
32
    * the source text, plus any text priot to the match.
33
    *
34
    */
35
    function process(&$matches)
36
    {
842 ddelon 37
    	if (!isset($matches[3])) $matches[3]='';
841 ddelon 38
        $options = array(
39
            'niveau' => $matches[1],
842 ddelon 40
            'identifiant' => $matches[2],
41
            'titre' => $matches[3]
841 ddelon 42
        );
43
 
44
        return $this->wiki->addToken($this->rule, $options);
45
    }
46
 
47
}
48
?>