/[drupal]/contributions/modules/rsvp/rsvp.install
ViewVC logotype

Contents of /contributions/modules/rsvp/rsvp.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download) (as text)
Thu Feb 5 23:28:36 2009 UTC (9 months, 3 weeks ago) by ulf1
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.9: +29 -2 lines
File MIME type: text/x-php
*** empty log message ***
1 <?php
2 // $Id: rsvp.install,v 1.9 2009/02/05 02:25:43 ulf1 Exp $
3
4 function rsvp_install() {
5 drupal_install_schema('rsvp');
6 }
7
8 function rsvp_schema() {
9
10 $schema['rsvp'] = array(
11 'description' => t('RSVP contents'),
12 'fields' => array(
13 'rid' => array(
14 'description' => ('The primary identifier'),
15 'type' => 'serial',
16 'unsigned' => TRUE,
17 'not null' => TRUE
18 ),
19 'nid' => array(
20 'description' => ('The {node}.nid identifier'),
21 'type' => 'int',
22 'unsigned' => TRUE,
23 'not null' => TRUE,
24 'default' => '0'
25 ),
26 'uid' => array(
27 'description' => ('The {user}.uid identifier'),
28 'type' => 'int',
29 'unsigned' => TRUE,
30 'not null' => TRUE,
31 'default' => '0'
32 ),
33 'name' => array(
34 'description' => ('The RSVP title'),
35 'type' => 'varchar',
36 'length' => 128,
37 'default' => ''
38 ),
39 'invite_text' => array(
40 'description' => ('RSVP body'),
41 'type' => 'text',
42 ),
43 'invite_filterformat' => array(
44 'description' => ('RSVP body filter format'),
45 'type' => 'int',
46 'size' => 'tiny',
47 'unsigned' => TRUE,
48 'default' => '0'
49 ),
50 'response_blind' => array(
51 'description' => ('Defines whether responses (result) of rsvp is visible or not, and when it becomes visible.'),
52 'type' => 'int',
53 'size' => 'tiny',
54 'unsigned' => TRUE,
55 'not null' => TRUE,
56 'default' => '0'
57 ),
58 'attendees_visible' => array(
59 'description' => ('Defines whether attendees are visible to other users or not, and when they become visible'),
60 'type' => 'int',
61 'size' => 'tiny',
62 'unsigned' => TRUE,
63 'not null' => TRUE,
64 'default' => '0'
65 ),
66 'list_email' => array(
67 'description' => ('Defines who is allowed to send emails (none, invitee, respondent, attendee)'),
68 'type' => 'int',
69 'size' => 'tiny',
70 'unsigned' => TRUE,
71 'not null' => TRUE,
72 'default' => '0'
73 ),
74 'allow_invite' => array(
75 'description' => ('Defines who is allowed to invite other people (none, invitee, respondent, attendee)'),
76 'type' => 'int',
77 'size' => 'tiny',
78 'unsigned' => TRUE,
79 'not null' => TRUE,
80 'default' => '0'
81 ),
82 'timestamp' => array(
83 'description' => ('Records the last update time'),
84 'type' => 'int',
85 'unsigned' => TRUE,
86 'not null' => TRUE,
87 'default' => '0'
88 ),
89 'startdate' => array(
90 'description' => ('The startdate related to this invitation'),
91 'type' => 'int',
92 'unsigned' => TRUE,
93 'not null' => TRUE,
94 'default' => '0'
95 ),
96 'text_whoiscoming' => array(
97 'description' => ('The text that is being shown instead of the "Responses" text'),
98 'type' => 'varchar',
99 'length' => 128,
100 'default' => 'Yes'
101 ),
102 'text_yes' => array(
103 'description' => ('The text that is being shown instead of the "Yes" text'),
104 'type' => 'varchar',
105 'length' => 128,
106 'default' => 'Yes'
107 ),
108 'text_no' => array(
109 'description' => ('The text that is being shown instead of the "No" text'),
110 'type' => 'varchar',
111 'length' => 128,
112 'default' => 'No'
113 ),
114 'text_maybe' => array(
115 'description' => ('The text that is being shown instead of the "Maybe" text'),
116 'type' => 'varchar',
117 'length' => 128,
118 'default' => 'Maybe'
119 ),
120 'response_view_roles' => array(
121 'description' => ('Comma seperated list of roles that have permissions to view the guest list'),
122 'type' => 'varchar',
123 'length' => 128,
124 'default' => ''
125 ),
126 'rsvp_view_roles' => array(
127 'description' => ('Comma seperated list of roles that have permissions to view the invitation'),
128 'type' => 'varchar',
129 'length' => 128,
130 'default' => ''
131 ),
132 'uid_moderator' => array(
133 'description' => ('The {user}.uid identifier of a possible moderator'),
134 'type' => 'int',
135 'unsigned' => TRUE,
136 'default' => '0'
137 ),
138 'response_blind_node' => array(
139 'description' => ('Defines whether responses (result) of rsvp is visible on the event(node) or not, and when it becomes visible.'),
140 'type' => 'int',
141 'size' => 'tiny',
142 'unsigned' => TRUE,
143 'not null' => TRUE,
144 'default' => '0'
145 ),
146 'reply_blind_node' => array(
147 'description' => ('Defines whether the replybox of rsvp can be seen below the event(node).'),
148 'type' => 'int',
149 'size' => 'tiny',
150 'unsigned' => TRUE,
151 'not null' => TRUE,
152 'default' => '0'
153 ),
154 'send_conf_owner' => array(
155 'description' => ('Send confirmation emails to owner when guest replies'),
156 'type' => 'int',
157 'size' => 'tiny',
158 'unsigned' => TRUE,
159 'not null' => TRUE,
160 'default' => '0'
161 ),
162 'send_conf_guest' => array(
163 'description' => ('Send confirmation emails to guest when he replies'),
164 'type' => 'int',
165 'size' => 'tiny',
166 'unsigned' => TRUE,
167 'not null' => TRUE,
168 'default' => '0'
169 ),
170 'send_privatemsg' => array(
171 'description' => ('Send emails by privatemsg for registered users'),
172 'type' => 'int',
173 'size' => 'tiny',
174 'unsigned' => TRUE,
175 'not null' => TRUE,
176 'default' => '0'
177 ),
178 'disable_maybe' => array(
179 'description' => ('Allow maybe as answer or not.'),
180 'type' => 'int',
181 'size' => 'tiny',
182 'unsigned' => TRUE,
183 'not null' => TRUE,
184 'default' => '0'
185 ),
186 'reply_startdate' => array(
187 'description' => ('Determines when guests can start replying'),
188 'type' => 'int',
189 'unsigned' => TRUE,
190 'not null' => TRUE,
191 'default' => '0'
192 ),
193 'reply_enddate' => array(
194 'description' => ('Determines when guests can not reply anymore'),
195 'type' => 'int',
196 'unsigned' => TRUE,
197 'not null' => TRUE,
198 'default' => '0'
199 ),
200 'open_invitation' => array(
201 'description' => ('Can other registered users signup to the invitation'),
202 'type' => 'int',
203 'size' => 'tiny',
204 'unsigned' => TRUE,
205 'not null' => TRUE,
206 'default' => '0'
207 ),
208 'max_guests' => array(
209 'description' => ('The maximum number of guests allowed to attend'),
210 'type' => 'int',
211 'unsigned' => TRUE,
212 'not null' => TRUE,
213 'default' => '0'
214 ),
215 'theme' => array(
216 'description' => ('The theme that is being used for the invitation'),
217 'type' => 'varchar',
218 'length' => 128,
219 'default' => ''
220 ),
221 'stylesheet' => array(
222 'description' => ('The style that the theme is beeing displayed with'),
223 'type' => 'varchar',
224 'length' => 128,
225 'default' => ''
226 ),
227 'iconset' => array(
228 'description' => ('The iconset that the theme is beeing using'),
229 'type' => 'varchar',
230 'length' => 128,
231 'default' => ''
232 ),
233 'backgroundimage' => array(
234 'description' => ('The backgroundimage that the theme is using'),
235 'type' => 'varchar',
236 'length' => 128,
237 'default' => ''
238 ),
239 'image' => array(
240 'description' => ('The image that the theme is using'),
241 'type' => 'varchar',
242 'length' => 128,
243 'default' => ''
244 ),
245
246 ),
247 'primary key' => array('rid', 'nid', 'uid'),
248 );
249
250 $schema['rsvp_invite'] = array(
251 'description' => t('RSVP invitation status'),
252 'fields' => array(
253 'response' => array(
254 'description' => ('Response of the invitee'),
255 'type' => 'varchar',
256 'length' => 128,
257 'default' => ''
258 ),
259 'rid' => array(
260 'description' => ('The {rsvp}.rid identifier'),
261 'type' => 'int',
262 'unsigned' => TRUE,
263 'not null' => TRUE,
264 'default' => '0'
265 ),
266 'uid' => array(
267 'description' => ('The {user}.uid identifier'),
268 'type' => 'int',
269 'unsigned' => TRUE,
270 'not null' => TRUE,
271 'default' => '0'
272 ),
273 'email' => array(
274 'description' => ('Guests e-mail'),
275 'type' => 'varchar',
276 'length' => 128,
277 'default' => ''
278 ),
279 'hash' => array(
280 'description' => ('The hash sent to the invitee with the invitation e-mail'),
281 'type' => 'varchar',
282 'length' => 255,
283 'default' => ''
284 ),
285 'invited' => array(
286 'description' => ('Whether the invitee was invited(1) or not(0)'),
287 'type' => 'int',
288 'size' => 'tiny',
289 'unsigned' => TRUE,
290 'not null' => TRUE,
291 'default' => '0'
292 ),
293 'received' => array(
294 'description' => ('Whether the invitee has received the invitation(1) or not(0)'),
295 'type' => 'int',
296 'size' => 'tiny',
297 'unsigned' => TRUE,
298 'not null' => TRUE,
299 'default' => '0'
300 ),
301 'timestamp' => array(
302 'description' => ('Records the last update time'),
303 'type' => 'int',
304 'unsigned' => TRUE,
305 'not null' => TRUE,
306 'default' => '0'
307 ),
308 'comment' => array(
309 'description' => ('Response Comment'),
310 'type' => 'text',
311 ),
312 'inviteehash' => array(
313 'description' => ('The hash of the user that invited this person. (Only set if it was not the owner of the rsvp who invited this user)'),
314 'type' => 'varchar',
315 'length' => 255,
316 'default' => ''
317 ),
318 'totalguests' => array(
319 'description' => ('The total number of guests the attendee brings'),
320 'type' => 'int',
321 'size' => 'tiny',
322 'unsigned' => TRUE,
323 'not null' => TRUE,
324 'default' => '1'
325 ),
326 ),
327 'primary key' => array('rid', 'email', 'uid'),
328 );
329
330 $schema['rsvp_realname'] = array(
331 'description' => t('Mappings from users to real name '),
332 'fields' => array(
333 'email' => array(
334 'description' => ('Guests e-mail'),
335 'type' => 'varchar',
336 'length' => 128,
337 'default' => ''
338 ),
339 'realname' => array(
340 'description' => ('The Real name of a user'),
341 'type' => 'varchar',
342 'length' => 128,
343 'default' => ''
344 ),
345 ),
346 'primary key' => array('email'),
347 );
348
349 // check the event module weight:
350 $event_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'event'"));
351 // check the date module weight:
352 $date_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'date'"));
353 // make RSVP execute after event/date:
354 db_query("UPDATE {system} SET weight = %d+1 WHERE name = 'rsvp'", max($event_weight, $date_weight));
355
356 return $schema;
357 }
358
359 function rsvp_uninstall() {
360 drupal_uninstall_schema('rsvp');
361
362 variable_del('rsvp_connector');
363 variable_del('rsvp_content_types');
364 variable_del('rsvp_from_address');
365 variable_del('rsvp_for_expired_event');
366
367 foreach (array('max_guests', 'open_invitation', 'disable_maybe', 'send_privatemsg',
368 'send_conf_guest', 'send_conf_owner',
369 'rsvp_view_roles', 'response_view_roles', 'response_blind', 'response_blind_node',
370 'reply_blind_node', 'attendees_visible', 'list_email', 'allow_invite',
371 'text_whoiscoming', 'text_yes', 'text_no', 'text_maybe', 'theme', 'stylesheet', 'iconset', 'backgroundimage', 'image') as $key) {
372
373 variable_del('rsvp_default_' . $key);
374 }
375
376 global $rsvp_mailer_ops;
377 foreach ($rsvp_mailer_ops as $op => $op_name) {
378 variable_del("rsvp_default_mailer_{$op}_subject");
379 variable_del("rsvp_default_mailer_{$op}_message");
380 }
381
382 }
383
384 function rsvp_update_6000() {
385
386 $ret = array();
387
388 db_add_field($ret, 'rsvp', 'startdate', array(
389 'description' => ('The startdate related to this invitation'),
390 'type' => 'int',
391 'unsigned' => TRUE,
392 'not null' => TRUE,
393 'default' => '0'
394 )
395 );
396
397 db_change_field($ret, 'rsvp', 'timestamp', 'timestamp', array(
398 'description' => ('Records the last update time'),
399 'type' => 'int',
400 'unsigned' => TRUE,
401 'not null' => TRUE,
402 'default' => '0'
403 )
404 );
405
406 db_change_field($ret, 'rsvp', 'blind', 'response_blind', array(
407 'description' => ('Defines whether responses (result) of rsvp is visible or not, and when it becomes visible.'),
408 'type' => 'int',
409 'size' => 'tiny',
410 'unsigned' => TRUE,
411 'not null' => TRUE,
412 'default' => '0'
413 )
414 );
415
416 db_add_field($ret, 'rsvp', 'attendees_visible', array(
417 'description' => ('Defines whether attendees are visible to other users or not, and when they become visible'),
418 'type' => 'int',
419 'size' => 'tiny',
420 'unsigned' => TRUE,
421 'not null' => TRUE,
422 'default' => '0'
423 )
424 );
425
426
427 db_change_field($ret, 'rsvp_invite', 'timestamp', 'timestamp', array(
428 'description' => ('Records the last update time'),
429 'type' => 'int',
430 'unsigned' => TRUE,
431 'not null' => TRUE,
432 'default' => '0'
433 )
434
435 );
436
437 db_add_field($ret, 'rsvp_invite', 'comment', array(
438 'description' => ('Response Comment'),
439 'type' => 'text',
440 )
441 );
442
443 return $ret;
444
445 }
446
447 function rsvp_update_6001() {
448
449 $ret = array();
450
451 db_add_field($ret, 'rsvp', 'text_whoiscoming', array(
452 'description' => ('The text that is being shown instead of the "Responses" text'),
453 'type' => 'varchar',
454 'length' => 128,
455 'default' => 'Responses'
456 )
457 );
458 db_add_field($ret, 'rsvp', 'text_yes', array(
459 'description' => ('The text that is being shown instead of the "Yes" text'),
460 'type' => 'varchar',
461 'length' => 128,
462 'default' => 'Yes'
463 )
464 );
465 db_add_field($ret, 'rsvp', 'text_no', array(
466 'description' => ('The text that is being shown instead of the "No" text'),
467 'type' => 'varchar',
468 'length' => 128,
469 'default' => 'No'
470 )
471 );
472 db_add_field($ret, 'rsvp', 'text_maybe', array(
473 'description' => ('The text that is being shown instead of the "Maybe" text'),
474 'type' => 'varchar',
475 'length' => 128,
476 'default' => 'Maybe'
477 )
478 );
479 db_add_field($ret, 'rsvp_invite', 'inviteehash', array(
480 'description' => ('The hash of the user that invited this person. (Only set if it was not the owner of the rsvp who invited this user)'),
481 'type' => 'varchar',
482 'length' => 255,
483 'default' => '',
484 )
485 );
486 db_add_field($ret, 'rsvp_invite', 'totalguests', array(
487 'description' => ('The total number of guests the attendee brings'),
488 'type' => 'int',
489 'size' => 'tiny',
490 'unsigned' => TRUE,
491 'not null' => TRUE,
492 'default' => '1'
493 )
494 );
495
496 return $ret;
497
498 }
499
500 function rsvp_update_6002() {
501
502 $ret = array();
503
504 db_add_field($ret, 'rsvp', 'response_view_roles', array(
505 'description' => ('Comma seperated list of roles that have permissions to view the guest list'),
506 'type' => 'varchar',
507 'length' => 128,
508 'default' => ''
509 )
510 );
511 db_add_field($ret, 'rsvp', 'uid_moderator', array(
512 'description' => ('The {user}.uid identifier of a possible moderator'),
513 'type' => 'int',
514 'unsigned' => TRUE,
515 'default' => '0'
516 )
517 );
518
519 db_add_field($ret, 'rsvp', 'response_blind_node', array(
520 'description' => ('Defines whether responses (result) of rsvp is visible on the event(node) or not, and when it becomes visible.'),
521 'type' => 'int',
522 'size' => 'tiny',
523 'unsigned' => TRUE,
524 'not null' => TRUE,
525 'default' => '0'
526 )
527 );
528 db_add_field($ret, 'rsvp', 'reply_blind_node', array(
529 'description' => ('Defines whether the replybox of rsvp can be seen below the event(node).'),
530 'type' => 'int',
531 'size' => 'tiny',
532 'unsigned' => TRUE,
533 'not null' => TRUE,
534 'default' => '0'
535 )
536 );
537
538 return $ret;
539
540 }
541
542 function rsvp_update_6003() {
543
544 $ret = array();
545
546 db_add_field($ret, 'rsvp', 'rsvp_view_roles', array(
547 'description' => ('Comma seperated list of roles that have permissions to view the invitation'),
548 'type' => 'varchar',
549 'length' => 128,
550 'default' => ''
551 )
552 );
553
554 return $ret;
555
556 }
557
558 function rsvp_update_6200() {
559
560 $ret = array();
561
562 db_add_field($ret, 'rsvp', 'send_conf_owner', array(
563 'description' => ('Send confirmation emails to owner when guest replies'),
564 'type' => 'int',
565 'size' => 'tiny',
566 'unsigned' => TRUE,
567 'not null' => TRUE,
568 'default' => '0'
569 )
570 );
571
572 db_add_field($ret, 'rsvp', 'send_conf_guest', array(
573 'description' => ('Send confirmation emails to guest when he replies'),
574 'type' => 'int',
575 'size' => 'tiny',
576 'unsigned' => TRUE,
577 'not null' => TRUE,
578 'default' => '0'
579 )
580 );
581 db_add_field($ret, 'rsvp', 'send_privatemsg', array(
582 'description' => ('Send emails by privatemsg for registered users'),
583 'type' => 'int',
584 'size' => 'tiny',
585 'unsigned' => TRUE,
586 'not null' => TRUE,
587 'default' => '0'
588 )
589 );
590
591 db_add_field($ret, 'rsvp', 'disable_maybe', array(
592 'description' => ('Allow maybe as answer or not.'),
593 'type' => 'int',
594 'size' => 'tiny',
595 'unsigned' => TRUE,
596 'not null' => TRUE,
597 'default' => '0'
598 )
599 );
600
601 db_add_field($ret, 'rsvp', 'reply_startdate', array(
602 'description' => ('Determines when guests can start replying'),
603 'type' => 'int',
604 'unsigned' => TRUE,
605 'not null' => TRUE,
606 'default' => '0'
607 )
608 );
609 db_add_field($ret, 'rsvp', 'reply_enddate', array(
610 'description' => ('Determines when guests can not reply anymore'),
611 'type' => 'int',
612 'unsigned' => TRUE,
613 'not null' => TRUE,
614 'default' => '0'
615 )
616 );
617 db_add_field($ret, 'rsvp', 'open_invitation', array(
618 'description' => ('Can other registered users signup to the invitation'),
619 'type' => 'int',
620 'size' => 'tiny',
621 'unsigned' => TRUE,
622 'not null' => TRUE,
623 'default' => '0'
624 )
625 );
626 db_add_field($ret, 'rsvp', 'max_guests', array(
627 'description' => ('The maximum number of guests allowed to attend'),
628 'type' => 'int',
629 'unsigned' => TRUE,
630 'not null' => TRUE,
631 'default' => '0'
632 )
633 );
634 db_add_field($ret, 'rsvp', 'theme', array(
635 'description' => ('The theme that is being used for the invitation'),
636 'type' => 'varchar',
637 'length' => 128,
638 'default' => ''
639 )
640 );
641
642 db_add_field($ret, 'rsvp', 'stylesheet', array(
643 'description' => ('The style that the theme is beeing displayed with'),
644 'type' => 'varchar',
645 'length' => 128,
646 'default' => ''
647 )
648 );
649 db_add_field($ret, 'rsvp', 'iconset', array(
650 'description' => ('The iconset that the theme is beeing using'),
651 'type' => 'varchar',
652 'length' => 128,
653 'default' => ''
654 )
655 );
656 db_add_field($ret, 'rsvp', 'invite_filterformat', array(
657 'description' => ('RSVP body filter format'),
658 'type' => 'int',
659 'size' => 'tiny',
660 'unsigned' => TRUE,
661 'default' => '0'
662 )
663 );
664
665 db_add_field($ret, 'rsvp', 'backgroundimage', array(
666 'description' => ('The backgroundimage that the theme is using'),
667 'type' => 'varchar',
668 'length' => 128,
669 'default' => ''
670 )
671 );
672 db_add_field($ret, 'rsvp', 'image', array(
673 'description' => ('The image that the theme is using'),
674 'type' => 'varchar',
675 'length' => 128,
676 'default' => ''
677 )
678 );
679
680
681 $schema['rsvp_realname'] = array(
682 'description' => t('Mappings from users to real name '),
683 'fields' => array(
684 'email' => array(
685 'description' => ('Guests e-mail'),
686 'type' => 'varchar',
687 'length' => 128,
688 'default' => ''
689 ),
690 'realname' => array(
691 'description' => ('The Real name of a user'),
692 'type' => 'varchar',
693 'length' => 128,
694 'default' => ''
695 ),
696 ),
697 'primary key' => array('email'),
698 );
699
700 if (!db_table_exists('rsvp_realname')) {
701 db_create_table($ret, 'rsvp_realname', $schema['rsvp_realname']);
702 }
703
704 return $ret;
705
706 }
707
708 /**
709 * Implementation of hook_enable().
710 */
711 function rsvp_enable() {
712
713 $path = file_directory_path(); // returns e.g. 'sites/default/files'
714
715 //create default folder for user generated themes if not available
716 $rsvp_path = file_create_path('rsvp');
717 if ($rsvp_path == false) {
718 drupal_set_message(t('The directory %dir must exist and be writable by Drupal.', array('%dir' => $path . '/rsvp')), 'error');
719 return;
720 file_check_directory($rsvp_path, FILE_CREATE_DIRECTORY, NULL);
721
722 $rsvptheme_path = file_create_path('rsvp/themes');
723 if ($rsvptheme_path != false) {
724 file_check_directory($rsvptheme_path, FILE_CREATE_DIRECTORY, NULL);
725 }
726
727 }
728
729
730 $connector = variable_get('rsvp_connector', NULL);
731 if (isset($connector) && $connector != 'event' ) {
732 drupal_set_message(t('RSVP event connector: It is not permitted to enable multiple RSVP connectors. RSVP connector %conn already enabled. Disable and uninstall other connector first. Then enable this connector again.', array('%conn' => $connector)), 'error');
733 }
734 else {
735 variable_set('rsvp_connector', 'event');
736 variable_set('rsvp_content_types', array('event' => ''));
737 }
738
739 }
740 /*US
741 $path = file_directory_path();
742 $temp = file_directory_temp();
743 // Note: pass by reference
744 if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
745 */
746
747
748 /**
749 * Implementation of hook_requirements().
750 * Make sure theme path exists.
751 */
752 /*
753 function rsvp_requirements($phase) {
754
755 $requirements = array();
756
757 $t = get_t();
758 $title = $t('RSVP requirements');
759 $severity = REQUIREMENT_ERROR;
760
761
762 switch ($phase) {
763 case 'runtime':
764 $event=module_exists('rsvp_eventconnector');
765 $date=module_exists('rsvp_dateconnector');
766 $error = FALSE;
767 if ($event = FALSE && $date = FALSE) {
768 $error = TRUE;
769 $severity = REQUIREMENT_ERROR;
770 $value = $t('The RSVP module requires that at least one rsvp connector module is enabled.', array('!link' => l($t('RSVP'), 'admin/build/modules')));
771 }
772 if ($error) {
773 $requirements['connector'] = array(
774 'title' => $t('RSVP requirements'),
775 'value' => $value,
776 'severity' => $severity,
777 );
778 }
779 break;
780 case 'install':
781 $path = file_directory_path(); // returns e.g. 'sites/default/files'
782
783 $check = file_check_directory($path . RSVP_THEME_PATH);
784 if ($check == false) {
785 $requirements[] = array(
786 'title' => $title, 'severity' => $severity,
787 'value' => t('The directory %dir does not exist. This is not a problem ', array('%dir' => $rsvp_path . '/rsvp')),
788 );
789 break;
790 }
791
792
793 //create default folder for user generated themes if not available
794 $rsvp_path = file_create_path('rsvp');
795 if ($rsvp_path == false) {
796 $requirements[] = array(
797 'title' => $title, 'severity' => $severity,
798 'value' => t('The directory %dir must exist and be writable by Drupal.', array('%dir' => $path . '/rsvp')),
799 );
800 break;
801 }
802
803 $check = file_check_directory($rsvp_path, FILE_CREATE_DIRECTORY, NULL);
804 if ($check == false) {
805 $requirements[] = array(
806 'title' => $title, 'severity' => $severity,
807 'value' => t('The directory %dir is not accessible or could not be created .', array('%dir' => $rsvp_path . '/rsvp')),
808 );
809 break;
810 }
811
812 $rsvptheme_path = file_create_path('rsvp/theme');
813 if ($rsvptheme_path == false) {
814 $requirements[] = array(
815 'title' => $title, 'severity' => $severity,
816 'value' => t('The directory %dir must exist .', array('%dir' => $path . '/rsvp/theme')),
817 );
818
819
820
821
822 file_check_directory($rsvptheme_path, FILE_CREATE_DIRECTORY, NULL);
823 }
824
825 }
826
827
828 break;
829 }
830 return $requirements;
831 }
832 */
833

  ViewVC Help
Powered by ViewVC 1.1.2