-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathyui.module
54 lines (49 loc) · 1.29 KB
/
yui.module
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
<?php
/**
* @file
* A Drupal wrapper for the Yahoo YUI Javascript Library.
*/
define('YUI_RAW_COMPRESSION', 'raw');
define('YUI_MIN_COMPRESSION', 'min');
define('YUI_DEBUG_COMPRESSION', 'debug');
/**
* Implements hook_menu().
*/
function yui_menu() {
return array(
'admin/islandora/yui' => array(
'title' => 'Yahoo YUI Settings',
'description' => 'Yahoo YUI Settings.',
'file' => 'includes/admin.form.inc',
'page callback' => 'drupal_get_form',
'page arguments' => array('yui_admin_settings_form', 3),
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
),
);
}
/**
* Includes YUI seed javascript file.
*
* Uses YUI ability to asynchronously load the javascript files it requires.
* Typically this is all that you require.
*
* This shouldn't be used in conjunction with yui_add().
*/
function yui_add_seed() {
module_load_include('inc', 'yui', 'includes/utilities');
yui_add_file('yui');
}
/**
* Adds the given yui modules.
*
* @param array $files
* The YUI file/components to include.
*/
function yui_add($files = array()) {
module_load_include('inc', 'yui', 'includes/utilities');
$files = is_array($files) ? $files : array($files);
foreach ($files as $file) {
yui_add_file($file);
}
}