summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/hooks/translation.inc.php
blob: e83dfd2de32472ab67e3a813a2dcbf4555f211ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

$HANDLER = array();

if (Module::isAvailable('locationinfo')) {
	$HANDLER['subsections'] = array();
	foreach (CourseBackend::getList() as $backend) {
		// Define subsections
		$HANDLER['subsections'][] = 'backend-' . $backend;
		// Grep handlers to detect tags
		$HANDLER['grep_backend-' . $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;
		};
	}
}