DrupalBin
Submit Code
About
Recent Posts
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
2 hours 29 min
ago
Code
3 hours 24 min
ago
Code
7 hours 23 min
ago
oopsie in modules/taxonomy/taxonomy.test
9 hours 21 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for overriding favorite nodes links
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
/** * Implementation of hook_links(). */ function favorite_nodes_link($type, $node = null, $teaser = false) { global $user; $links = array(); if ($type == 'node' && !$teaser) { if (variable_get(FAVORITE_NODES_NODE_TYPE . $node->type, 0)) { if (user_access(FAVORITE_NODES_PERM_ADD)) { if (!_favorite_nodes_check($node->nid)) { $links[] = array('title' => t('add to favorites'), 'href' => 'favorite_nodes/add/'. $node->nid); } else { if (user_access(FAVORITE_NODES_PERM_VIEW)) { $links[] = array('title' => t('in favorites')); $links[] = array('title' => t('remove from favorites'), 'href' => 'favorite_nodes/delete/'. $node->nid); } } } } } return $links; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.