function recipe_link in Recipe 5
Same name and namespace in other branches
- 6 recipe.module \recipe_link()
- 7 recipe.module \recipe_link()
Implementation of hook_link().
File
- ./
recipe.module, line 30 - recipe.module - share recipes for drupal 5.x
Code
function recipe_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node' && $node->type == 'recipe') {
if (!$teaser) {
if (variable_get('recipe_export_recipeml_enable', 1) == 1) {
$links['recipe_recipeml'] = array(
'title' => t('Export to RecipeML'),
'href' => "recipe/export/recipeml/{$node->nid}",
'attributes' => array(
'title' => t('Export this recipe to RecipeML.'),
),
);
}
if (variable_get('recipe_export_html_enable', 1) == 1) {
$links['recipe_html'] = array(
'title' => t('Printer-friendly version'),
'href' => "recipe/export/html/{$node->nid}",
'attributes' => array(
'title' => t('Show a printer-friendly version of this recipe.'),
),
);
}
}
}
return $links;
}