Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_calendar_management.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/asset_management.inc';
18 
29 {
30 
31 
38  function Page_Calendar_Management(&$pm)
39  {
40  $this->Asset_Management($pm);
41 
42  // The view types enabled for this calendar page
43  $this->vars['enabled_views'] = Array(
44  'added' => '0.1',
45  'type' => 'serialise',
46  'default' => Array(
47  'year' => 'calendar_format',
48  'month' => 'calendar_format',
49  'week' => 'calendar_format',
50  'month' => 'calendar_format',
51  'day' => 'calendar_format',
52  'event' => 'single_event_view',
53  ),
54  );
55 
56  // The view type you see when you first come to the page
57  $this->vars['initial_view'] = Array(
58  'added' => '0.1',
59  'type' => 'selection',
60  'default' => 'year',
61  'description' => 'The first view the user sees',
62  'parameters' => Array(
63  'options' => Array(
64  'year' => 'Year',
65  'month' => 'Month',
66  'week' => 'Week',
67  'day' => 'Day',
68  ),
69  'multiple' => FALSE,
70  ),
71  );
72 
73  // The locations from which we draw event assets, assetid => Array('classname' => className), where classname
74  // is the CSS class that should be applied to representations of events from that location
75  $this->vars['root_nodes'] = Array(
76  'added' => '0.1',
77  'type' => 'serialise',
78  'default' => Array(),
79  );
80 
81  $this->vars['personalised'] = Array(
82  'added' => '0.5',
83  'type' => 'boolean',
84  'default' => '0',
85  'parameters' => Array('allow_empty' => FALSE),
86  );
87 
88  // Which of the root nodes should get their own column in day view
89  $this->vars['columnise_day_view_by_root_node'] = Array(
90  'added' => '0.2',
91  'type' => 'serialise',
92  'default' => Array('*'),
93  'description' => 'list of root nodes which should have their own columns in day view, and * if you want a column for events that don\'t belong in any other column',
94  );
95  // The name of the 'other' column in day view
96  $this->vars['other_column_name'] = Array(
97  'added' => '0.1',
98  'type' => 'text',
99  'default' => '',
100  'is_contextable' => TRUE,
101  );
102 
103  // Earliest and latest times to display in week and day view, stored as strings
104  // rather than datetimes because we want to have 24:00 as a valid option
105  $this->vars['day_starts_at'] = Array(
106  'added' => '0.1',
107  'type' => 'text',
108  'default' => '08:00',
109  );
110 
111  $this->vars['day_ends_at'] = Array(
112  'added' => '0.1',
113  'type' => 'text',
114  'default' => '20:00',
115  );
116 
117  // Time-length of vertical partitions in the week and day views
118  $this->vars['day_partition_time'] = Array(
119  'added' => '0.1',
120  'type' => 'selection',
121  'default' => '60m',
122  'description' => 'The spacing of intervals in the calendar week and day views',
123  'parameters' => Array(
124  'options' => Array(
125  '10m' => '10 mins',
126  '15m' => '15 mins',
127  '20m' => '20 mins',
128  '30m' => '30 mins',
129  '60m' => '1 hour',
130  ),
131  'allow_empty' => FALSE,
132  ),
133  );
134 
135  // Physical height of the vertical partitions in the week and day views
136  $this->vars['day_partition_height'] = Array(
137  'added' => '0.1',
138  'type' => 'int',
139  'default' => '20',
140  'description' => 'The height of each day interval\'s row in the week and day tables, in pixels',
141  );
142 
143  // The width of columns in week view (pardon the bad name, a historical artefact)
144  $this->vars['table_column_width'] = Array(
145  'added' => '0.1',
146  'type' => 'int',
147  'default' => '110',
148  'description' => 'The width of each column in the WEEK table, in pixels',
149  );
150 
151  // The width of column in day view
152  $this->vars['day_column_width'] = Array(
153  'added' => '0.1',
154  'type' => 'int',
155  'default' => '110',
156  'description' => 'The width of each column in the DAY table, in pixels',
157  );
158 
159  // The day to show first in the week
160  $this->vars['week_starts_on'] = Array(
161  'added' => '0.1',
162  'type' => 'selection',
163  'default' => '1',
164  'description' => 'First day of the week',
165  'parameters' => Array(
166  'options' => Array(
167  0 => 'Sunday',
168  1 => 'Monday',
169  2 => 'Tuesday',
170  3 => 'Wednesday',
171  4 => 'Thursday',
172  5 => 'Friday',
173  6 => 'Saturday',
174  ),
175  'allow_empty' => FALSE,
176  ),
177  );
178 
179  // Which weekdays to show in week view
180  $this->vars['week_view_show_days'] = Array(
181  'added' => '0.1',
182  'type' => 'serialise',
183  'default' => Array(1, 1, 1, 1, 1, 1, 1),
184  );
185 
186 
187  // Date format for calendar view titles
188  $this->vars['view_title_formats'] = Array(
189  'added' => '0.1',
190  'type' => 'serialise',
191  'default' => Array(
192  'year' => 'Y',
193  'month' => 'F Y',
194  'week' => '\W\e\e\k \o\f l j F Y',
195  'day' => 'jS F Y',
196  'event' => 't',
197  ),
198  );
199 
200  // Date format for calendar heading titles
201  $this->vars['view_heading_formats'] = Array(
202  'added' => '0.8',
203  'type' => 'serialise',
204  'default' => Array(
205  'month_day' => 'l jS',
206  'week_day' => 'l jS',
207  ),
208  );
209 
210  // width of table columns in month view
211  $this->vars['month_column_width'] = Array(
212  'added' => '0.1',
213  'type' => 'int',
214  'default' => '90',
215  'description' => 'The width of the columns in the month calendar table, in pixels',
216  );
217 
218  // default height of table rows in month view
219  $this->vars['month_row_height'] = Array(
220  'added' => '0.1',
221  'type' => 'int',
222  'default' => '70',
223  'description' => 'The height of the rows in the month calendar table, in pixels',
224  );
225 
226  // Whether to show links to week view at the side of the month view table
227  $this->vars['month_links_to_week'] = Array(
228  'added' => '0.1',
229  'type' => 'boolean',
230  'default' => 'true',
231  'parameters' => Array('allow_empty' => FALSE),
232  );
233 
234  // Text for the link that takes you to the broader view
235  $this->vars['up_link_text'] = Array(
236  'added' => '0.1',
237  'type' => 'text',
238  'default' => '%v% view',
239  'is_contextable' => TRUE,
240  );
241 
242  // Text for the link that takes you to the next year/month/week/day
243  $this->vars['next_link_text'] = Array(
244  'added' => '0.1',
245  'type' => 'text',
246  'default' => 'Next %v% >>',
247  'is_contextable' => TRUE,
248  );
249 
250  // Text for the link that takes you to the previous year/month/week/day
251  $this->vars['prev_link_text'] = Array(
252  'added' => '0.1',
253  'type' => 'text',
254  'default' => '<< Previous %v%',
255  'is_contextable' => TRUE,
256  );
257 
258  // Text for the link that takes you to the today's date
259  $this->vars['today_link_text'] = Array(
260  'added' => '0.1',
261  'type' => 'text',
262  'default' => 'Show Today',
263  'is_contextable' => TRUE,
264  );
265 
266  // for the body copy no results use. If true we use the body copy no results.
267  $this->vars['use_no_results_body_copy'] = Array(
268  'added' => '0.7',
269  'type' => 'boolean',
270  'default' => '0',
271  'parameters' => Array('allow_empty' => FALSE),
272  );
273 
274 
275 
276  // If you are using listing format for a view, this stores what sort
277  // of list entry you want - the full bodycopy or just the title
278  $this->vars['list_entry_types'] = Array(
279  'added' => '0.1',
280  'type' => 'serialise',
281  'default' => Array(
282  'year' => 'title',
283  'month' => 'title',
284  'week' => 'title',
285  'day' => 'bodycopy',
286  ),
287  );
288 
289  // If this is set the clicking on empty space in a table cell
290  // will redirect you to this asset builder page to add an event
291  $this->vars['asset_builder_page'] = Array(
292  'added' => '0.1',
293  'type' => 'assetid',
294  'default' => '0',
295  );
296 
297  // Whether you should be allowed to drag events around in week and day views
298  $this->vars['enable_event_dragging'] = Array(
299  'added' => '0.1',
300  'type' => 'boolean',
301  'default' => 'false',
302  'parameters' => Array('allow_empty' => FALSE),
303  );
304 
305  // Whether you want to show a popup with the event description onmouseover
306  $this->vars['enable_description_popups'] = Array(
307  'added' => '0.1',
308  'type' => 'boolean',
309  'default' => 'false',
310  'parameters' => Array('allow_empty' => FALSE),
311  );
312 
313  // If this is nonzero, event DIVs will be sized so that there is always
314  // room for this number of them to sit side by side, even if there aren't
315  // ever this number of events occurring concurrently
316  $this->vars['column_capacity'] = Array(
317  'added' => '0.4',
318  'type' => 'int',
319  'default' => 0,
320  );
321 
322  $this->vars['parameter_map'] = Array(
323  'added' => '0.4',
324  'type' => 'parameter_map',
325  'default' => Array(),
326  'parameters' => Array(
327  'parameters' => Array(
328  'replacement_root_node' => 'Replacement Event Source (must be a child of the static root node)',
329  ),
330  ),
331  );
332 
333  $this->vars['month_view_event_label_format'] = Array(
334  'added' => '0.1',
335  'type' => 'text',
336  'default' => '%asset_name%',
337  );
338  $this->vars['week_view_event_label_format'] = Array(
339  'added' => '0.1',
340  'type' => 'text',
341  'default' => '%asset_name%',
342  );
343  $this->vars['day_view_event_label_format'] = Array(
344  'added' => '0.1',
345  'type' => 'text',
346  'default' => '%asset_name%',
347  );
348 
349  $this->vars['year_navi_limit'] = Array(
350  'added' => '0.9',
351  'type' => 'serialise',
352  'default' => Array(
353  'forward' => '',
354  'backward' => '',
355  ),
356  );
357  $this->vars['month_navi_limit'] = Array(
358  'added' => '0.9',
359  'type' => 'serialise',
360  'default' => Array(
361  'forward' => '',
362  'backward' => '',
363  ),
364  );
365  $this->vars['week_navi_limit'] = Array(
366  'added' => '0.9',
367  'type' => 'serialise',
368  'default' => Array(
369  'forward' => '',
370  'backward' => '',
371  ),
372  );
373  $this->vars['day_navi_limit'] = Array(
374  'added' => '0.9',
375  'type' => 'serialise',
376  'default' => Array(
377  'forward' => '',
378  'backward' => '',
379  ),
380  );
381 
382  // Day Labels
383  $this->vars['label_mon'] = Array(
384  'added' => '0.9',
385  'type' => 'text',
386  'default' => 'Monday',
387  'is_contextable' => TRUE,
388  );
389  $this->vars['label_tue'] = Array(
390  'added' => '0.9',
391  'type' => 'text',
392  'default' => 'Tuesday',
393  'is_contextable' => TRUE,
394  );
395  $this->vars['label_wed'] = Array(
396  'added' => '0.9',
397  'type' => 'text',
398  'default' => 'Wednesday',
399  'is_contextable' => TRUE,
400  );
401  $this->vars['label_thu'] = Array(
402  'added' => '0.9',
403  'type' => 'text',
404  'default' => 'Thursday',
405  'is_contextable' => TRUE,
406  );
407  $this->vars['label_fri'] = Array(
408  'added' => '0.9',
409  'type' => 'text',
410  'default' => 'Friday',
411  'is_contextable' => TRUE,
412  );
413  $this->vars['label_sat'] = Array(
414  'added' => '0.9',
415  'type' => 'text',
416  'default' => 'Saturday',
417  'is_contextable' => TRUE,
418  );
419  $this->vars['label_sun'] = Array(
420  'added' => '0.9',
421  'type' => 'text',
422  'default' => 'Sunday',
423  'is_contextable' => TRUE,
424  );
425 
426  }//end constructor
427 
428 
435  function _getFileList()
436  {
437  return Array(
438  'css/calendar_default.css',
439  'js/drag_n_drop.js',
440  'js/popup.js',
441  );
442 
443  }//end _getFileList()
444 
445 
452  function getEventList()
453  {
454  return Array(
455  Array(
456  'event_name' => 'requestKeywords',
457  'broadcast_type_code' => 'content_type',
458  'broadcast_strict_type_code' => FALSE,
459  'options' => Array(
460  'side_of_link' => 'major',
461  'indirect' => TRUE,
462  'is_exclusive' => NULL,
463  'is_dependant' => 1,
464  'value' => '',
465  'link_type' => SQ_LINK_TYPE_2 | SQ_LINK_TYPE_1,
466  ),
467  ),
468  );
469 
470  }//end getEventList()
471 
472 
473 }//end class
474 ?>