function bueditor_path_tr in BUEditor 6.2
Same name and namespace in other branches
- 6 bueditor.module \bueditor_path_tr()
- 7 bueditor.inc \bueditor_path_tr()
Translate editor paths.
7 calls to bueditor_path_tr()
- bueditor_editor_theme in admin/
bueditor.admin.inc - Editor form theming.
- bueditor_get_library in ./
bueditor.inc - Get an array of js and css files defined in editor library.
- bueditor_save_import in admin/
bueditor.admin.inc - Save imported editor data. Save icons and library files into specified editor path.
- bueditor_sprite_buttons in admin/
bueditor.sprite.inc - Create an icon sprite for a set of buttons.
- bueditor_update_6200 in ./
bueditor.install - 6.x-1.x to 6.x-2.x Change {bueditor_editors}.librarypath field type from varchar to text. It now stores file paths rather than a directory path.
File
- ./
bueditor.inc, line 244 - Implements commonly used functions for bueditor.
Code
function bueditor_path_tr($path, $reverse = FALSE) {
if (!$path) {
return $path;
}
static $tokens;
if (!isset($tokens)) {
$tokens = array(
'%BUEDITOR' => drupal_get_path('module', 'bueditor'),
'%FILES' => file_directory_path(),
'%THEME' => isset($GLOBALS['theme']) ? drupal_get_path('theme', $GLOBALS['theme']) : path_to_theme(),
);
}
if ($reverse) {
return strtr($path, array_flip($tokens));
}
$trpath = strtr($path, $tokens);
//for themes missing icon or library directory, switch to default theme.
if (!file_exists($trpath) && substr($path, 0, 6) == '%THEME') {
$trpath = str_replace('%THEME', drupal_get_path('theme', variable_get('theme_default', 'garland')), $path);
}
return $trpath;
}