function finder_path in Finder 7.2
Get the raw link to an object given the table and id.
Parameters
$table: Base table for this type of object.
$id: The value of the primary key for this record.
Return value
A raw path that can be put into url() or l() that can be used to link to or redirect to the object.
2 calls to finder_path()
- finder::go in includes/
finder.inc - Finder go.
- theme_finder_results in includes/
theme.inc - Theme the finder results.
File
- includes/
build.inc, line 22 - The finder build functions.
Code
function finder_path($table, $id) {
switch ($table) {
case 'node':
$path = 'node/' . $id;
break;
case 'users':
$path = 'user/' . $id;
break;
case 'taxonomy_term_data':
$path = 'taxonomy/term/' . $id;
break;
case 'node_revisions':
$revision = node_load(NULL, $id);
$path = 'node/' . $revision->nid . '/revisions/' . $id . '/view';
break;
case 'files':
$path = file_load($id)->uri;
break;
}
drupal_alter('finder_path', $path, $table, $id);
return $path;
}