includes/wikiengine/Render/Xhtml/Deflist.php
changeset 1027 98c052fc3337
parent 1026 f0431eb8161e
child 1028 dde4416dea00
equal deleted inserted replaced
1026:f0431eb8161e 1027:98c052fc3337
     1 <?php
       
     2 // vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
       
     3 /**
       
     4  * Deflist rule end renderer for Xhtml
       
     5  *
       
     6  * PHP versions 4 and 5
       
     7  *
       
     8  * @category   Text
       
     9  * @package    Text_Wiki
       
    10  * @author     Paul M. Jones <pmjones@php.net>
       
    11  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
       
    12  * @version    CVS: $Id: Deflist.php,v 1.8 2005/07/30 08:03:28 toggg Exp $
       
    13  * @link       http://pear.php.net/package/Text_Wiki
       
    14  */
       
    15 
       
    16 /**
       
    17  * This class renders definition lists in XHTML.
       
    18  *
       
    19  * @category   Text
       
    20  * @package    Text_Wiki
       
    21  * @author     Paul M. Jones <pmjones@php.net>
       
    22  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
       
    23  * @version    Release: @package_version@
       
    24  * @link       http://pear.php.net/package/Text_Wiki
       
    25  */
       
    26 class Text_Wiki_Render_Xhtml_Deflist extends Text_Wiki_Render {
       
    27 
       
    28     var $conf = array(
       
    29         'css_dl' => null,
       
    30         'css_dt' => null,
       
    31         'css_dd' => null
       
    32     );
       
    33 
       
    34     /**
       
    35     *
       
    36     * Renders a token into text matching the requested format.
       
    37     *
       
    38     * @access public
       
    39     *
       
    40     * @param array $options The "options" portion of the token (second
       
    41     * element).
       
    42     *
       
    43     * @return string The text rendered from the token options.
       
    44     *
       
    45     */
       
    46 
       
    47     function token($options)
       
    48     {
       
    49         $type = $options['type'];
       
    50         $pad = "    ";
       
    51 
       
    52         switch ($type) {
       
    53 
       
    54         case 'list_start':
       
    55             $css = $this->formatConf(' class="%s"', 'css_dl');
       
    56             return "<dl$css>\n";
       
    57             break;
       
    58 
       
    59         case 'list_end':
       
    60             return "</dl>\n\n";
       
    61             break;
       
    62 
       
    63         case 'term_start':
       
    64             $css = $this->formatConf(' class="%s"', 'css_dt');
       
    65             return $pad . "<dt$css>";
       
    66             break;
       
    67 
       
    68         case 'term_end':
       
    69             return "</dt>\n";
       
    70             break;
       
    71 
       
    72         case 'narr_start':
       
    73             $css = $this->formatConf(' class="%s"', 'css_dd');
       
    74             return $pad . $pad . "<dd$css>";
       
    75             break;
       
    76 
       
    77         case 'narr_end':
       
    78             return "</dd>\n";
       
    79             break;
       
    80 
       
    81         default:
       
    82             return '';
       
    83 
       
    84         }
       
    85     }
       
    86 }
       
    87 ?>