Signatures tab with all node types
designbysoil - June 21, 2008 - 22:11
| Project: | SignIt |
| Version: | 5.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
The signatures tab is appearing on almost every content node. How can I disable it?

#1
The problem is here:
if (arg(0) == 'node' && is_numeric(arg(1))) {// put signatures in a tab on the node
$items[] = array(
'path' => 'node/'. arg(1) .'/signatures',
'callback' => 'signit_view_signit_comments',
'title' => t('Signatures'),
'callback arguments' => arg(1),
'access' => user_access('view signit comments'),
'weight' => 1,
'type' => MENU_LOCAL_TASK
);
The signature tab is being applied to all nodes. I changed to the below code (sorry, I don't know how to make proper patches) and now I only get the "Signatures" tab on singit-enabled nodes.
if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get("signit_status_$node->type", true)) {// put signatures in a tab on the node
#2
Scratch that last 'solution', as it didn't actually work. Here's an imitation of how signUP module handles it's tab-adding that actually does work. Just replace the IF code shown above as follows:
if (arg(0) == 'node' && is_numeric(arg(1))) {// put signatures in a tab on the node
$node = node_load(arg(1));
if (!empty($node->signit)) {
$items[] = array(
'path' => 'node/'. arg(1) .'/signatures',
'callback' => 'signit_view_signit_comments',
'title' => t('Signatures'),
'callback arguments' => arg(1),
'access' => user_access('view signit comments'),
'weight' => 1,
'type' => MENU_LOCAL_TASK
);
}