You are here

function get_setting_form_elements in Ace Code Editor 7

Field formatter settings form.

2 calls to get_setting_form_elements()
ace_editor_field_formatter_settings_form in ./ace_editor.module
Implements hook_field_formatter_settings_form().
ace_editor_filter_settings in ./ace_editor.module
Returns the settings form for the text filter.

File

./ace_editor.module, line 386
Ace Editor module.

Code

function get_setting_form_elements($settings) {
  return array(
    'theme' => array(
      '#type' => 'select',
      '#title' => t('Theme'),
      '#options' => ace_editor_get_themes(),
      '#default_value' => $settings['theme'],
      '#attributes' => array(
        'style' => 'width: 150px;',
      ),
    ),
    'syntax' => array(
      '#type' => 'select',
      '#title' => t('Syntax'),
      '#description' => t('The syntax that will be highlighted.'),
      '#options' => ace_editor_get_modes(),
      '#default_value' => $settings['syntax'],
      '#attributes' => array(
        'style' => 'width: 150px;',
      ),
    ),
    'height' => array(
      '#type' => 'textfield',
      '#title' => t('Height'),
      '#description' => t('The height of the editor in either pixels or percents.
        You can use "auto" to let the editor calculate the adequate height.'),
      '#default_value' => $settings['height'],
      '#attributes' => array(
        'style' => 'width: 100px;',
      ),
    ),
    'width' => array(
      '#type' => 'textfield',
      '#title' => t('Width'),
      '#description' => t('The width of the editor in either pixels or percents.'),
      '#default_value' => $settings['width'],
      '#attributes' => array(
        'style' => 'width: 100px;',
      ),
    ),
    'font-size' => array(
      '#type' => 'textfield',
      '#title' => t('Font size'),
      '#description' => t('The the font size of the editor.'),
      '#default_value' => $settings['font-size'],
      '#attributes' => array(
        'style' => 'width: 100px;',
      ),
    ),
    // Wrapmode breaks the read-only editor if activated.
    // 'autowrap' => array(
    // '#type' => 'checkbox',
    // '#title' => t('Autowrap lines'),
    // '#default_value' => $settings['autowrap'],
    // ),
    'linehighlighting' => array(
      '#type' => 'checkbox',
      '#title' => t('Line highlighting'),
      '#default_value' => $settings['linehighlighting'],
    ),
    'line-numbers' => array(
      '#type' => 'checkbox',
      '#title' => t('Show line numbers'),
      '#default_value' => $settings['line-numbers'],
    ),
  );
}