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

Source for file List.php

Documentation is available at List.php

  1. <?php
  2.  
  3. class Text_Wiki_Render_CoWiki_List extends Text_Wiki_Render {
  4.     
  5.     /**
  6.     * 
  7.     * Renders a token into text matching the requested format.
  8.     * 
  9.     * This rendering method is syntactically and semantically compliant
  10.     * with XHTML 1.1 in that sub-lists are part of the previous list item.
  11.     * 
  12.     * @access public
  13.     * 
  14.     * @param array $options The "options" portion of the token (second
  15.     *  element).
  16.     * 
  17.     * @return string The text rendered from the token options.
  18.     * 
  19.     */
  20.     
  21.     function token($options)
  22.     {
  23.         // make nice variables (type, level, count)
  24.         
  25.         $pad str_pad(''$options['level'- 1' ');
  26.                 
  27.         switch ($options['type']{
  28.         
  29.         case 'bullet_list_start':
  30.         case 'number_list_start':
  31.             if ($options['level'== 0{
  32.                 //return "\n";
  33.             }
  34.             break;
  35.         case 'bullet_list_end':
  36.         case 'number_list_end':
  37.         
  38.             if ($options['level'== 0{
  39.                 //return "\n";
  40.             }
  41.             break;
  42.         case 'bullet_item_start':
  43.             return "\n".$pad.'* ';
  44.             break;
  45.         case 'number_item_start':
  46.             return "\n".$pad.'# ';
  47.             break;
  48.         case 'bullet_item_end':
  49.         case 'number_item_end':
  50.         default:
  51.             return '';
  52.             break;
  53.         }
  54.     }
  55. }
  56. ?>

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