You are here

protected function i18n_object_wrapper::path_replace in Internationalization 7

Replace path with placeholders

Parameters

$path: Path to replace

$replacements: Replacement variables to override or add to placeholders

2 calls to i18n_object_wrapper::path_replace()
i18n_object_wrapper::get_edit_path in ./i18n_object.inc
Get edit path for object
i18n_string_object_wrapper::get_translate_path in i18n_string/i18n_string.inc
Get translate path for object

File

./i18n_object.inc, line 218
i18n Object Class

Class

i18n_object_wrapper
Object wrapper

Code

protected function path_replace($path, $replacements = array()) {
  if ($path) {
    $path = strtr($path, $replacements + $this
      ->get_placeholders());

    // Clean up duplicated and final '/' (empty placeholders)
    $path = strtr($path, array(
      '//' => '/',
    ));
    return trim($path, '/');
  }
  else {
    return '';
  }
}