og_manage_form($group)og_manage_form($form_state, $group)contributions/og/og.module, line 364
<?php
function og_manage_form($group) {
global $user;
// avoid double messages on POST
if (!$_POST) {
// group manager can't leave
if ($group->og_selective == OG_CLOSED) {
drupal_set_message(t('You may not leave this group because it is a %closed group. You should request removal from a group administrator.', array('%closed' => t('closed'))));
}
elseif ($group->uid == $user->uid) {
drupal_set_message(t('You may not leave this group because you are its owner. A site administrator can assign ownership to another user and then you may leave.'));
}
else {
$links[] = l(t('Leave this group'), "og/unsubscribe/$group->nid");
$form['unsubscribe'] = array('#type' => 'markup', '#value' => theme('item_list', $links, t('Actions')));
}
}
switch ($user->og_email) {
// og_email can be NULL when you enable og on an existing site.
case NULL:
case OG_NOTIFICATION_SELECTIVE:
$form['mail_type'] = array('#type' => 'radios', '#title' => t('Email notification'), '#default_value' => $user->og_groups[$group->nid]['mail_type'], '#options' => array(1 => t('enabled'), 0 => t('disabled')), '#description' => t('Do you want to receive an email each time a message is posted to this group?'));
$submit = TRUE;
break;
case OG_NOTIFICATION_ALWAYS:
$form['mail_type'] = array('#type' => 'item', '#title' => t('Email notification'), '#value' => t('Your <a href="!prof">personal profile</a> is configured to: <em>Always receive email notifications</em>.', array('!prof' => url("user/$user->uid/edit"))));
break;
case OG_NOTIFICATION_NEVER:
$form['mail_type'] = array('#type' => 'item', '#title' => t('Email notification'), '#value' => t('Your <a href="!prof">personal profile</a> is configured to: <em>Never receive email notifications</em>.', array('!prof' => url("user/$user->uid/edit"))));
break;
}
if ($submit) {
$form['op'] = array('#type' => 'submit', '#value' => t('Submit'));
}
$form['gid'] = array('#type' => 'value', '#value' => $group->nid);
return $form;
}
?>