home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Wiki / Parse / Default / Raw.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.4 KB  |  73 lines

  1. <?php
  2.  
  3. /**
  4. * Parses for text marked as "raw" (i.e., to be rendered as-is).
  5. * @category Text
  6. * @package Text_Wiki
  7. * @author Paul M. Jones <pmjones@php.net>
  8. * @license LGPL
  9. * @version $Id: Raw.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
  10. */
  11.  
  12. /**
  13. * Parses for text marked as "raw" (i.e., to be rendered as-is).
  14. * This class implements a Text_Wiki rule to find sections of the source
  15. * text that are not to be processed by Text_Wiki.  These blocks of "raw"
  16. * text will be rendered as they were found.
  17. *
  18. * @category Text
  19. * @package Text_Wiki
  20. * @author Paul M. Jones <pmjones@php.net>
  21. */
  22.  
  23. class Text_Wiki_Parse_Raw extends Text_Wiki_Parse {
  24.     
  25.     
  26.     /**
  27.     * 
  28.     * The regular expression used to find source text matching this
  29.     * rule.
  30.     * 
  31.     * @access public
  32.     * 
  33.     * @var string
  34.     * 
  35.     */
  36.     
  37.     var $regex = "/``(.*)``/U";
  38.     
  39.     
  40.     /**
  41.     * 
  42.     * Generates a token entry for the matched text.  Token options are:
  43.     * 
  44.     * 'text' => The full matched text.
  45.     * 
  46.     * @access public
  47.     *
  48.     * @param array &$matches The array of matches from parse().
  49.     *
  50.     * @return A delimited token number to be used as a placeholder in
  51.     * the source text.
  52.     *
  53.     */
  54.     
  55.     function process(&$matches)
  56.     {
  57.         $options = array('text' => $matches[1]);
  58.         return $this->wiki->addToken($this->rule, $options);
  59.     }
  60. }
  61. ?>