You are here

function subscriptions_blogs_form in Subscriptions 5

returns blog subscription form

1 string reference to 'subscriptions_blogs_form'
subscriptions_blogs in ./subscriptions.module
get list of blog entries, return form

File

./subscriptions.module, line 1145

Code

function subscriptions_blogs_form($data, $account) {
  foreach ($data as $bsub) {
    $title = l($bsub->name, 'blog/' . $bsub->uid);
    $subsrows['subform']['subs' . $bsub->uid] = array(
      '#type' => 'checkbox',
      '#title' => $title,
      '#default_value' => 1,
    );
  }
  if (empty($data)) {
    $subsrows['subform'] = array(
      '#value' => t('You are not currently subscribed to any active blogs'),
    );
  }
  else {
    $subsrows['user'] = array(
      '#type' => 'hidden',
      '#value' => $account->uid,
    );
    $subsrows['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Save'),
    );
  }
  return $subsrows;
}