You are here

function xbbcode_list_xbbcode in Extensible BBCode 6

Same name and namespace in other branches
  1. 5 xbbcode_list/xbbcode_list.module \xbbcode_list_xbbcode()

File

xbbcode_list/xbbcode_list.module, line 3

Code

function xbbcode_list_xbbcode($op = 'list', $delta = '', $tag = NULL) {
  $sample = <<<LIST
[*] fruit
[**] apples
[**] bananas
[*] animals
[**] cat
[**] dog
LIST;
  $tags['list'] = array(
    'dynamic' => TRUE,
    'description' => t('Formats a list of items in the default style.'),
    'sample' => '[list]' . $sample . '[/list]',
  );
  $tags['ol'] = array(
    'dynamic' => TRUE,
    'description' => t('Formats a numbered list of items.'),
    'sample' => '[ol]' . $sample . '[/ol]',
  );
  $tags['ul'] = array(
    'dynamic' => TRUE,
    'description' => t('Formats a non-numbered list of items.'),
    'sample' => '[ul]' . $sample . '[/ul]',
  );
  switch ($op) {
    case 'list':
      return array_keys($tags);
    case 'info':
      return $tags[$delta];
    case 'render':
      return xbbcode_list_render($delta, $tag->option, $tag->content);
  }
}