function freelinking_nid_callback in Freelinking 6.3
Same name and namespace in other branches
- 7.3 plugins/freelinking_nid.inc \freelinking_nid_callback()
1 string reference to 'freelinking_nid_callback'
- freelinking_nid.inc in plugins/
freelinking_nid.inc
File
- plugins/
freelinking_nid.inc, line 19
Code
function freelinking_nid_callback($target, $plugin) {
// resolve $target into a link to the node or display failure
if (is_numeric($target['dest'])) {
$params = array(
'nid' => $target['dest'],
);
if ($node = node_load($params)) {
if (node_access('view', $node)) {
$title = $target['text'] ? $target['text'] : $node->title;
if (!$target['tooltip']) {
$target['tooltip'] = freelinking_internal_tooltip('node', $target['dest']);
}
return array(
check_plain($title),
'node/' . $target['dest'],
array(
'attributes' => array(
'title' => $target['tooltip'],
),
),
);
}
}
}
return array(
'failover' => 'error',
'message' => t('Invalid Node ID "!nid"', array(
'!nid' => $target['dest'],
)),
);
}