forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptBuilderManager.php
More file actions
40 lines (35 loc) · 1.09 KB
/
Copy pathScriptBuilderManager.php
File metadata and controls
40 lines (35 loc) · 1.09 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
<?php
namespace ProcessMaker\Managers;
class ScriptBuilderManager
{
private $javascriptRegistry;
/**
* Start our script builder manager, registering our initial javascript
* which will add our intial node types to the script builder (base bpmn types/shapes)
*/
public function __construct()
{
$this->javascriptRegistry = [];
}
/**
* Add a new script to the script builder load. These scripts can then interact with the script builder
* during it's startup lifecycle to do this such as register new node types.
*
* @param string $script Path to the javascript to load
* @return void
*/
public function addScript($script)
{
$this->javascriptRegistry[] = $script;
}
/**
* Retrieve the list of scripts that have been added. This is used in the script builder blade
* to execute each script in a script tag before the script builder is started.
*
* @return array Collection of paths to scripts to load
*/
public function getScripts()
{
return $this->javascriptRegistry;
}
}