equal
deleted
inserted
replaced
1 <?php |
|
2 // vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: |
|
3 /** |
|
4 * Anchor 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: Anchor.php,v 1.10 2006/02/10 23:07:03 toggg Exp $ |
|
13 * @link http://pear.php.net/package/Text_Wiki |
|
14 */ |
|
15 |
|
16 /** |
|
17 * This class renders an anchor target name 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_Anchor extends Text_Wiki_Render { |
|
27 |
|
28 var $conf = array( |
|
29 'css' => null |
|
30 ); |
|
31 |
|
32 function token($options) |
|
33 { |
|
34 extract($options); // $type, $name |
|
35 |
|
36 if ($type == 'start') { |
|
37 $css = $this->formatConf(' class="%s"', 'css'); |
|
38 $format = "<a$css id=\"%s\">"; |
|
39 return sprintf($format, $this->textEncode($name)); |
|
40 } |
|
41 |
|
42 if ($type == 'end') { |
|
43 return '</a>'; |
|
44 } |
|
45 } |
|
46 } |
|
47 |
|
48 ?> |
|