root/bbcode.tex/files/lib/data/message/bbcode/TexBBCode.class.php @ 65

Revision 65, 0.8 kB (checked in by d0nut, 6 years ago)

mimetex integration

  • Property svn:executable set to *
Line 
1<?php
2require_once(WCF_DIR.'lib/data/message/bbcode/BBCodeParser.class.php');
3require_once(WCF_DIR.'lib/data/message/bbcode/BBCode.class.php');
4
5/**
6 * BBCode for [tex] Tag
7 *
8 * @author      Torben Brodt
9 * @package     com.woltlab.wcf.data.message.bbcode.tex
10 * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 */
12class TexBBCode implements BBCode {
13        /**
14         * @see BBCode::getParsedTag()
15         */
16        public function getParsedTag($openingTag, $content, $closingTag, BBCodeParser $parser) {
17                if ($parser->getOutputType() == 'text/html') {
18                        return '<img src="'.MESSAGE_BBCODE_TEX_CGIBIN.'/mimetex.cgi?'.rawurlencode($content).'" alt="" />';
19                }
20                else if ($parser->getOutputType() == 'text/plain') {
21                        return $content;
22                }
23        }
24}
25?>
Note: See TracBrowser for help on using the browser.