*/
/**
* This inherits from the table syntax, because it's basically the
* same, just different output
*/
class syntax_plugin_data_list extends syntax_plugin_data_table
{
/**
* Connect pattern to lexer
*/
public function connectTo($mode)
{
$this->Lexer->addSpecialPattern('----+ *datalist(?: [ a-zA-Z0-9_]*)?-+\n.*?\n----+', $mode, 'plugin_data_list');
}
protected $before_item = '
';
protected $after_item = '
';
protected $before_val = '';
protected $after_val = ' ';
/**
* Before value in listitem
*
* @param array $data instructions by handler
* @param int $colno column number
* @return string
*/
protected function beforeVal(&$data, $colno)
{
if ($data['sepbyheaders'] && $colno === 0) {
return $data['headers'][$colno];
} else {
return $this->before_val;
}
}
/**
* After value in listitem
*
* @param array $data
* @param int $colno
* @return string
*/
protected function afterVal(&$data, $colno)
{
if ($data['sepbyheaders']) {
return $data['headers'][$colno + 1];
} else {
return $this->after_val;
}
}
/**
* Create list header
*
* @param array $clist keys of the columns
* @param array $data instruction by handler
* @return string html of table header
*/
public function preList($clist, $data)
{
return '';
}
}