* * @package Text_Wiki * */ class Text_Wiki_Parse_Inclure extends Text_Wiki_Parse { var $regex = '/\{\{inclure page="([A-Za-z0-9_]+)"(?: interwiki="([A-Za-z0-9_]+)"|)\}\}/'; /** * * Generates a replacement for the matched standalone interwiki text. * Token options are: * * 'site' => The key name for the Text_Wiki interwiki array map, * usually the name of the interwiki site. * * 'page' => The page on the target interwiki to link to. * * 'text' => The text to display as the link. * * @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( 'page' => $matches[1], 'site' => $matches[2], 'text' => $matches[0] ); return $this->wiki->addToken($this->rule, $options); } } ?>