| 1 |
<?php |
|---|
| 2 |
/* |
|---|
| 3 |
* lib.php |
|---|
| 4 |
* |
|---|
| 5 |
* Created on Apr 18, 2007 |
|---|
| 6 |
* |
|---|
| 7 |
* @author Diego Andrᅵs Ramᅵrez Aragᅵn <diego@somosmas.org> |
|---|
| 8 |
*/ |
|---|
| 9 |
|
|---|
| 10 |
function invite_init(){ |
|---|
| 11 |
global $CFG, $function; |
|---|
| 12 |
// Actions |
|---|
| 13 |
$function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_config.php"; |
|---|
| 14 |
$function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_actions.php"; |
|---|
| 15 |
|
|---|
| 16 |
// Introductory text |
|---|
| 17 |
$function['content:invite:invite'][] = $CFG->dirroot . "mod/invite/lib/content_invite.php"; |
|---|
| 18 |
|
|---|
| 19 |
// Allow user to invite a friend |
|---|
| 20 |
$function['invite:invite'][] = $CFG->dirroot . "mod/invite/lib/invite.php"; |
|---|
| 21 |
$function['invite:join'][] = $CFG->dirroot . "mod/invite/lib/invite_join.php"; |
|---|
| 22 |
|
|---|
| 23 |
// Allow a new user to sign up |
|---|
| 24 |
$function['join:no_invite'][] = $CFG->dirroot . "mod/invite/lib/join_noinvite.php"; |
|---|
| 25 |
|
|---|
| 26 |
// Allow the user to request a new password |
|---|
| 27 |
$function['invite:password:request'][] = $CFG->dirroot . "mod/invite/lib/password_request.php"; |
|---|
| 28 |
$function['invite:password:new'][] = $CFG->dirroot . "mod/invite/lib/new_password.php"; |
|---|
| 29 |
|
|---|
| 30 |
// Default pages messages |
|---|
| 31 |
$function['invite:register:default:welcome'][] = $CFG->dirroot . "mod/invite/lib/invite_register_welcome.php"; |
|---|
| 32 |
$function['invite:join:default:welcome'][] = $CFG->dirroot . "mod/invite/lib/invite_join_welcome.php"; |
|---|
| 33 |
$function['invite:join:default:footer'][] = $CFG->dirroot . "mod/invite/lib/invite_join_footer.php"; |
|---|
| 34 |
$function['invite:join:default:mailwithpass'][] = $CFG->dirroot . "mod/invite/lib/invite_join_mailwithpass.php"; |
|---|
| 35 |
$function['invite:join:default:mailwithoutpass'][] = $CFG->dirroot . "mod/invite/lib/invite_join_mailwithoutpass.php"; |
|---|
| 36 |
|
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
function invite_pagesetup() { |
|---|
| 40 |
global $PAGE, $CFG; |
|---|
| 41 |
|
|---|
| 42 |
if (defined('context') && context == 'network' && isloggedin()) { |
|---|
| 43 |
if ($CFG->publicinvite && !maxusers_limit()) { |
|---|
| 44 |
$PAGE->menu_sub[] = array( 'name' => 'invite:friend', |
|---|
| 45 |
'html' => a_href(get_url(null, 'invite::invite'), |
|---|
| 46 |
__gettext("Invite a friend"))); |
|---|
| 47 |
} |
|---|
| 48 |
} |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
function invite_url($object_id, $object_type) { |
|---|
| 52 |
$url = null; |
|---|
| 53 |
|
|---|
| 54 |
switch ($object_type) { |
|---|
| 55 |
case 'invite::': |
|---|
| 56 |
case 'invite::invite': |
|---|
| 57 |
global $CFG; |
|---|
| 58 |
$url = $CFG->wwwroot . 'mod/invite/'; |
|---|
| 59 |
break; |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|
| 62 |
return $url; |
|---|
| 63 |
} |
|---|
| 64 |
?> |
|---|