| 1 |
<?php |
<?php |
| 2 |
// $Id: node_invite.module,v 1.11.2.4 2009/09/04 08:40:48 hadsie Exp $ |
// $Id: node_invite.module,v 1.11.2.5 2009/09/18 15:56:22 hadsie Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Provides the overall functionality for the node_invite module. |
* Provides the overall functionality for the node_invite module. |
| 176 |
function node_invite_link($type, $node = NULL, $teaser = FALSE) { |
function node_invite_link($type, $node = NULL, $teaser = FALSE) { |
| 177 |
global $user; |
global $user; |
| 178 |
$links = array(); |
$links = array(); |
| 179 |
|
|
| 180 |
if ($type == 'node' && _node_invite_type_is_allowed($node->type) && user_access('invite users to invite-enabled nodes') && _ni_node_is_enabled($node->nid)) { |
if ($type == 'node' && _node_invite_type_is_allowed($node->type) && user_access('invite users to invite-enabled nodes') && _ni_node_is_enabled($node->nid)) { |
| 181 |
$links['node_invite'] = array( |
$links['node_invite'] = array( |
| 182 |
'title' => t('Invite people to this @type', array('@type' => $node->type)), |
'title' => t('Invite people to this @type', array('@type' => $node->type)), |
| 429 |
} |
} |
| 430 |
elseif ($op == 'update' || $op == 'insert') { |
elseif ($op == 'update' || $op == 'insert') { |
| 431 |
if (!isset($node->node_invites_enabled)) { |
if (!isset($node->node_invites_enabled)) { |
|
drupal_set_message("had to get defaults for node->node_invites_enabled"); |
|
| 432 |
$node->node_invites_enabled = _ni_node_is_enabled($node->nid); |
$node->node_invites_enabled = _ni_node_is_enabled($node->nid); |
| 433 |
} |
} |
| 434 |
|
|
| 520 |
else { |
else { |
| 521 |
$url .= $invite->iid; |
$url .= $invite->iid; |
| 522 |
} |
} |
| 523 |
|
|
| 524 |
return $url; |
return $url; |
| 525 |
} |
} |
| 526 |
|
|