You are here

function xbbcode_list_style_validate in Extensible BBCode 6

Same name and namespace in other branches
  1. 8 xbbcode_list/xbbcode_list.module \xbbcode_list_style_validate()
  2. 7 xbbcode_list/xbbcode_list.module \xbbcode_list_style_validate()
1 string reference to 'xbbcode_list_style_validate'
xbbcode_list_admin_settings in xbbcode_list/xbbcode_list.module

File

xbbcode_list/xbbcode_list.module, line 216

Code

function xbbcode_list_style_validate($element) {
  $valid_styles = array(
    'upper-alpha',
    'lower-alpha',
    'upper-roman',
    'lower-roman',
    'numeric',
  );
  $types = preg_split('/ *, */', $element['#value']);
  foreach ($types as $type) {
    if (!in_array($type, $valid_styles)) {
      form_error($element, t('%type is not a valid style.', array(
        '%type' => $type,
      )));
    }
  }
}