function _hansel_get_original_path in Hansel breadcrumbs 7
Same name and namespace in other branches
- 8 hansel.module \_hansel_get_original_path()
Get the real path when alias is specified.
Parameters
string $path:
Return value
string
2 calls to _hansel_get_original_path()
- hansel_ui_nodetypes_form_submit in hansel_ui/
hansel_ui.module - Form submit callback.
- hansel_ui_nodetypes_form_validate in hansel_ui/
hansel_ui.module - Form validate callback.
File
- ./
hansel.module, line 988 - Hansel module
Code
function _hansel_get_original_path($path) {
if (module_exists('path')) {
$source = db_select('url_alias', 'ua')
->fields('ua', array(
'source',
))
->condition('alias', $path)
->range(0, 1)
->execute()
->fetchField();
if ($source) {
return $source;
}
}
return $path;
}