You are here

function notifications_subscription_list_form_values in Notifications 6.4

Extract values from subscription list form

1 call to notifications_subscription_list_form_values()
notifications_subscription_list_form_submit in ./notifications.pages.inc
Submit list of subscriptions

File

./notifications.pages.inc, line 801
User pages for Notifications

Code

function notifications_subscription_list_form_values($form_values, $subscription, $key = NULL) {
  $key = isset($key) ? $key : $subscription->sid;
  $values = array();
  foreach (array(
    'send_method',
    'send_interval',
    'status',
  ) as $field) {
    if (isset($form_values[$field][$key]) && (!isset($subscription->{$field}) || $subscription->{$field} != $form_values[$field][$key])) {

      // We just set the values that have changed and return them if any
      $subscription->{$field} = $values[$field] = $form_values[$field][$key];
    }
  }
  return $values;
}