diff options
-rw-r--r-- | modules-available/locationinfo/hooks/translation.inc.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules-available/locationinfo/hooks/translation.inc.php b/modules-available/locationinfo/hooks/translation.inc.php new file mode 100644 index 00000000..a3f4edd2 --- /dev/null +++ b/modules-available/locationinfo/hooks/translation.inc.php @@ -0,0 +1,24 @@ +<?php + +$HANDLER = array(); + +if (Module::isAvailable('locationinfo')) { + $HANDLER['subsections'] = array(); + foreach (CourseBackend::getList() as $backend) { + // Define subsections + $HANDLER['subsections'][] = $backend; + // Grep handlers to detect tags + $HANDLER['grep_' . $backend] = function($module) use ($backend) { + $b = CourseBackend::getInstance($backend); + if ($b === false) + return array(); + $props = $b->getCredentialDefinitions(); + $return = array(); + foreach ($props as $prop) { + $return[$prop->property] = true; + $return[$prop->property . '_helptext'] = true; + } + return $return; + }; + } +} |