Created
July 22, 2015 09:48
-
-
Save mohamedrez/e23346f3b6f8d46e2223 to your computer and use it in GitHub Desktop.
D7 Form administration form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_form(). | |
* Admin form stripe configuration | |
*/ | |
function mymodule_configuration_form($form, &$form_state) { | |
$form['mymodule_mode'] = array( | |
'#type' => 'select', | |
'#title' => t('Mode'), | |
'#options' => drupal_map_assoc(array('live','test')), | |
'#required' => TRUE, | |
'#default_value' => variable_get('mymodule_mode', ''), | |
); | |
$form['mymodule_live_pk'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Live publishable key'), | |
'#required' => TRUE, | |
'#default_value' => variable_get('mymodule_live_pk', ''), | |
); | |
$form['mymodule_live_sk'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Live secret key'), | |
'#required' => TRUE, | |
'#default_value' => variable_get('mymodule_live_sk', ''), | |
); | |
$form['mymodule_test_pk'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Test publishable key'), | |
'#required' => TRUE, | |
'#default_value' => variable_get('mymodule_test_pk', ''), | |
); | |
$form['mymodule_test_sk'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Test secret key'), | |
'#required' => TRUE, | |
'#default_value' => variable_get('mymodule_test_sk', ''), | |
); | |
return system_settings_form($form); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment