function notify_admin_users in Notify 6
Same name and namespace in other branches
- 5.2 notify.module \notify_admin_users()
- 5 notify.module \notify_admin_users()
- 7 notify.admin.inc \notify_admin_users()
Menu callback; show admininster user notification settings form.
1 string reference to 'notify_admin_users'
- notify_menu in ./
notify.module - Implementation of hook_menu().
File
- ./
notify.module, line 329 - Notify module sends email digests of new content and comments.
Code
function notify_admin_users() {
$form = array();
$form['#tree'] = TRUE;
$form['info'] = array(
'#value' => t('The following table shows all users that have notifications enabled.'),
);
$form['users'] = array();
$result = db_query('SELECT u.uid, u.name, u.mail, n.* FROM {users} u LEFT JOIN {notify} n ON u.uid = n.uid WHERE n.status = 1 AND u.status = 1 ORDER BY u.name');
while ($notify = db_fetch_object($result)) {
$form['users'][$notify->uid] = array();
$form['users'][$notify->uid]['name'] = array(
'#type' => 'markup',
'#value' => theme('username', $notify),
);
$form['users'][$notify->uid]['mail'] = array(
'#type' => 'markup',
'#value' => $notify->mail,
);
$form['users'][$notify->uid]['node'] = array(
'#type' => 'checkbox',
'#default_value' => $notify->node,
);
$form['users'][$notify->uid]['teasers'] = array(
'#type' => 'select',
'#default_value' => $notify->teasers,
'#options' => array(
t('Title only'),
t('Title + Teaser'),
t('Title + Body'),
),
);
$form['users'][$notify->uid]['comment'] = array(
'#type' => 'checkbox',
'#default_value' => $notify->comment,
);
$form['users'][$notify->uid]['attempts'] = array(
'#type' => 'textfield',
'#size' => 2,
'#default_value' => $notify->attempts ? intval($notify->attempts) : 0,
);
}
$form['flush'] = array(
'#title' => t('Flush e-mail queue'),
'#type' => 'checkbox',
'#default_value' => FALSE,
'#description' => t('Send out any pending notification e-mails currently in queue.'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save settings'),
);
return $form;
}