You are here

function bueditor_settle in BUEditor 6

Same name and namespace in other branches
  1. 5 bueditor.module \bueditor_settle()
  2. 6.2 bueditor.module \bueditor_settle()
  3. 7 bueditor.module \bueditor_settle()

Include necessary js and css files for editor settlement.

2 calls to bueditor_settle()
bueditor_editor_theme in ./bueditor.admin.inc
Editor form themed.
bueditor_preset_textarea in ./bueditor.module
Insert textarea id into preset of the editor.

File

./bueditor.module, line 166

Code

function bueditor_settle($editor) {
  static $settled = array();
  if (is_numeric($editor)) {
    $editor = bueditor_editors($editor);
  }
  if ($editor && $editor->eid && !isset($settled[$editor->eid])) {
    $path = drupal_get_path('module', 'bueditor');
    $editor->librarypath = bueditor_path_tr($editor->librarypath);
    $editor->iconpath = bueditor_path_tr($editor->iconpath);
    drupal_add_css($path . '/bueditor.css');
    drupal_add_js($path . '/bueditor.js');
    bueditor_js_library($editor->librarypath);

    //load library files.
    $settings['BUE']['templates']['e' . $editor->eid] = array(
      'iconpath' => base_path() . $editor->iconpath,
      'buttons' => bueditor_processed_buttons($editor->eid),
    );
    drupal_add_js($settings, 'setting');
    $settled[$editor->eid] = TRUE;
    return TRUE;
  }
  return FALSE;
}