You are here

function bueditor_js_buttons in BUEditor 5

Include buttons in a js file to support browser caching. if fails include them inline.

1 call to bueditor_js_buttons()
bueditor_settle in ./bueditor.module
Include necessary js and css files for editor settlement.

File

./bueditor.module, line 520

Code

function bueditor_js_buttons($dir, $buttons) {
  $str = 'editor.path="' . base_path() . $dir . '/";editor.buttons=' . drupal_to_js($buttons);
  if (variable_get('file_downloads', '') != FILE_DOWNLOADS_PRIVATE) {
    $file = file_directory_path() . '/bueditor/' . md5($str) . '.js';
    if (file_exists($file) || arg(0) != 'admin' && bueditor_save_data($str, $file)) {
      drupal_add_js($file);
      return $file;
    }
  }
  drupal_add_js($str, 'inline');
}