forked from InfotelGLPI/vip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvip_load_scripts.js.php
More file actions
34 lines (28 loc) · 873 Bytes
/
vip_load_scripts.js.php
File metadata and controls
34 lines (28 loc) · 873 Bytes
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
<?php
use Glpi\Event;
header('Content-Type: text/javascript');
?>
var root_vip_doc = "<?php echo $CFG_GLPI['root_doc'] . '/plugins/vip'; ?>";
(function ($) {
$.fn.vip_load_scripts = function () {
init();
// Start the plugin
function init() {
// Send data
$.ajax({
url: root_vip_doc +'/ajax/loadscripts.php',
type: "POST",
dataType: "html",
data: 'action=load',
success: function (response, opts) {
var scripts, scriptsFinder = /<script[^>]*>([\s\S]+?)<\/script>/gi;
while (scripts = scriptsFinder.exec(response)) {
eval(scripts[1]);
}
}
});
}
return this;
};
}(jQuery));
$(document).vip_load_scripts();