1<?php
2/**
3 * Math Operator component for the Ad Hoc MathML plugin
4 *
5 * Defines  <mo> ... </mo> syntax
6 * More info: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
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_mo extends syntax_plugin_adhocmathml_abstract {
13
14	protected $tag = 'mo';
15
16	/* allow link attributes: */
17	function allowSpecificAttribute(&$name, &$value) {
18		//dbg('MathML: <mo> - allowSpecificAttribute(' . $name . ', "' . $value . '")');
19
20		switch (trim($name)) {
21
22			case 'fence':
23			case 'largeop':
24			case 'movablelimits':
25			case 'separator':
26			case 'stretchy':
27			case 'symmetric':
28				return in_array(strtolower($value), array('true','false'));
29				break;
30
31			case 'lspace':
32			case 'maxsize':
33			case 'minsize':
34			case 'rspace':  /* length-percentages */
35				return preg_match('/^[\w\d\%]+$/', trim($value));
36				break;
37
38			default:
39				return false;
40		}
41	}
42
43
44    /**
45     * ODT Renderer Functions
46     */
47    function renderODTElementOpen($renderer, $HTMLelement, $data) {
48		//$renderer->table_open();
49    }
50    function renderODTElementClose($renderer, $element) {
51		//$renderer->table_close();
52    }
53}