You are here

function activeedit_footer in Javascript Tools 5

Implementation of hook_footer().

Because we're loading theme data, we call this function in hook_footer to ensure we're not prematurely initializing the theme.

File

activeedit/activeedit.module, line 52

Code

function activeedit_footer() {
  static $loaded = FALSE;
  if (!$loaded && user_access('edit via ajax')) {
    $path = drupal_get_path('module', 'activeedit');
    $activeedit = array();
    foreach (array_keys(activeedit_types()) as $type) {
      $activeedit[$type] = activeedit_get_targets($type, TRUE);
    }
    drupal_add_js(array(
      'activeedit' => $activeedit,
    ), 'setting');
    drupal_add_js('misc/progress.js');
    jstools_add_js($path . '/activeedit.js');

    // Add autocomplete to the footer to ensure it overrides core's version.
    drupal_add_js($path . '/autocomplete.js', 'module', 'footer');
    drupal_add_css($path . '/activeedit.css');
    $loaded = TRUE;
  }
}