function lockr_admin_form in Lockr 7
Same name and namespace in other branches
- 7.2 lockr.admin.inc \lockr_admin_form()
Form constructor for Lockr registration form.
1 string reference to 'lockr_admin_form'
- lockr_menu in ./
lockr.module - Implements hook_menu().
File
- ./
lockr.admin.inc, line 17
Code
function lockr_admin_form($form, &$form_state) {
$form = array();
list($exists) = lockr_check_registration();
$partner = lockr_get_partner();
$request_sent = (bool) variable_get('lockr_request');
$register_form = !$exists && (bool) $partner || $request_sent;
$advanced_open = !$exists && !$partner;
$request_form = !$exists && !$partner && !$request_sent;
if ($partner) {
$desc = $partner['description'];
}
elseif ($request_sent) {
$desc = t('Thank you for your request for a custom cert! ' . 'A member from our development team will be generating ' . 'that cert and getting back to you shortly.');
}
else {
$desc = t('Thank you for your interest in Lockr! ' . 'Our system is detecting that your website is not currently hosted by a supported provider. ' . 'To help us better prioritize our integrations, ' . 'please provide your current hosting provider and email in the fields below. ' . 'We will be sure to notify you when Lockr is integrated with your hosting provider. ' . 'In the meantime, a custom certificate to use Lockr will be generated and ' . 'sent to the email you provided.');
}
$form['description'] = array(
'#prefix' => '<p>',
'#markup' => $desc,
'#suffix' => '</p>',
);
if ($register_form) {
$form['register'] = lockr_admin_register_form($form_state);
}
else {
if ($exists) {
$form['registered'] = array(
'#title' => t("You're already registered"),
'#prefix' => '<p>',
'#markup' => t("This site is already registered with the Lockr Key Management Service. " . "There's nothing left for you do to here, " . 'your keys entered in the key settings are already protected. ' . 'If you registered with the wrong account, you can ' . 'click <a href="@link" target="_blank">here</a> to go to Lockr and manage your sites.', array(
'@link' => 'http://lockr.io/user/login',
)),
'#suffix' => '</p>',
);
}
}
if ($request_form) {
$form['request'] = lockr_admin_request_form();
}
else {
if ($request_sent) {
$form['resend_request'] = array(
'#type' => 'submit',
'#value' => t('Resend request link'),
'#submit' => array(
'lockr_admin_resend_submit',
),
);
}
}
$form['advanced'] = lockr_admin_advanced_form($advanced_open);
return $form;
}