You are here

function notifications_anonymous_manage_links in Notifications 6.4

Get raw /formatted links to manage subscription / destination

Parameters

$format: Format to return the links

  • 'link', Full built link
  • 'url', Plain url
3 calls to notifications_anonymous_manage_links()
notifications_anonymous_destination_page in notifications_anonymous/notifications_anonymous.pages.inc
Page callback. Manage anonymous destinations.
notifications_anonymous_token_values in notifications_anonymous/notifications_anonymous.module
Implementation of hook_token_values()
notifications_destination_manage_subform in includes/destination.inc
Destination manage subform. List/edit subscriptions for destination.
2 string references to 'notifications_anonymous_manage_links'
notifications_destination_manage_subform in includes/destination.inc
Destination manage subform. List/edit subscriptions for destination.
notifications_manage_destination_extra in ./notifications.manage.inc
Manage destination extra options for administrators

File

notifications_anonymous/notifications_anonymous.module, line 220
Notifications for anonymous users

Code

function notifications_anonymous_manage_links($type, $object, $format = 'array') {
  $links = array();
  $params = array(
    'absolute' => TRUE,
    'signed' => TRUE,
  );
  if ($type == 'destination') {
    $params['oid'] = $params['mdid'] = $object->mdid;
    $link_types = array(
      'manage' => t('Manage'),
      'edit' => t('Edit'),
      'delete' => t('Delete'),
    );
  }
  elseif ($type == 'subscription') {
    $params['oid'] = $params['sid'] = $object->sid;
    $link_types = array(
      'unsubscribe' => t('Unsubscribe'),
      'edit' => t('Edit'),
    );
  }
  foreach ($link_types as $op => $name) {
    if (_notifications_anonymous_access($type, $object, $op)) {
      $params['title'] = $name;
      $links[$op] = notifications_build_link($op, $params, $type, $object, $format);
    }
  }
  return $links;
}