-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoursewareFlow.php
50 lines (38 loc) · 1.23 KB
/
CoursewareFlow.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
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
require_once __DIR__.'/bootstrap.php';
use JsonApi\Contracts\JsonApiPlugin;
use CoursewareFlow\JsonApi\Routes;
use CoursewareFlow\JsonApi\Schemas;
class CoursewareFlow extends StudIPPlugin implements SystemPlugin, JsonApiPlugin
{
use Routes;
use Schemas;
public function __construct()
{
parent::__construct();
PageLayout::addScript($this->getPluginUrl() . '/dist/courseware-flow.js', [
'type' => 'module',
'rel' => 'preload',
]);
PageLayout::addStylesheet($this->getPluginUrl() . '/dist/courseware-flow.css');
}
public function perform($unconsumedPath)
{
// This require must be here, to prevent vendor version conflicts.
require_once __DIR__ . '/vendor/autoload.php';
$trails_root = $this->getPluginPath() . '/app';
$dispatcher = new Trails_Dispatcher($trails_root,
rtrim(PluginEngine::getURL($this, [], ''), '/'),
'index');
$dispatcher->current_plugin = $this;
$dispatcher->dispatch($unconsumedPath);
}
public function getPluginName()
{
return 'CoursewareFlow';
}
public function getInfoTemplate($courseId)
{
return null;
}
}