/
stylewriter.module
149 lines (141 loc) · 3.77 KB
/
stylewriter.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
// $Id$
/**
* @file
* StyleWriter
*/
module_load_include('inc', 'stylewriter', 'stylewriter');
/**
* Implementation of hook_views_api().
*/
function stylewriter_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'stylewriter') .'/views',
);
}
/**
* Implementation of hook_ctools_plugin_api().
*/
function stylewriter_ctools_plugin_api($module, $api) {
if ($module == "openlayers") {
switch ($api) {
case 'openlayers_layers':
return array('version' => 1);
}
}
}
/**
* Implementation of hook_theme().
*/
function stylewriter_theme() {
$path = drupal_get_path('module', 'stylewriter');
return array(
'stylewriter_rule' => array(
'arguments' => array(
'filter' => '',
'polygon' => array(),
'stroke' => array(),
'metawriter' => array(),
'point' => array(),
'marker' => array(),
'postfix' => array(),
),
'file' => 'stylewriter.theme.inc',
'template' => 'stylewriter-rule',
'path' => $path . "/views",
),
'stylewriter_color_swatch' => array(
'arguments' => array(
'color' => '',
'dist' => '',
'value_min' => '',
'value_max' => '',
'layer_label' => '',
),
'file' => 'stylewriter.theme.inc',
'template' => 'stylewriter-color-swatch',
'path' => $path . "/views",
),
'stylewriter_point_swatch' => array(
'arguments' => array(
'color' => '',
'dist' => '',
'value_min' => '',
'value_max' => '',
'layer_label' => '',
),
'file' => 'stylewriter.theme.inc',
'template' => 'stylewriter-point-swatch',
'path' => $path . "/views",
),
'stylewriter_document' => array(
'arguments' => array(
'rules' => '',
'data_url' => '',
'data_type' => 'shape',
'metawriter' => FALSE,
'layer' => FALSE
),
'file' => 'stylewriter.theme.inc',
'template' => 'stylewriter-document',
'path' => $path . "/views",
),
'stylewriter_legend' => array(
'arguments' => array(
'swatches' => '',
'value_min' => '',
'value_max' => '',
'label' => '',
),
'file' => 'stylewriter.theme.inc',
'template' => 'stylewriter-legend',
'path' => $path . "/views",
),
);
}
/**
* Implementation of openlayers_layer_type
*/
function stylewriter_openlayers_layer_types() {
return array(
'openlayers_layer_type_stylewriter' => array(
'title' => t('Stylewriter'),
'description' => t('Stylewriter Dynamic Maps'),
'type' => 'layer',
'path' => drupal_get_path('module', 'stylewriter') .'/includes/layer_types',
'file' => 'stylewriter.inc',
'layer_type' => array(
'class' => 'openlayers_layer_type_stylewriter',
'parent' => 'openlayers_layer_type',
),
),
);
}
/**
* Implementation of hook_openlayers_behaviors().
*
* This is a ctools plugins hook.
*/
function stylewriter_openlayers_behaviors() {
return array(
'stylewriter_polygoninteraction' => array(
'title' => t('StyleWriter Polygon Interaction'),
'behavior' => array(
'path' => drupal_get_path('module', 'stylewriter') .'/includes/behaviors',
'file' => 'stylewriter_polygoninteraction.inc',
'class' => 'stylewriter_polygoninteraction',
'parent' => 'openlayers_behavior',
),
),
'stylewriter_pointinteraction' => array(
'title' => t('StyleWriter Point Interaction'),
'behavior' => array(
'path' => drupal_get_path('module', 'stylewriter') .'/includes/behaviors',
'file' => 'stylewriter_pointinteraction.inc',
'class' => 'stylewriter_pointinteraction',
'parent' => 'openlayers_behavior',
),
),
);
}