certificate_test.module in Certificate 6.2
File
modules/certificate_test/certificate_test.module
View source
<?php
function certificate_test_certificate_map_options() {
for ($i = 65; $i <= 90; $i++) {
$char = chr($i);
$chars[$char] = $char;
}
return array(
'firstletter' => $chars,
);
}
function certificate_test_certificate_map($node, $user, $map_type, $options) {
if ($map_type == 'firstletter') {
foreach ($options as $option) {
if ($user->name[0] == $option) {
return $option;
}
}
}
}
function certificate_test_access_certificate($node, $user) {
if ($node->type == 'certificate_activity') {
if (isset($GLOBALS['certificate_ok']) || isset($_GET['certificate_ok'])) {
return TRUE;
}
else {
return 'Custom access denied message.';
}
}
}