You are here

function notifications_anonymous_destination_page in Notifications 6.4

Page callback. Manage anonymous destinations.

1 string reference to 'notifications_anonymous_destination_page'
notifications_anonymous_menu in notifications_anonymous/notifications_anonymous.module
Implementation of hook_menu()

File

notifications_anonymous/notifications_anonymous.pages.inc, line 54
Notifications for anonymous users

Code

function notifications_anonymous_destination_page($destination, $op = 'unsubscribe') {
  notifications_include('destination.inc');

  // Just for administrators or signed requests
  if (!user_access('administer notifications') && !notifications_check_signature()) {
    drupal_access_denied();
    exit(0);
  }
  drupal_set_title(t('Subscriptions for @name', array(
    '@name' => $destination
      ->address_name(),
  )));
  $options = notifications_anonymous_manage_links('destination', $destination, 'link');
  switch ($op) {
    case 'edit':
      $output .= drupal_get_form('notifications_destination_edit_form', $destination, $options);
      break;
    case 'delete':
    case 'unsubscribe':
      $output .= drupal_get_form('notifications_destination_unsubscribe_form', $destination, $options);
      break;
    case 'manage':
      $output .= drupal_get_form('notifications_destination_manage_form', $destination, $options);
      break;
  }
  return $output;
}