-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathace_editor.module
More file actions
62 lines (55 loc) · 1.71 KB
/
Copy pathace_editor.module
File metadata and controls
62 lines (55 loc) · 1.71 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
<?php
/**
* @file
* This file is used to write hooks that used in the module.
*/
use Drupal\ace_editor\AceEditorLibraries;
use Drupal\ace_editor\Hook\AceEditorHooks;
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
#[LegacyHook]
function ace_editor_help($route_name, RouteMatchInterface $route_match) {
return \Drupal::service(AceEditorHooks::class)->help($route_name, $route_match);
}
/**
* Verifies that Ace library is present.
*
* The library is searched in the directory DRUPAL_ROOT/libraries.
* DRUPAL_ROOT/libraries is recommended for storing external libraries.
* For preserving backwards compatibility, ace_editor/libraries is also checked.
*
* @return string|false
* The path of the directory holding ace.js, or FALSE when the library is
* not installed.
*/
function ace_editor_lib_path() {
return \Drupal::service(AceEditorLibraries::class)->libPath();
}
/**
* Implements hook_library_info_build().
*
* Selects all theme and mode files from ace editor external library and add it
* to drupal library.
*/
#[LegacyHook]
function ace_editor_library_info_build() {
return \Drupal::service(AceEditorHooks::class)->libraryInfoBuild();
}
/**
* Implements hook_library_info_alter().
*/
#[LegacyHook]
function ace_editor_library_info_alter(&$libraries, $extension) {
\Drupal::service(AceEditorHooks::class)->libraryInfoAlter($libraries, $extension);
}
/**
* Implements hook_js_settings_alter().
*/
#[LegacyHook]
function ace_editor_js_settings_alter(array &$settings, AttachedAssetsInterface $assets) {
\Drupal::service(AceEditorHooks::class)->jsSettingsAlter($settings, $assets);
}