Skip to content

Commit 53d951d

Browse files
Converts the ISCED code list to a service; converts the widget and formatter to use the service
1 parent 380b015 commit 53d951d

File tree

6 files changed

+287
-256
lines changed

6 files changed

+287
-256
lines changed

isced_code.module

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,3 @@ function isced_code_help($route_name, RouteMatchInterface $route_match) {
2222
default:
2323
}
2424
}
25-
26-
/**
27-
* Get ISCED codes.
28-
*
29-
* Get associative array of ISCED codes from a source file.
30-
*
31-
* @return array $options
32-
*/
33-
function isced_code_get_values() {
34-
$source_file = 'isced_codes.inc';
35-
include $source_file;
36-
37-
$options = [];
38-
foreach ($isced_codes as $broad => $narrow_array) {
39-
$group = [];
40-
foreach ($narrow_array as $narrow => $detailed_array) {
41-
// Don't print the narrow field at all...
42-
//$narrow_key = substr($narrow, 0, 3);
43-
//$group[$narrow_key] = $narrow;
44-
foreach ($detailed_array as $key => $value) {
45-
$group[$key] = $value;
46-
}
47-
}
48-
$options[$broad] = $group;
49-
}
50-
51-
return $options;
52-
}

isced_code.services.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
services:
2+
isced_code.isced_code:
3+
class: Drupal\isced_code\IscedCodeManager
4+
arguments: []

isced_codes.inc

Lines changed: 0 additions & 226 deletions
This file was deleted.

0 commit comments

Comments
 (0)