openlayers_plus.module 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * Implements hook_block_info().
  4. */
  5. function openlayers_plus_block_info() {
  6. $blocks = array(
  7. 'blockswitcher' => array('info' => t('OL+ Blockswitcher')),
  8. 'blocktoggle' => array('info' => t('OL+ BlockToggle'))
  9. );
  10. return $blocks;
  11. }
  12. /**
  13. * Implements hook_block_view().
  14. */
  15. function openlayers_plus_block_view($delta) {
  16. switch ($delta) {
  17. case 'blockswitcher':
  18. return array(
  19. 'subject' => t('Map layers'),
  20. 'content' => Array('#theme' =>'openlayers_plus_blockswitcher'),
  21. );
  22. case 'blocktoggle':
  23. // TODO Please change this theme call to use an associative array for the $variables parameter.
  24. return array(
  25. 'subject' => t('Map layers'),
  26. 'content' => Array('#theme' =>'openlayers_plus_blocktoggle'),
  27. );
  28. }
  29. }
  30. /**
  31. * Implements hook_theme().
  32. */
  33. function openlayers_plus_theme() {
  34. return array(
  35. 'openlayers_plus_blockswitcher' => array(
  36. 'variables' => array(),
  37. 'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
  38. 'template' => 'openlayers-plus-blockswitcher',
  39. 'file' => 'theme.inc',
  40. ),
  41. 'openlayers_plus_blocktoggle' => array(
  42. 'variables' => array(
  43. 'a_label' => '',
  44. 'b_label' => '',
  45. ),
  46. 'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
  47. 'template' => 'openlayers-plus-blocktoggle',
  48. 'file' => 'theme.inc',
  49. ),
  50. 'openlayers_plus_legend_raw' => array(
  51. 'variables' => array(
  52. 'raw' => '',
  53. 'layer' => array(),
  54. 'layer_id' => array(),
  55. ),
  56. 'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
  57. 'template' => 'openlayers-plus-legend-raw',
  58. 'file' => 'theme.inc',
  59. ),
  60. 'openlayers_plus_legend' => array(
  61. 'variables' => array(
  62. 'legend' => array(),
  63. 'layer' => array(),
  64. 'layer_id' => array(),
  65. ),
  66. 'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
  67. 'template' => 'openlayers-plus-legend',
  68. 'file' => 'theme.inc',
  69. ),
  70. );
  71. }
  72. /**
  73. * Implements hook_openlayers_behaviors().
  74. *
  75. * This is a ctools plugins hook.
  76. */
  77. function openlayers_plus_openlayers_behaviors() {
  78. return array(
  79. 'openlayers_plus_behavior_blockswitcher' => array(
  80. 'title' => t('OL+: Blockswitcher'),
  81. 'description' => t('A clone of LayerSwitcher, with better themability and positioning via the Drupal block system.'),
  82. 'behavior' => array(
  83. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  84. 'file' => 'openlayers_plus_behavior_blockswitcher.inc',
  85. 'class' => 'openlayers_plus_behavior_blockswitcher',
  86. 'parent' => 'openlayers_behavior',
  87. ),
  88. ),
  89. 'openlayers_plus_behavior_blocktoggle' => array(
  90. 'title' => t('OL+: Blocktoggle'),
  91. 'description' => t('A version of BlockSwitcher that toggles between two different layers only. Useful for situations in which layers represent the same data in slightly different ways.'),
  92. 'behavior' => array(
  93. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  94. 'file' => 'openlayers_plus_behavior_blocktoggle.inc',
  95. 'class' => 'openlayers_plus_behavior_blocktoggle',
  96. 'parent' => 'openlayers_behavior',
  97. ),
  98. ),
  99. 'openlayers_plus_behavior_themeregion' => array(
  100. 'title' => t('OL+: Theme Region'),
  101. 'description' => t('Inserts Drupal Theme Regions on top of the map.'),
  102. 'behavior' => array(
  103. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  104. 'file' => 'openlayers_plus_behavior_themeregion.inc',
  105. 'class' => 'openlayers_plus_behavior_themeregion',
  106. 'parent' => 'openlayers_behavior',
  107. ),
  108. ),
  109. 'openlayers_plus_behavior_legend' => array(
  110. 'title' => t('OL+: Map legend'),
  111. 'description' => t('A block in a corner of a map that provides information on layers.'),
  112. 'behavior' => array(
  113. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  114. 'file' => 'openlayers_plus_behavior_legend.inc',
  115. 'class' => 'openlayers_plus_behavior_legend',
  116. 'parent' => 'openlayers_behavior',
  117. ),
  118. ),
  119. 'openlayers_plus_behavior_permalink' => array(
  120. 'title' => t('OL+: Permalink'),
  121. 'description' => t('A version of Permalink optimized to persist layers between pages with different layer setups and without explicitly using the control.'),
  122. 'behavior' => array(
  123. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  124. 'file' => 'openlayers_plus_behavior_permalink.inc',
  125. 'class' => 'openlayers_plus_behavior_permalink',
  126. 'parent' => 'openlayers_behavior',
  127. ),
  128. ),
  129. 'openlayers_plus_behavior_scalepoints' => array(
  130. 'title' => t('OL+: Scalepoints'),
  131. 'description' => t('Dynamic styling, changing point radii based on a certain value.'),
  132. 'behavior' => array(
  133. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  134. 'file' => 'openlayers_plus_behavior_scalepoints.inc',
  135. 'class' => 'openlayers_plus_behavior_scalepoints',
  136. 'parent' => 'openlayers_behavior',
  137. ),
  138. ),
  139. 'openlayers_plus_behavior_tooltips' => array(
  140. 'title' => t('OL+: Tooltips'),
  141. 'description' => t('An interaction with point-based maps that results in following links on hover.'),
  142. 'behavior' => array(
  143. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  144. 'file' => 'openlayers_plus_behavior_tooltips.inc',
  145. 'class' => 'openlayers_plus_behavior_tooltips',
  146. 'parent' => 'openlayers_behavior',
  147. ),
  148. ),
  149. 'openlayers_plus_behavior_tooltips_field' => array(
  150. 'title' => t('OL+: Tooltips Field'),
  151. 'description' => t('An interaction with point-based maps that results in following links on hover that you specify the field.'),
  152. 'behavior' => array(
  153. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  154. 'file' => 'openlayers_plus_behavior_tooltips_field.inc',
  155. 'class' => 'openlayers_plus_behavior_tooltips_field',
  156. 'parent' => 'openlayers_behavior',
  157. ),
  158. ),
  159. 'openlayers_plus_behavior_popup' => array(
  160. 'title' => t('OL+: Popups'),
  161. 'description' => t('An interaction with point-based, clustered maps that allows clicking on points that results in scanning between items.'),
  162. 'behavior' => array(
  163. 'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
  164. 'file' => 'openlayers_plus_behavior_popup.inc',
  165. 'class' => 'openlayers_plus_behavior_popup',
  166. 'parent' => 'openlayers_behavior',
  167. ),
  168. ),
  169. );
  170. }