1<?php 2/** 3 * Ordered List element component for the adhoctags plugin 4 * 5 * Defines <ol> ... </ol> syntax 6 * More info: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ol 7 * 8 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 9 * @author Anika Henke <anika@selfthinker.org> 10 * @author Sascha Leib <sascha.leib(at)kolmio.com> 11 */ 12 13class syntax_plugin_adhoctags_ol extends syntax_plugin_adhoctags_abstractblock { 14 15 protected $tag = 'ol'; 16 17 /* allow link attributes: */ 18 function allowAttribute(&$name, &$value) { 19 20 switch ($name) { 21 22 case 'reversed': 23 return in_array($value, array('','reversed')); 24 break; 25 26 case 'start': 27 return (preg_match('/^-?([\d]+)$/', trim($value))); 28 break; 29 30 case 'type': 31 return in_array($value, array('a','A','i','I','1')); 32 break; 33 34 default: 35 return false; 36 } 37 } 38 39 40}