function drupagram_account_form in Drupagram 7
Same name and namespace in other branches
- 6 drupagram.pages.inc \drupagram_account_form()
Form to add a Instagram account
If OAuth is not enabled, a text field lets users to add their Instagram screen name. If it is, a submit button redirects to Instagram.com asking for authorisation.
1 string reference to 'drupagram_account_form'
- drupagram_user_settings in ./
drupagram.pages.inc - @todo Please document this function.
File
- ./
drupagram.pages.inc, line 254 - Drupagram admin page callaback functions.
Code
function drupagram_account_form($form, $form_state, $account = NULL) {
global $user;
if (empty($account)) {
$account = $user;
}
$form['uid'] = array(
'#type' => 'value',
'#value' => $account->uid,
);
if (_drupagram_use_oauth()) {
$form['#validate'] = array(
'drupagram_account_oauth_validate',
);
}
elseif ($user->uid == 1 || user_access('add drupagram accounts')) {
$form['error_message'] = array(
'#type' => 'item',
'#title' => t('Link your Instagram to this account'),
'#markup' => t('oAuth Settings have not been set up. Please !fix this issue and try again.', array(
'!fix' => l(t('fix'), 'admin/config/services/drupagram'),
)),
);
}
$form['import'] = array(
'#type' => 'checkbox',
'#title' => t('Import statuses from this account'),
'#default_value' => TRUE,
'#access' => FALSE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add account'),
'#access' => _drupagram_use_oauth(),
);
return $form;
}