You are here

function xbbcode_list_admin_settings in Extensible BBCode 6

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

File

xbbcode_list/xbbcode_list.module, line 148

Code

function xbbcode_list_admin_settings($form_state) {
  drupal_add_js(drupal_get_path('module', 'xbbcode_list') . '/xbbcode_list.js');
  $form['xbbcode_list_default'] = array(
    '#type' => 'radios',
    '#title' => t('Default list type'),
    '#description' => t('Choose whether [list] is numbered or non-numbered by default. Users can override the default by using [ul] or [ol].'),
    '#options' => array(
      'ol' => t('Numbered'),
      'ul' => t('Non-numbered'),
    ),
    '#default_value' => variable_get('xbbcode_list_default', 'ul'),
  );
  $form['ol'] = array(
    '#type' => 'fieldset',
    '#title' => t('Ordered list settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Configure how to display lists with numbered items.'),
  );
  $form['ul'] = array(
    '#type' => 'fieldset',
    '#title' => t('Unordered list settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Configure how to display lists with numbered items.'),
  );
  $form['ol']['xbbcode_list_ol_default'] = array(
    '#type' => 'radios',
    '#title' => t('Ordered list default'),
    '#description' => t('Ordered lists will look like this by default. The style can be overridden with [ol=dotted] and [ol=levels]'),
    '#options' => array(
      'sectioned' => t('Sectioned (this works only in a browser with CSS 2.0 support!)'),
      'hierarchy' => t('Hierarchical levels'),
    ),
    '#default_value' => variable_get('xbbcode_list_ol_default', 'hierarchy'),
  );
  $form['ol']['example'] = array(
    '#type' => 'item',
    '#value' => '
<ol id="xbbocde_list_sample_1" class="numeric">
  <li>' . t('Fruit') . '
    <ol id="xbbocde_list_sample_2" class="lower-alpha">
      <li>' . t('Citrus') . '
        <ol id="xbbocde_list_sample_3" class="lower-roman">
          <li>' . t('Lemon') . '</li>
          <li>' . t('Orange') . '</li>
        </ol>
      </li
    </ol>
  </li>
</ol>',
  );
  $form['ol']['xbbcode_list_ol_hierarchy'] = array(
    '#type' => 'textfield',
    '#title' => t('Style hierarchy'),
    '#description' => t('Enter a comma-separated list of styles that will be used by nested lists. Valid styles are: %list. Deeper levels will repeat the lowest level that was defined.', array(
      '%list' => 'upper-roman, lower-roman, numeric, upper-alpha, lower-alpha, none',
    )),
    '#default_value' => variable_get('xbbcode_list_ol_hierarchy', 'numeric, lower-alpha, lower-roman'),
    '#autocomplete_path' => 'admin/settings/xbbcode/lists/autocomplete/ol',
    '#element_validate' => array(
      'xbbcode_list_style_validate',
    ),
  );
  return system_settings_form($form);
}