You are here

function certificate_test_certificate_map in Certificate 3.x

Same name and namespace in other branches
  1. 8.3 modules/certificate_test/certificate_test.module \certificate_test_certificate_map()
  2. 6.2 modules/certificate_test/certificate_test.module \certificate_test_certificate_map()
  3. 7.3 modules/certificate_test/certificate_test.module \certificate_test_certificate_map()
  4. 7.2 modules/certificate_test/certificate_test.module \certificate_test_certificate_map()

Implements certificate_map().

File

modules/certificate_test/certificate_test.module, line 21

Code

function certificate_test_certificate_map($node, $user, $map_type, $options) {
  if ($map_type == 'firstletter') {
    foreach ($options as $option) {

      // User selected $option
      if ($user->name[0] == $option) {

        // User's first letter matched selected options.
        return $option;
      }
    }
  }
}