forked from thecodingmachine/mouf-html.widgets.evolugrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
37 lines (29 loc) · 1.37 KB
/
install.php
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
<?php
require_once __DIR__."/../../autoload.php";
use Mouf\MoufManager;
use Mouf\Actions\InstallUtils;
InstallUtils::init(InstallUtils::$INIT_APP);
// Let's create the instances
$moufManager = MoufManager::getMoufManager();
if ($moufManager->instanceExists("evolugridLibrary")) {
$evolugridLib = $moufManager->getInstanceDescriptor("evolugridLibrary");
} else {
$evolugridLib = $moufManager->createInstance("Mouf\\Html\\Utils\\WebLibraryManager\\WebLibrary");
$evolugridLib->setName("evolugridLibrary");
}
$evolugridLib->getProperty("jsFiles")->setValue(array('vendor/mouf/html.widgets.evolugrid/js/evolugrid.js'));
if ($moufManager->has('defaultWebLibraryRenderer')) {
$renderer = $moufManager->getInstanceDescriptor('defaultWebLibraryRenderer');
$evolugridLib->getProperty("renderer")->setValue($renderer);
}
$evolugridLib->getProperty("dependencies")->setValue(array($moufManager->getInstanceDescriptor('jQueryLibrary')));
$webLibraryManager = $moufManager->getInstanceDescriptor('defaultWebLibraryManager');
if ($webLibraryManager) {
$libraries = $webLibraryManager->getProperty("webLibraries")->getValue();
$libraries[] = $evolugridLib;
$webLibraryManager->getProperty("webLibraries")->setValue($libraries);
}
// Let's rewrite the MoufComponents.php file to save the component
$moufManager->rewriteMouf();
// Finally, let's continue the install
InstallUtils::continueInstall();