[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/wiki/parse/ -> main.php (source)

   1  <?php
   2  // $Id: main.php 19415 2005-10-14 14:08:53Z ralfbecker $
   3  
   4  // Master parser for 'Tavi.
   5  function parseText($text, $parsers, $object_name)
   6  {
   7      global $Entity, $ParseObject;
   8  
   9      $old_parse_object = $ParseObject;
  10      $ParseObject = $object_name;          // So parsers know what they're parsing.
  11  
  12      $count  = count($parsers);
  13      $result = '';
  14  
  15      // Run each parse element in turn on each line of text.
  16  
  17      foreach(explode("\n", $text) as $line)
  18      {
  19          $line = $line . "\n";
  20          for($i = 0; $i < $count; $i++)
  21              { $line = $parsers[$i]($line); }
  22  
  23          $result = $result . $line;
  24      }
  25  
  26      // Some stateful parsers need to perform final processing.
  27  
  28      $line = '';
  29      for($i = 0; $i < $count; $i++)
  30          { $line = $parsers[$i]($line); }
  31  
  32      $ParseObject = $old_parse_object;
  33  
  34      return $result . $line;
  35  }
  36  
  37  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7