-
Notifications
You must be signed in to change notification settings - Fork 0
/
EssDTD.php
executable file
·224 lines (217 loc) · 5.33 KB
/
EssDTD.php
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?php
/**
* ESS Feed DTD v0.9 (to check if tags exists and are mandatories)
*
* @package ESSFeedWriter
* @author Brice Pissard
* @link http://essfeed.org/index.php/ESS_structure
* @link https://github.com/essfeed
*/
final class EssDTD
{
// -- Event Privacity
const ACCESS_PRIVATE = 'PRIVATE';
const ACCESS_PUBLIC = 'PUBLIC';
public function __construct() {}
/**
* Get ESS XML element attributes
*
* @access public
* @return Array Return an Array of the <ess> XML element attributes with mandatory Boolean value DTD
*/
public static function getESSAttributeDTD()
{
return array(
'xmlns' => TRUE,
'version' => TRUE,
'lang' => TRUE
);
}
/**
* Get Channel's first available XML child
*
* @access public
* @return Array Return an Array of the <channel> first XML childs with mandatory Boolean value DTD
*/
public static function getChannelDTD()
{
return array(
'title' => TRUE,
'link' => TRUE,
'id' => TRUE,
'published' => TRUE,
'updated' => FALSE,
'generator' => FALSE,
'rights' => FALSE,
'feed' => TRUE
);
}
/**
* Get Feed first XML element DTD
*
* @access public
* @return Array Return an Array of the DTD
*/
public static function getRootDTD()
{
return array(
'title' => TRUE,
'id' => TRUE,
'access' => TRUE,
'description' => TRUE,
'published' => TRUE,
'uri' => FALSE,
'updated' => FALSE,
'tags' => FALSE
);
}
/**
* Get Feed Complex XML child element DTD
*
* @access public
* @return Array Return an Array of the DTD
*/
public static function getFeedDTD()
{
return array(
'categories' => array(
'mandatory' => TRUE,
'types' => array( 'award',
'carnival',
'cocktail',
'commemoration',
'competition',
'concert',
'conference',
'congress',
'course',
'diner',
'entertainment',
'exhibition',
'family',
'friends',
'festival',
'lecture',
'market',
'meeting',
'networking',
'outdoor',
'parade',
'party',
'peregrination',
'seminar',
'spectacle',
'talk',
'trade show',
'general',
'visite'
),
'tags' => array(
'name' => TRUE,
'id' => FALSE,
'description' => FALSE
)
),
'dates' => array(
'mandatory' => TRUE,
'types' => array('standalone','recurrent','permanent'),
'units' => array('hour','day','week','month','year'),
'selected_days' => array("monday","tuesday","wednesday","thursday","friday","saturday","sunday"),
'selected_weeks' => array("first","second","third","fourth","last"),
'tags' => array(
'name' => TRUE,
'start' => TRUE,
'duration' => FALSE,
'description' => FALSE
)
),
'places' => array(
'mandatory' => TRUE,
'types' => array('fixed','area','moving','virtual'),
'tags' => array(
'name' => TRUE,
'description' => FALSE,
'country_code' => FALSE,
'country' => FALSE,
'latitude' => FALSE,
'longitude' => FALSE,
'address' => FALSE,
'city' => FALSE,
'zip' => FALSE,
'state' => FALSE,
'state_code' => FALSE,
'medium_name' => FALSE,
'medium_type' => FALSE,
'kml' => FALSE
)
),
'prices' => array(
'mandatory' => FALSE,
'types' => array('standalone','recurrent'),
'modes' => array('fixed','free','donation','invitation','renumerated','prepaid'),
'units' => array('hour','day','week','month','year'),
'selected_days' => array("monday","tuesday","wednesday","thursday","friday","saturday","sunday"),
'selected_weeks' => array("first","second","third","fourth","last"),
'tags' => array(
'name' => TRUE,
'value' => TRUE,
'currency' => FALSE,
'start' => FALSE,
'duration' => FALSE,
'description' => FALSE,
'quantity' => FALSE,
'maximum' => FALSE,
'minimum' => FALSE,
'uri' => FALSE
)
),
'media' => array(
'mandatory' => FALSE,
'types' => array('image','sound','video','website'),
'tags' => array(
'name' => TRUE,
'uri' => TRUE,
'description' => FALSE
)
),
'people' => array(
'mandatory' => FALSE,
'types' => array('organizer','performer','attendee','social','author','contributor'),
'tags' => array(
'name' => TRUE,
'id' => FALSE,
'firstname' => FALSE,
'lastname' => FALSE,
'organization' => FALSE,
'logo' => FALSE,
'icon' => FALSE,
'uri' => FALSE,
'address' => FALSE,
'city' => FALSE,
'zip' => FALSE,
'state' => FALSE,
'state_code' => FALSE,
'country' => FALSE,
'country_code' => FALSE,
'email' => FALSE,
'phone' => FALSE,
'minpeople' => FALSE,
'maxpeople' => FALSE,
'minage' => FALSE,
'restriction' => FALSE,
'description' => FALSE
)
),
'relations' => array(
'mandatory' => FALSE,
'types' => array('alternative','related','enclosure'),
'tags' => array(
'name' => TRUE,
'uri' => TRUE,
'id' => TRUE,
'description' => FALSE
)
),
);
}
}