function og_broadcast_form in Organic groups 5.3
Same name and namespace in other branches
- 5.8 og.module \og_broadcast_form()
- 6.2 og.pages.inc \og_broadcast_form()
- 6 og.module \og_broadcast_form()
Admins may broadcast messages to all their members.
Parameters
$gid: the nid of a group.
File
- ./
og.module, line 311
Code
function og_broadcast_form($gid) {
$node = node_load($gid);
drupal_set_title(t('Send message to %group', array(
'%group' => $node->title,
)));
$result = db_query(og_list_users_sql(1), $gid);
$txt = format_plural(db_num_rows($result), 'the sole member', 'all @count members');
if (!$_POST) {
drupal_set_message(t('Your message will be sent to !count in this group.', array(
'!count' => l($txt, "og/users/{$gid}"),
)));
}
$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#size' => 70,
'#maxlength' => 250,
'#description' => t("Enter a subject for your message."),
'#required' => true,
);
$form['body'] = array(
'#type' => 'textarea',
'#title' => t('Body'),
'#rows' => 5,
'#cols' => 90,
'#description' => t('Enter the body of your message.'),
'#required' => true,
);
$form['send'] = array(
'#type' => 'submit',
'#value' => t('Send message'),
);
$form['gid'] = array(
'#type' => 'value',
'#value' => $gid,
);
return $form;
}