Text_Wiki_Doku
[ class tree: Text_Wiki_Doku ] [ index: Text_Wiki_Doku ] [ all elements ]

Source for file Colortext.php

Documentation is available at Colortext.php

  1. <?php
  2. //no similar in Doku, using <html>
  3. class Text_Wiki_Render_Doku_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.     * Renders a token into text matching the requested format.
  27.     * 
  28.     * @access public
  29.     * 
  30.     * @param array $options The "options" portion of the token (second
  31.     *  element).
  32.     * 
  33.     * @return string The text rendered from the token options.
  34.     * 
  35.     */
  36.     
  37.     function token($options)
  38.     {
  39.         if (!in_array($options['color']$this->colors)) {
  40.             $options['color''#' $options['color'];
  41.         }
  42.         
  43.         if ($options['type'== 'start'{
  44.             return '<html><span style="color: '.$options['color'].';"></html>';
  45.         }
  46.         
  47.         if ($options['type'== 'end'{
  48.             return '<html></span></html>';
  49.         }
  50.     }
  51. }
  52. ?>

Documentation generated on Mon, 11 Mar 2019 14:12:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.