You are here

function xbbcode_basic_render_list in Extensible BBCode 5

Same name and namespace in other branches
  1. 8 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_list()
  2. 8.2 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_list()
  3. 6 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_list()
  4. 7 xbbcode_basic/xbbcode_basic.module \xbbcode_basic_render_list()
1 call to xbbcode_basic_render_list()
xbbcode_basic_render in xbbcode_basic/xbbcode_basic.module

File

xbbcode_basic/xbbcode_basic.module, line 248

Code

function xbbcode_basic_render_list($text, $type) {
  $text = explode("[*]", $text);
  unset($text[0]);
  $text = '<li>' . implode("</li><li>", $text) . '</li>';
  switch ($type) {
    case 'ol':
      return "<ol>{$text}</ol>";
    case 'ul':
    default:
      return "<ul>{$text}</ul>";
  }
}