mappy.admin.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * @file
  4. * Administration interfaces.
  5. */
  6. /**
  7. * Main settings of the module.
  8. */
  9. function mappy_settings() {
  10. $form['google_maps'] = array(
  11. '#type' => 'fieldset',
  12. '#title' => t('Google Maps'),
  13. '#weight' => 1,
  14. '#collapsible' => TRUE,
  15. '#collapsed' => FALSE,
  16. );
  17. $form['google_maps']['mappy_google_width'] = array(
  18. '#type' => 'textfield',
  19. '#title' => t('Default width'),
  20. '#description' => t('Default width of the map. It is used when the parameter is not specified.'),
  21. '#default_value' => variable_get('mappy_google_width', 640),
  22. '#size' => 60,
  23. '#maxlength' => 128,
  24. '#required' => TRUE,
  25. );
  26. $form['google_maps']['mappy_google_height'] = array(
  27. '#type' => 'textfield',
  28. '#title' => t('Default height'),
  29. '#description' => t('Default height of the map. It is used when the parameter is not specified.'),
  30. '#default_value' => variable_get('mappy_google_height', 480),
  31. '#size' => 60,
  32. '#maxlength' => 128,
  33. '#required' => TRUE,
  34. );
  35. $form['yandex_maps'] = array(
  36. '#type' => 'fieldset',
  37. '#title' => t('Yandex Maps'),
  38. '#weight' => 1,
  39. '#collapsible' => TRUE,
  40. '#collapsed' => FALSE,
  41. );
  42. // Version list of Yandex.Maps.
  43. $yandex_verions = array(
  44. 1 => '2.0 (old version)',
  45. 2 => '2.1.x'
  46. );
  47. $form['yandex_maps']['mappy_yandex_version'] = array(
  48. '#type' => 'radios',
  49. '#title' => t('Version of Yandex.Map API'),
  50. '#default_value' => variable_get('mappy_yandex_version', 2),
  51. '#options' => $yandex_verions ,
  52. '#description' => t('You can choose, which version of Yandex.Maps will be used.'),
  53. );
  54. $form['yandex_maps']['mappy_yandex_width'] = array(
  55. '#type' => 'textfield',
  56. '#title' => t('Default width'),
  57. '#description' => t('Default width of the map. It is used when the parameter is not specified.'),
  58. '#default_value' => variable_get('mappy_yandex_width', 640),
  59. '#size' => 60,
  60. '#maxlength' => 128,
  61. '#required' => TRUE,
  62. );
  63. $form['yandex_maps']['mappy_yandex_height'] = array(
  64. '#type' => 'textfield',
  65. '#title' => t('Default height'),
  66. '#description' => t('Default height of the map. It is used when the parameter is not specified.'),
  67. '#default_value' => variable_get('mappy_yandex_height', 480),
  68. '#size' => 60,
  69. '#maxlength' => 128,
  70. '#required' => TRUE,
  71. );
  72. $form['loading_settings'] = array(
  73. '#type' => 'fieldset',
  74. '#title' => t('Mappy.js loading settings'),
  75. '#weight' => 1,
  76. '#collapsible' => TRUE,
  77. '#collapsed' => FALSE,
  78. );
  79. $match_type = array(
  80. 0 => t('All pages except those listed'),
  81. 1 => t('Only the listed pages'),
  82. );
  83. $form['loading_settings']['mappy_load_pages_match'] = array(
  84. '#type' => 'radios',
  85. '#title' => t('Attach Mappy.js on specific pages'),
  86. '#default_value' => variable_get('mappy_load_pages_match', 0),
  87. '#options' => $match_type,
  88. );
  89. $form['loading_settings']['mappy_load_pages_path'] = array(
  90. '#type' => 'textarea',
  91. '#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are blog for the blog page and blog/* for every personal blog. &lt;front&gt; is the front page."),
  92. '#default_value' => variable_get('mappy_load_pages_path'),
  93. );
  94. return system_settings_form($form);
  95. }