| 78 |
$target = freelinking_parse_target($target); |
$target = freelinking_parse_target($target); |
| 79 |
$link = _freelinking_build_freelink($freelinking, $current_plugin, |
$link = _freelinking_build_freelink($freelinking, $current_plugin, |
| 80 |
$target); |
$target); |
| 81 |
$text = str_replace($match[0], $link, $text); |
if ($link) { |
| 82 |
|
$text = str_replace($match[0], $link, $text); |
| 83 |
|
} |
| 84 |
} |
} |
| 85 |
return $text; |
return $text; |
| 86 |
case 'prepare': |
case 'prepare': |
| 137 |
$link = call_user_func_array($plugin['callback'], |
$link = call_user_func_array($plugin['callback'], |
| 138 |
array($target)); |
array($target)); |
| 139 |
} |
} |
| 140 |
|
|
| 141 |
|
// if the plugin returns FALSE, do not replace the match |
| 142 |
|
if (!$link) { |
| 143 |
|
return FALSE; |
| 144 |
|
} |
| 145 |
|
|
| 146 |
// Standardize link, grab authoritative "structured" version |
// Standardize link, grab authoritative "structured" version |
| 147 |
// designate the rendered text for display |
// designate the rendered text for display |
| 148 |
if (is_array($link)) { |
if (is_array($link)) { |
| 328 |
} |
} |
| 329 |
|
|
| 330 |
/** |
/** |
| 331 |
|
* Build a tooltip for internal content. |
| 332 |
|
* Attempts to use description metatag, failover to teaser. |
| 333 |
|
*/ |
| 334 |
|
function freelinking_internal_tooltip($type, $id) { |
| 335 |
|
switch($type) { |
| 336 |
|
case 'node': |
| 337 |
|
if (module_exists('nodewords')) { |
| 338 |
|
$metatags = nodewords_get('node', $id); |
| 339 |
|
$description = $metatags['description']; |
| 340 |
|
} |
| 341 |
|
if (empty($description)) { |
| 342 |
|
$n = node_load($id); |
| 343 |
|
$description = $n->teaser; |
| 344 |
|
} |
| 345 |
|
break; |
| 346 |
|
} |
| 347 |
|
return truncate_utf8($description, 200, FALSE, TRUE); |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
/** |
| 351 |
* Theme Functions |
* Theme Functions |
| 352 |
*/ |
*/ |
| 353 |
|
|