You are here

function poptin_deactivate in Website Popups, Email Popup, Exit-Intent Popup, and Contact Forms – Poptin 7

Implements poptin_deactivate().

1 string reference to 'poptin_deactivate'
poptin_menu in ./poptin.module
Implements poptin_menu().

File

./poptin.module, line 225
Module for adding popups on website.

Code

function poptin_deactivate() {
  if (!poptin_check_csrf_token()) {
    $return_mssg = array(
      'mssg' => t("Invalid CSRF TOKEN"),
      'status' => 0,
      'cccToken' => drupal_get_token(),
    );
    drupal_json_output($return_mssg);
    drupal_exit();
  }
  db_truncate('poptin')
    ->execute();
  $return_mssg = array(
    'mssg' => t("done"),
    'status' => 1,
    'cccToken' => drupal_get_token(),
  );
  drupal_json_output($return_mssg);
  drupal_exit();
}