<?php

class UBB_LIST extends UBB
{
	var $allow1 = array('LIST_MODE');
	var $allow2 = 'ALL';
	
	
	//the $info-var contains some info about the current tag
	var $info = array('Name'=>'List', 'Version'=>'0.5', 'Info'=>'Display a bulleted, alphabetic or numbered list');
	
	var $ext_types = array('LIST_MODE'=>'(1|a|A|i|I|)', 'ALL'=>'(.|\s)*');
	
	function process($value1, $value2)
	{
		//search for all [*]'s, indicating a new item for the list
		$middle = preg_replace('/\[\*\](.+)/i', "\n	<li>\$1</li>", $value2);
		
		//check if the item is a bulleted list (value1 empty) or something else
		if ($value1 == '')
			$ret = "\n<ul>$middle\n</ul>";
		else
			$ret = "\n<ol	type='$value1'>$middle\n</ol>";
				
		return $ret;
	}
}

?>