You are here

protected function i18n_field_base::get_base_path in Internationalization 7

Get base path for object

4 calls to i18n_field_base::get_base_path()
i18n_field::get_edit_path in i18n_field/i18n_field.inc
Get edit path for object
i18n_field::get_translate_path in i18n_field/i18n_field.inc
Get translate path for object
i18n_field_instance::get_edit_path in i18n_field/i18n_field.inc
Get edit path for object
i18n_field_instance::get_translate_path in i18n_field/i18n_field.inc
Get translate path for object

File

i18n_field/i18n_field.inc, line 14
Field and field instance object handlers

Class

i18n_field_base
Base object for field and field instance

Code

protected function get_base_path() {
  $info = entity_get_info($this->object['entity_type']);
  if (isset($info['bundles'][$this->object['bundle']]['admin'])) {
    $admin = $info['bundles'][$this->object['bundle']]['admin'];

    // Extract path information from the bundle.
    if (isset($admin['real path'])) {
      return $admin['real path'] . '/fields/' . $this->object['field_name'];
    }
    else {

      // We don't have real path, use path instead, may work or not.
      return $admin['path'] . '/fields/' . $this->object['field_name'];
    }
  }
}