twitter_signin.pages.inc 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @todo Please document this function.
  4. * @see http://drupal.org/node/1354
  5. */
  6. function twitter_signin_admin_settings($form, &$form_state) {
  7. $form = array();
  8. $img_path = drupal_get_path('module', 'twitter_signin') . '/images';
  9. $results = file_scan_directory($img_path, '/.png/');
  10. $options = array();
  11. foreach ($results as $image) {
  12. $options[$image->filename] = theme('image', array('path' => $image->uri));
  13. }
  14. $form['twitter_signin_button'] = array(
  15. '#type' => 'radios',
  16. '#title' => t('Select sign-in button'),
  17. '#options' => $options,
  18. '#default_value' => variable_get('twitter_signin_button', 'Sign-in-with-Twitter-lighter-small.png'),
  19. );
  20. $form['twitter_signin_register'] = array(
  21. '#title' => t('Automatically register new users'),
  22. '#type' => 'radios',
  23. '#options' => array(t('No'), t('Yes')),
  24. '#default_value' => variable_get('twitter_signin_register', 0),
  25. '#description' => t('Warning, if you enable this, new user accounts will be created without email addresses.'),
  26. );
  27. return system_settings_form($form);
  28. }