You are here

function ace_editor_get_assets in Ace Code Editor 7

Fills the global var 'ace_editor_assets'.

3 calls to ace_editor_get_assets()
ace_editor_init in ./ace_editor.module
Implements hook_init().
ace_editor_install in ./ace_editor.install
Implements hook_install().
drush_ace_editor_post_pm_enable in ./ace_editor.drush.inc
Implements drush_MODULE_post_COMMAND().

File

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

Code

function ace_editor_get_assets() {

  // Find out available themes and modes in the library.
  $libraries = libraries_get_libraries();
  if (isset($libraries['ace'])) {
    $files = file_scan_directory($libraries['ace'] . '/src', '/(mode|theme)-(.+)\\.js$/', array(
      'recurse' => FALSE,
    ));
    $assets = array();
    foreach ($files as $file_info) {
      $asset = explode('-', $file_info->name);
      $assets[$asset[0]][$asset[1]] = ucwords(str_replace('_', ' ', $asset[1]));
    }
    if (!empty($assets)) {
      variable_set('ace_editor_assets', $assets);
    }
  }
}