function _simplenews_scheduler_get_pid in Simplenews Scheduler 6.2
Same name and namespace in other branches
- 6 simplenews_scheduler.module \_simplenews_scheduler_get_pid()
- 7 simplenews_scheduler.module \_simplenews_scheduler_get_pid()
Helper function to get the identifier of newsletter.
Parameters
$node: The node object for the newsletter.
Return value
If the node is a newsletter edition, the node id of its parent template newsletter; if the node is a template newsletter, its own node id; and FALSE if the node is not part of a scheduled newsletter set.
2 calls to _simplenews_scheduler_get_pid()
- simplenews_scheduler_node_page in ./
simplenews_scheduler.module - Menu callback to provide an overview page with the scheduled newsletters.
- _simplenews_scheduler_tab_permission in ./
simplenews_scheduler.module - Check whether to display the Scheduled Newsletter tab.
File
- ./
simplenews_scheduler.module, line 758 - Simplenews Scheduler module allows a schedule to be set for sending (and resending) a Simplenews item.
Code
function _simplenews_scheduler_get_pid($node) {
$nid = FALSE;
// First assume this is a newsletter edition,
if (isset($node->simplenews_scheduler_edition)) {
$nid = $node->simplenews_scheduler_edition['pid'];
}
elseif (isset($node->simplenews_scheduler)) {
$nid = $node->nid;
}
return $nid;
}