forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelerManager.php
More file actions
41 lines (37 loc) · 1.18 KB
/
ModelerManager.php
File metadata and controls
41 lines (37 loc) · 1.18 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
<?php
namespace ProcessMaker\Managers;
class ModelerManager
{
private $javascriptRegistry;
/**
* Start our modeler manager, registering our initial javascript
* which will add our intial node types to the modeler (base bpmn types/shapes)
*/
public function __construct()
{
$this->javascriptRegistry = [];
// Include our default javascript for our core controls
$this->addScript(mix('js/processes/modeler/initialLoad.js'));
}
/**
* Add a new script to the modeler load. These scripts can then interact with the modeler
* 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 modeler blade
* to execute each script in a script tag before the modeler is started.
*
* @return array Collection of paths to scripts to load
*/
public function getScripts()
{
return $this->javascriptRegistry;
}
}