-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDropInLocations.php
More file actions
108 lines (103 loc) · 5.62 KB
/
Copy pathDropInLocations.php
File metadata and controls
108 lines (103 loc) · 5.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
namespace TotaraInstaller\installers;
/**
* Map of keys to drop in locations
*/
trait DropInLocations {
/**
* Locations of Totara plugin entrypoints
*
* @var array|string[]
*/
protected static array $drop_in_locations = array(
'aggregation' => 'server/totara/competency/aggregation/{$name}',
'ai' => 'server/integrations/ai/{$name}',
'antivirus' => 'server/lib/antivirus/{$name}',
'approvalform' => 'server/mod/approval/form/{$name}',
'assignfeedback' => 'server/mod/assign/feedback/{$name}',
'assignsubmission' => 'server/mod/assign/submission/{$name}',
'atto' => 'server/lib/editor/atto/plugins/{$name}',
'auth' => 'server/auth/{$name}',
'availability' => 'server/availability/condition/{$name}',
'bi' => 'server/integrations/bi/{$name}',
'block' => 'server/blocks/{$name}',
'booktool' => 'server/mod/book/tool/{$name}',
'cachelock' => 'server/cache/locks/{$name}',
'cachestore' => 'server/cache/stores/{$name}',
'calendartype' => 'server/calendar/type/{$name}',
'client' => 'client/component/{$name}',
'container' => 'server/container/type/{$name}',
'contentmarketplace' => 'server/totara/contentmarketplace/contentmarketplaces/{$name}',
'contentmarketplaceactivity' => 'server/mod/contentmarketplace/contentmarketplaces/{$name}',
'coursereport' => 'server/course/report/{$name}',
'criteria' => 'server/totara/criteria/plugins/{$name}',
'customfield' => 'server/totara/customfield/field/{$name}',
'datafield' => 'server/mod/data/field/{$name}',
'dataformat' => 'server/dataformat/{$name}',
'datapreset' => 'server/mod/data/preset/{$name}',
'dev' => 'dev/{$name}',
'editor' => 'server/lib/editor/{$name}',
'engage' => 'server/totara/engage/resources/{$name}',
'enrol' => 'server/enrol/{$name}',
'filter' => 'server/filter/{$name}',
'flavour' => 'server/totara/flavour/flavours/{$name}',
'format' => 'server/course/format/{$name}',
'goaltype' => 'server/perform/goal/type/{$name}',
'gradeexport' => 'server/grade/export/{$name}',
'gradeimport' => 'server/grade/import/{$name}',
'gradereport' => 'server/grade/report/{$name}',
'gradingform' => 'server/grade/grading/form/{$name}',
'hierarchy' => 'server/totara/hierarchy/prefix/{$name}',
'jsoneditor' => 'server/text_format/json_editor/extensions/{$name}',
'local' => 'server/local/{$name}',
'logstore' => 'server/admin/tool/log/store/{$name}',
'ltisource' => 'server/mod/lti/source/{$name}',
'ltiservice' => 'server/mod/lti/service/{$name}',
'media' => 'server/media/player/{$name}',
'message' => 'server/message/output/{$name}',
'mfa' => 'server/mfa/factors/{$name}',
'ml' => 'server/ml/{$name}',
'mobile' => 'server/totara/mobile/plugins/{$name}',
'mod' => 'server/mod/{$name}',
'pathway' => 'server/totara/competency/pathway/{$name}',
'perform' => 'server/perform/{$name}',
'performelement' => 'server/mod/perform/element/{$name}',
'plagiarism' => 'server/plagiarism/{$name}',
'portfolio' => 'server/portfolio/{$name}',
'profilefield' => 'server/user/profile/field/{$name}',
'qbehaviour' => 'server/question/behaviour/{$name}',
'qformat' => 'server/question/format/{$name}',
'qtype' => 'server/question/type/{$name}',
'quizaccess' => 'server/mod/quiz/accessrule/{$name}',
'quiz' => 'server/mod/quiz/report/{$name}',
'report' => 'server/report/{$name}',
'repository' => 'server/repository/{$name}',
'scormreport' => 'server/mod/scorm/report/{$name}',
'search' => 'server/search/engine/{$name}',
'tabexport' => 'server/totara/core/tabexport/{$name}',
'theme' => 'server/theme/{$name}',
'tool' => 'server/admin/tool/{$name}',
'totara' => 'server/totara/{$name}',
'virtualmeeting' => 'server/integrations/virtualmeeting/{$name}',
'webservice' => 'server/webservice/{$name}',
'weka' => 'server/lib/editor/weka/extensions/{$name}',
'workshopallocation' => 'server/mod/workshop/allocation/{$name}',
'workshopeval' => 'server/mod/workshop/eval/{$name}',
'workshopform' => 'server/mod/workshop/form/{$name}',
// Available from Totara 20.1/21 onwards
'mailer' => 'server/mailer/{$name}',
);
/**
* Returns the path (if matched) with no ending slash
*
* @param string $packageType
* @return string|null
*/
protected static function getLocationFromPackageType(string $packageType): ?string {
if (preg_match('/^totara-([a-z]+)$/', $packageType, $matches)) {
$key = strtolower($matches[1]);
return self::$drop_in_locations[$key] ?? null;
}
return null;
}
}