You are here

function bueditor_path_tr in BUEditor 6

Same name and namespace in other branches
  1. 6.2 bueditor.inc \bueditor_path_tr()
  2. 7 bueditor.inc \bueditor_path_tr()

Translate editor paths

3 calls to bueditor_path_tr()
bueditor_editor_form in ./bueditor.admin.inc
Editor form.
bueditor_editor_theme in ./bueditor.admin.inc
Editor form themed.
bueditor_settle in ./bueditor.module
Include necessary js and css files for editor settlement.

File

./bueditor.module, line 266

Code

function bueditor_path_tr($path) {
  if (!$path) {
    return $path;
  }
  static $tokens;
  if (!isset($tokens)) {
    $tokens = array(
      '%BUEDITOR' => drupal_get_path('module', 'bueditor'),
      '%FILES' => file_directory_path(),
      '%THEME' => path_to_theme(),
    );
  }
  $dir = strtr($path, $tokens);

  //for themes missing icon or library directory, switch to default theme.
  if (!is_dir($dir) && substr($path, 0, 2) == '%T') {
    return str_replace('%THEME', drupal_get_path('theme', variable_get('theme_default', 'garland')), $path);
  }
  return $dir;
}