You are here

function subscriptions_nodes_list_form in Subscriptions 5

return node subscriptions form

2 string references to 'subscriptions_nodes_list_form'
subscriptions_nodes in ./subscriptions.module
query to get list of subscibed nodes
subscriptions_nodes_list_form_submit in ./subscriptions.module
submit the subscriptions_node_list form

File

./subscriptions.module, line 1085

Code

function subscriptions_nodes_list_form($data, $account) {
  $subsrows['subform'][] = array(
    '#value' => t('You are currently subscribed to the following:'),
  );
  foreach ($data as $nsub) {
    $title = l($nsub->title, 'node/' . $nsub->nid) . ' [' . t($nsub->type) . ']';
    $subsrows['subform']['subs' . $nsub->nid] = array(
      '#type' => 'checkbox',
      '#title' => $title,
      '#default_value' => 1,
    );
  }
  if (empty($data)) {
    $subsrows['subform'] = array(
      '#value' => t('You are not currently subscribed to any active threads'),
    );
  }
  else {
    $subsrows['user'] = array(
      '#type' => 'hidden',
      '#value' => $account->uid,
    );
    $subsrows['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Save'),
    );
  }
  return $subsrows;
}