function notifications_subscriptions_operations in Notifications 6.2
Same name and namespace in other branches
- 6.4 notifications.manage.inc \notifications_subscriptions_operations()
- 6 notifications.manage.inc \notifications_subscriptions_operations()
- 6.3 notifications.manage.inc \notifications_subscriptions_operations()
Subscription mass operations.
Parameters
$account: User account if we are administering subscriptions for this user
2 calls to notifications_subscriptions_operations()
- notifications_manage_subscriptions_form in ./
notifications.manage.inc - Administer user subscriptions
- notifications_manage_subscriptions_form_submit in ./
notifications.manage.inc - Handle manage form submissions, run batch operations
File
- ./
notifications.manage.inc, line 258 - Common functions for bulk management of subscriptions
Code
function notifications_subscriptions_operations($account = NULL) {
$operations = array(
'activate' => array(
'label' => t('Activate'),
'callback' => 'notifications_subscriptions_mass_update',
'callback arguments' => array(
'updates' => array(
'status' => NOTIFICATIONS_SUBSCRIPTION_ACTIVE,
),
),
),
'deactivate' => array(
'label' => t('Deactivate'),
'callback' => 'notifications_subscriptions_mass_update',
'callback arguments' => array(
'updates' => array(
'status' => NOTIFICATIONS_SUBSCRIPTION_INACTIVE,
),
),
),
'delete' => array(
'label' => t('Delete'),
'callback' => NULL,
),
);
// Block option only for administrators
if (user_access('administer notifications') || user_access('manage all subscriptions')) {
$operations['block'] = array(
'label' => t('Block'),
'callback' => 'notifications_subscriptions_mass_update',
'callback arguments' => array(
'updates' => array(
'status' => NOTIFICATIONS_SUBSCRIPTION_BLOCKED,
),
),
);
}
// Sending methods
$parent = t('Change send method to');
foreach (_notifications_send_methods($account) as $key => $name) {
$operations['send_method-' . $key] = array(
'label' => $name,
'parent' => $parent,
'callback' => 'notifications_subscriptions_mass_update',
'callback arguments' => array(
'updates' => array(
'send_method' => $key,
),
),
);
}
$parent = t('Change send interval to');
foreach (notifications_send_intervals() as $key => $name) {
$operations['send_method-' . $key] = array(
'label' => $name,
'parent' => $parent,
'callback' => 'notifications_subscriptions_mass_update',
'callback arguments' => array(
'updates' => array(
'send_interval' => $key,
),
),
);
}
// Intervals
return $operations;
}