[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/bundled-libs/Text/Wiki/Render/Latex/ -> Colortext.php (source)

   1  <?php
   2  
   3  class Text_Wiki_Render_Latex_Colortext extends Text_Wiki_Render {
   4      
   5      var $colors = array(
   6          'aqua',
   7          'black',
   8          'blue',
   9          'fuchsia',
  10          'gray',
  11          'green',
  12          'lime',
  13          'maroon',
  14          'navy',
  15          'olive',
  16          'purple',
  17          'red',
  18          'silver',
  19          'teal',
  20          'white',
  21          'yellow'
  22      );
  23      
  24      
  25      /**
  26      * 
  27      * Renders a token into text matching the requested format.
  28      * 
  29      * @access public
  30      * 
  31      * @param array $options The "options" portion of the token (second
  32      * element).
  33      * 
  34      * @return string The text rendered from the token options.
  35      * 
  36      */
  37      
  38      function token($options)
  39      {
  40          return 'Colortext: NI';
  41          
  42          $type = $options['type'];
  43          $color = $options['color'];
  44          
  45          if (! in_array($color, $this->colors)) {
  46              $color = '#' . $color;
  47          }
  48          
  49          if ($type == 'start') {
  50              return "<span style=\"color: $color;\">";
  51          }
  52          
  53          if ($options['type'] == 'end') {
  54              return '</span>';
  55          }
  56      }
  57  }
  58  ?>


Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics