dev/core#2197 Deploy monaco-editor using composer.json / composer downloads method
[civicrm-core.git] / ext / afform / html / afform_html.php
CommitLineData
a807dfa4
TO
1<?php
2
3require_once 'afform_html.civix.php';
4use CRM_AfformHtml_ExtensionUtil as E;
5
16263175 6if (!defined('AFFORM_HTML_MONACO')) {
e1cb865e 7 define('AFFORM_HTML_MONACO', 'bower_components/monaco-editor/min/vs');
16263175
TO
8}
9
a807dfa4
TO
10/**
11 * Implements hook_civicrm_config().
12 *
13 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
14 */
15function afform_html_civicrm_config(&$config) {
16 _afform_html_civix_civicrm_config($config);
17}
18
19/**
20 * Implements hook_civicrm_xmlMenu().
21 *
22 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
23 */
24function afform_html_civicrm_xmlMenu(&$files) {
25 _afform_html_civix_civicrm_xmlMenu($files);
26}
27
28/**
29 * Implements hook_civicrm_install().
30 *
31 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
32 */
33function afform_html_civicrm_install() {
34 _afform_html_civix_civicrm_install();
35}
36
37/**
38 * Implements hook_civicrm_postInstall().
39 *
40 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall
41 */
42function afform_html_civicrm_postInstall() {
43 _afform_html_civix_civicrm_postInstall();
44}
45
46/**
47 * Implements hook_civicrm_uninstall().
48 *
49 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
50 */
51function afform_html_civicrm_uninstall() {
52 _afform_html_civix_civicrm_uninstall();
53}
54
55/**
56 * Implements hook_civicrm_enable().
57 *
58 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
59 */
60function afform_html_civicrm_enable() {
61 _afform_html_civix_civicrm_enable();
62}
63
64/**
65 * Implements hook_civicrm_disable().
66 *
67 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
68 */
69function afform_html_civicrm_disable() {
70 _afform_html_civix_civicrm_disable();
71}
72
73/**
74 * Implements hook_civicrm_upgrade().
75 *
76 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
77 */
78function afform_html_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
79 return _afform_html_civix_civicrm_upgrade($op, $queue);
80}
81
82/**
83 * Implements hook_civicrm_managed().
84 *
85 * Generate a list of entities to create/deactivate/delete when this module
86 * is installed, disabled, uninstalled.
87 *
88 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
89 */
90function afform_html_civicrm_managed(&$entities) {
91 _afform_html_civix_civicrm_managed($entities);
92}
93
94/**
95 * Implements hook_civicrm_caseTypes().
96 *
97 * Generate a list of case-types.
98 *
99 * Note: This hook only runs in CiviCRM 4.4+.
100 *
101 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
102 */
103function afform_html_civicrm_caseTypes(&$caseTypes) {
104 _afform_html_civix_civicrm_caseTypes($caseTypes);
105}
106
107/**
108 * Implements hook_civicrm_angularModules().
109 *
110 * Generate a list of Angular modules.
111 *
112 * Note: This hook only runs in CiviCRM 4.5+. It may
113 * use features only available in v4.6+.
114 *
115 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules
116 */
117function afform_html_civicrm_angularModules(&$angularModules) {
118 _afform_html_civix_civicrm_angularModules($angularModules);
119}
120
121/**
122 * Implements hook_civicrm_alterSettingsFolders().
123 *
124 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
125 */
126function afform_html_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
127 _afform_html_civix_civicrm_alterSettingsFolders($metaDataFolders);
128}
129
130/**
131 * Implements hook_civicrm_entityTypes().
132 *
133 * Declare entity types provided by this module.
134 *
135 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes
136 */
137function afform_html_civicrm_entityTypes(&$entityTypes) {
138 _afform_html_civix_civicrm_entityTypes($entityTypes);
139}
140
0a496a3f
TO
141/**
142 * Implements hook_civicrm_themes().
143 */
144function afform_html_civicrm_themes(&$themes) {
145 _afform_html_civix_civicrm_themes($themes);
146}
147
01a82cc7
TO
148/**
149 * Implements hook_civicrm_check().
150 */
151function afform_html_civicrm_check(&$messages) {
16263175 152 $dir = E::path(AFFORM_HTML_MONACO);
01a82cc7
TO
153 if (!file_exists($dir)) {
154 $messages[] = new CRM_Utils_Check_Message(
155 'afform_html_monaco',
e1cb865e 156 ts('Afform HTML is missing its "bower_components" folder. Please consult the README.md for current installation instructions.'),
01a82cc7
TO
157 ts('Afform HTML: Packages are missing'),
158 \Psr\Log\LogLevel::CRITICAL,
159 'fa-chain-broken'
160 );
161 }
162}