1<?php
2/**
3 * Form component for the Ad Hoc MathML plugin
4 *
5 * Defines  <math> ... </math> syntax
6 * More info: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math
7 *
8 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
9 * @author     Sascha Leib <sascha.leib(at)kolmio.com>
10 */
11
12class syntax_plugin_adhocmathml_math extends syntax_plugin_adhocmathml_abstract {
13
14	protected $tag = 'math';
15
16	/* allow link attributes: */
17	protected function allowSpecificAttribute(&$name, &$value) {
18		//dbg('MathML: <math> - allowSpecificAttribute(' . $name . ', "' . $value . '")');
19
20		switch (trim($name)) {
21
22			case 'display':
23				return in_array(strtolower($value), array('block','inline'));
24				break;
25
26			case 'alttext':
27				return true;
28				break;
29
30			case 'xmlns':
31				return (trim($value) == 'http://www.w3.org/1998/Math/MathML');
32				break;
33
34			default:
35				return false;
36		}
37	}
38    /**
39     * ODT Renderer Functions
40     */
41    function renderODTElementOpen($renderer, $HTMLelement, $data) {
42		//$renderer->table_open();
43    }
44    function renderODTElementClose($renderer, $element) {
45		//$renderer->table_close();
46    }
47}