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

Source for file Table.php

Documentation is available at Table.php

  1. <?php
  2.  
  3. class Text_Wiki_Render_Tiki_Table extends Text_Wiki_Render {
  4.     
  5.     /**
  6.     * 
  7.     * Renders a token into text matching the requested format.
  8.     * 
  9.     * @access public
  10.     * 
  11.     * @param array $options The "options" portion of the token (second
  12.     *  element).
  13.     * 
  14.     * @return string The text rendered from the token options.
  15.     * 
  16.     */
  17.     
  18.     function token($options)
  19.     {
  20.         static $last '';
  21.  
  22.         // make nice variable names (type, attr, span)
  23.         $pad '    ';
  24.         
  25.         switch ($options['type']{
  26.         
  27.         case 'table_start':
  28.             $output '||';
  29.             break;
  30.         
  31.         case 'table_end':
  32.             $output '||';
  33.             break;
  34.         
  35.         case 'row_start':
  36.             if ($last == 'table_start'{
  37.                 $output '';
  38.             else {
  39.                 $output "\n";
  40.             }
  41.             break;
  42.         
  43.         case 'row_end':
  44.             $output '';
  45.             break;
  46.         
  47.         case 'cell_start':
  48.             if ($last == 'cell_end'{
  49.                 $output ' | ';
  50.             else {
  51.                 $output '';
  52.             }
  53.             break;
  54.         
  55.         case 'cell_end':
  56.             if ($options['span'> 1{
  57.                 $output str_pad(''($options['span'- 1* 3' | ');
  58.             else {
  59.                 $output '';
  60.             }
  61.             break;
  62.         
  63.         default:
  64.             return '';
  65.         
  66.         }
  67.         $last $options['type'];
  68.         return $output;
  69.     }
  70. }
  71. ?>

Documentation generated on Mon, 11 Mar 2019 15:32:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.