function drupagram_user_make_global in Drupagram 7
Same name and namespace in other branches
- 6 drupagram.pages.inc \drupagram_user_make_global()
@todo Please document this function.
See also
1 string reference to 'drupagram_user_make_global'
- drupagram_menu in ./
drupagram.module - Implements hook_menu().
File
- ./
drupagram.pages.inc, line 205 - Drupagram admin page callaback functions.
Code
function drupagram_user_make_global($form, $form_state, $account, $drupagram_id) {
module_load_include('inc', 'drupagram');
$drupagram_account = drupagram_account_load($drupagram_id);
$form = array();
$form['uid'] = array(
'#type' => 'value',
'#value' => $account->uid,
);
$form['drupagram_id'] = array(
'#type' => 'value',
'#value' => $drupagram_id,
);
if ($drupagram_account->is_global) {
$text = t('Are you sure you want to remove %username from the global accounts?', array(
'%username' => $drupagram_account->username,
));
$description = t('This means other users will no longer be allowed to post using this account.');
}
else {
$text = t('Are you sure you want to allow other users to access the %username account?', array(
'%username' => $drupagram_account->username,
));
$description = t('This will allow other users to post using this account.');
}
return confirm_form($form, $text, 'user/' . $account->uid . '/edit/drupagram', $description);
}