| 1 | <?php |
| 2 | |
| 3 | class Text_Wiki_Render_Xhtml_Blockquote extends Text_Wiki_Render { |
| 4 | |
| 5 | var $conf = array( |
| 6 | 'css' => null |
| 7 | ); |
| 8 | |
| 9 | /** |
| 10 | * |
| 11 | * Renders a token into text matching the requested format. |
| 12 | * |
| 13 | * @access public |
| 14 | * |
| 15 | * @param array $options The "options" portion of the token (second |
| 16 | * element). |
| 17 | * |
| 18 | * @return string The text rendered from the token options. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | function token($options) |
| 23 | { |
| 24 | $type = $options['type']; |
| 25 | $level = $options['level']; |
| 26 | |
| 27 | // set up indenting so that the results look nice; we do this |
| 28 | // in two steps to avoid str_pad mathematics. ;-) |
| 29 | $pad = str_pad('', $level, "\t"); |
| 30 | $pad = str_replace("\t", ' ', $pad); |
| 31 | |
| 32 | // pick the css type |
| 33 | $css = $this->formatConf(' class="%s"', 'css'); |
| 34 | |
| 35 | // starting |
| 36 | if ($type == 'start') { |
| 37 | return "$pad<blockquote$css>"; |
| 38 | } |
| 39 | |
| 40 | // ending |
| 41 | if ($type == 'end') { |
| 42 | return $pad . "</blockquote>\n"; |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | ?> |