Hi all,
the Poll module doesn't implement hook_link and does this in the poll_view() function:

    $links = module_invoke_all('link', 'node', $node, 1);
    $links[] = array('title' => t('Older polls'), 'href' => 'poll', 'attributes' => array('title' => t('View the list of polls on this site.')));

On the other hand the Blog module implements hook_link() and does:

$links['blog_usernames_blog'] = ...

The links created by the Poll module are not associated with a name in the array like the Blog ones. This makes it harder (less convenient) to unset or manipulate the 'Older polls' link in phptemplate_menu_item_link() in one's template.php.

For example I have to use the following snippet:

function phptemplate_links($links, $attributes = array()) {
    /* disable user's blog link into nodes */
    if ($links['blog_usernames_blog']) {
        unset($links['blog_usernames_blog']);
    }

    /* disable Older poll link. the  */
    for ($i = 0, $size = sizeof($links); $i < $size; ++$i) {
        if ($links[$i]['title'] == t('Older polls')) {
            unset($links[$i]);
            break;
        }
    }

    return theme_links($links, $attributes);
}

Please fix the Poll module so that links can be more easily manipulated.

Comments

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.