1<?php
2/**
3 * Math Padding element for the Ad-Hoc MathML plugin
4 *
5 * Defines  <mpadded> ... </mpadded> syntax
6 * More info: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mpadded
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_mpadded extends syntax_plugin_adhocmathml_abstract {
13
14	protected $tag = 'mpadded';
15
16	/* allow link attributes: */
17	function allowSpecificAttribute(&$name, &$value) {
18		//dbg('MathML: <mpadded> - allowSpecificAttribute(' . $name . ', "' . $value . '")');
19
20		switch (trim($name)) {
21
22			case 'width':
23			case 'height':
24			case 'depth':
25			case 'lspace':
26			case 'voffset':  /* length-percentages */
27				return preg_match('/^[\w\d\%]+$/', trim($value));
28				break;
29
30			default:
31				return false;
32		}
33	}
34
35    /**
36     * ODT Renderer Functions
37     */
38    function renderODTElementOpen($renderer, $HTMLelement, $data) {
39		//$renderer->table_open();
40    }
41    function renderODTElementClose($renderer, $element) {
42		//$renderer->table_close();
43    }
44}