languageicons.admin.inc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * @file
  4. * Admin page callbacks for the Language Icons module.
  5. */
  6. /**
  7. * Form builder; configure Language Icons.
  8. *
  9. * @todo Improve (re-phrase?) $form['show']['#description'].
  10. *
  11. * @ingroup forms
  12. * @see system_settings_form()
  13. */
  14. function languageicons_admin_settings() {
  15. $form['show'] = array(
  16. '#type' => 'fieldset',
  17. '#title' => t('Add language icons'),
  18. '#description' => t('Link types to add language icons.'),
  19. '#collapsible' => TRUE,
  20. '#collapsed' => TRUE,
  21. );
  22. $form['show']['languageicons_show_node'] = array(
  23. '#type' => 'checkbox',
  24. '#title' => t('Node links'),
  25. '#default_value' => variable_get('languageicons_show_node', 1),
  26. '#disabled' => TRUE,
  27. );
  28. $form['show']['languageicons_show_block'] = array(
  29. '#type' => 'checkbox',
  30. '#title' => t('Language switcher block'),
  31. '#default_value' => variable_get('languageicons_show_block', 1),
  32. '#disabled' => TRUE,
  33. );
  34. $form['show']['disabled'] = array(
  35. '#prefix' => '<div class="messages error">',
  36. '#markup' => t('These options are currently disabled due to <a href="!issue_url">a bug</a> that cannot currently be resolved. They may be reintroduced at a later stage.', array(
  37. '!issue_url' => 'http://drupal.org/node/1005144',
  38. )),
  39. '#suffix' => '</div>',
  40. );
  41. $form['languageicons_placement'] = array(
  42. '#type' => 'radios',
  43. '#title' => t('Icon placement'),
  44. '#options' => array(
  45. 'before' => t('Before link'),
  46. 'after' => t('After link'),
  47. 'replace' => t('Replace link'),
  48. ),
  49. '#default_value' => variable_get('languageicons_placement', 'before'),
  50. '#description' => t('Where to display the icon, relative to the link title.'),
  51. );
  52. $form['languageicons_path'] = array(
  53. '#type' => 'textfield',
  54. '#title' => t('Icons file path'),
  55. '#default_value' => variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png'),
  56. '#size' => 70,
  57. '#maxlength' => 180,
  58. '#description' => t('Path for language icons, relative to Drupal installation. "*" is a placeholder for language code.'),
  59. );
  60. $form['languageicons_size'] = array(
  61. '#type' => 'textfield',
  62. '#title' => t('Image size'),
  63. '#default_value' => variable_get('languageicons_size', '16x12'),
  64. '#size' => 7,
  65. '#maxlength' => 7,
  66. '#description' => t('Image size for language icons, in the form "width x height".'),
  67. );
  68. return system_settings_form($form);
  69. }