You are here

function simplenews_issue_status in Simplenews 7.2

Gets or sets the status of a newsletter issue.

Parameters

$node: The issue to get or set the status.

$value: (Optional) The status to be set or NULL to return the current value.

Return value

The newsletter status. Defaults to SIMPLENEWS_STATUS_SEND_NOT.

Related topics

16 calls to simplenews_issue_status()
SimplenewsSendTestCase::testDelete in tests/simplenews.test
Create a newsletter, send mails and then delete.
SimplenewsSendTestCase::testSendMultipleNoCron in tests/simplenews.test
Send a newsletter using cron.
SimplenewsSendTestCase::testSendNowCron in tests/simplenews.test
Send a newsletter without using cron.
SimplenewsSendTestCase::testSendNowCronThrottle in tests/simplenews.test
Send a newsletter using cron and a low throttle.
SimplenewsSendTestCase::testSendNowNoCron in tests/simplenews.test
Send a newsletter using cron.

... See full list

4 string references to 'simplenews_issue_status'
simplenews_field_access in ./simplenews.module
Implements hook_field_access().
simplenews_issue_fields_remove in ./simplenews.module
Remove fields for newsletter, status and sent count to a note type.
simplenews_issue_status_field_add in ./simplenews.module
Add field for status
simplenews_update_7201 in ./simplenews.install
Convert existing simplenews_newsletter table to fields.

File

./simplenews.module, line 2669
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_issue_status($node, $value = NULL) {
  $field = variable_get('simplenews_issue_status_field', 'simplenews_issue_status');
  if ($value) {
    return $node->{$field} = array(
      LANGUAGE_NONE => array(
        array(
          'value' => $value,
        ),
      ),
    );
  }
  elseif ($status = field_get_items('node', $node, $field)) {
    return $status[0]['value'];
  }
  return SIMPLENEWS_STATUS_SEND_NOT;
}