You are here

function ace_editor_get_modes in Ace Code Editor 7

Returns all of the modes.

4 calls to ace_editor_get_modes()
ace_editor_field_formatter_settings_summary in ./ace_editor.module
Implements hook_field_formatter_settings_summary().
ace_editor_node_block_edit_form_attach_js in ./ace_editor.module
Add JS to the page containing the affected forms.
ace_editor_settings_form in ./ace_editor.admin.inc
Implements hook_form().
get_setting_form_elements in ./ace_editor.module
Field formatter settings form.

File

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

Code

function ace_editor_get_modes() {

  // Available modeses are loaded on installation.
  $assets = variable_get('ace_editor_assets', array(
    'mode' => array(
      'html' => 'HTML',
    ),
  ));
  asort($assets['mode']);
  $modes = array_merge($assets['mode'], array(
    // Translate some most used languages to their common name.
    'c_cpp' => 'C/C++',
    'coffee' => 'CoffeeScript',
    'csharp' => 'C#',
    'css' => 'CSS',
    'html' => 'HTML',
    'json' => 'JSON',
    'less' => 'LESS',
    'php' => 'PHP',
    'scss' => 'SCSS',
    'xml' => 'XML',
    'yaml' => 'YAML',
  ));
  return $modes;
}