openlayers_test.views.inc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /**
  3. * @file
  4. * Holds Openlayers test views
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. */
  9. function _openlayers_test_views_default_views() {
  10. // Only provide view if everything is already setup properly
  11. if (module_exists('content') && module_exists('content_copy')) {
  12. $field = content_fields('field_openlayers_test_wkt', 'openlayers_test_type');
  13. if (!empty($field)) {
  14. $view = new view;
  15. $view->name = 'openlayers_test_view';
  16. $view->description = 'OpenLayers Test View';
  17. $view->tag = '';
  18. $view->view_php = '';
  19. $view->base_table = 'node';
  20. $view->is_cacheable = FALSE;
  21. $view->api_version = 2;
  22. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  23. $handler = $view->new_display('default', 'OpenLayers Test View Default Display', 'default');
  24. $handler->override_option('fields', array(
  25. 'field_openlayers_test_wkt_openlayers_wkt' => array(
  26. 'label' => '',
  27. 'alter' => array(
  28. 'alter_text' => 0,
  29. 'text' => '',
  30. 'make_link' => 0,
  31. 'path' => '',
  32. 'link_class' => '',
  33. 'alt' => '',
  34. 'prefix' => '',
  35. 'suffix' => '',
  36. 'target' => '',
  37. 'help' => '',
  38. 'trim' => 0,
  39. 'max_length' => '',
  40. 'word_boundary' => 1,
  41. 'ellipsis' => 1,
  42. 'strip_tags' => 0,
  43. 'html' => 0,
  44. ),
  45. 'empty' => '',
  46. 'hide_empty' => 0,
  47. 'empty_zero' => 0,
  48. 'link_to_node' => 0,
  49. 'label_type' => 'none',
  50. 'format' => 'openlayers_wkt',
  51. 'multiple' => array(
  52. 'group' => TRUE,
  53. 'multiple_number' => '',
  54. 'multiple_from' => '',
  55. 'multiple_reversed' => FALSE,
  56. ),
  57. 'exclude' => 0,
  58. 'id' => 'field_openlayers_test_wkt_openlayers_wkt',
  59. 'table' => 'node_data_field_openlayers_test_wkt',
  60. 'field' => 'field_openlayers_test_wkt_openlayers_wkt',
  61. 'relationship' => 'none',
  62. ),
  63. 'teaser' => array(
  64. 'label' => '',
  65. 'alter' => array(
  66. 'alter_text' => 0,
  67. 'text' => '',
  68. 'make_link' => 0,
  69. 'path' => '',
  70. 'link_class' => '',
  71. 'alt' => '',
  72. 'prefix' => '',
  73. 'suffix' => '',
  74. 'target' => '',
  75. 'help' => '',
  76. 'trim' => 0,
  77. 'max_length' => '',
  78. 'word_boundary' => 1,
  79. 'ellipsis' => 1,
  80. 'strip_tags' => 0,
  81. 'html' => 0,
  82. ),
  83. 'empty' => '',
  84. 'hide_empty' => 0,
  85. 'empty_zero' => 0,
  86. 'exclude' => 0,
  87. 'id' => 'teaser',
  88. 'table' => 'node_revisions',
  89. 'field' => 'teaser',
  90. 'relationship' => 'none',
  91. ),
  92. 'title' => array(
  93. 'label' => '',
  94. 'alter' => array(
  95. 'alter_text' => 0,
  96. 'text' => '',
  97. 'make_link' => 0,
  98. 'path' => '',
  99. 'link_class' => '',
  100. 'alt' => '',
  101. 'prefix' => '',
  102. 'suffix' => '',
  103. 'target' => '',
  104. 'help' => '',
  105. 'trim' => 0,
  106. 'max_length' => '',
  107. 'word_boundary' => 1,
  108. 'ellipsis' => 1,
  109. 'strip_tags' => 0,
  110. 'html' => 0,
  111. ),
  112. 'empty' => '',
  113. 'hide_empty' => 0,
  114. 'empty_zero' => 0,
  115. 'link_to_node' => 1,
  116. 'exclude' => 0,
  117. 'id' => 'title',
  118. 'table' => 'node',
  119. 'field' => 'title',
  120. 'relationship' => 'none',
  121. ),
  122. ));
  123. $handler->override_option('filters', array(
  124. 'type' => array(
  125. 'operator' => 'in',
  126. 'value' => array(
  127. 'openlayers_test_type' => 'openlayers_test_type',
  128. ),
  129. 'group' => '0',
  130. 'exposed' => FALSE,
  131. 'expose' => array(
  132. 'operator' => FALSE,
  133. 'label' => '',
  134. ),
  135. 'id' => 'type',
  136. 'table' => 'node',
  137. 'field' => 'type',
  138. 'relationship' => 'none',
  139. ),
  140. ));
  141. $handler->override_option('access', array(
  142. 'type' => 'none',
  143. ));
  144. $handler->override_option('cache', array(
  145. 'type' => 'none',
  146. ));
  147. $handler->override_option('title', 'OpenLayers Test View Layer');
  148. $handler->override_option('items_per_page', 200);
  149. $handler->override_option('style_plugin', 'openlayers_data');
  150. $handler->override_option('style_options', array(
  151. 'grouping' => '',
  152. 'data_source' => array(
  153. 'value' => array(
  154. 'openlayers_wkt' => 'openlayers_wkt',
  155. ),
  156. 'other_lat' => 'field_openlayers_test_wkt_openlayers_wkt',
  157. 'other_lon' => 'field_openlayers_test_wkt_openlayers_wkt',
  158. 'openlayers_wkt' => 'field_openlayers_test_wkt_openlayers_wkt',
  159. 'other_top' => 'field_openlayers_test_wkt_openlayers_wkt',
  160. 'other_right' => 'field_openlayers_test_wkt_openlayers_wkt',
  161. 'other_bottom' => 'field_openlayers_test_wkt_openlayers_wkt',
  162. 'other_left' => 'field_openlayers_test_wkt_openlayers_wkt',
  163. 'name_field' => 'title',
  164. 'description_field' => 'teaser',
  165. ),
  166. ));
  167. $handler = $view->new_display('openlayers', 'OpenLayers Test View OpenLayers Display', 'openlayers_1');
  168. $handler->override_option('row_plugin', '');
  169. $handler->override_option('displays', array());
  170. // Return
  171. $views['openlayers_test_view'] = $view;
  172. return $views;
  173. }
  174. }
  175. }