-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlugin.php
57 lines (47 loc) · 1.49 KB
/
Plugin.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
51
52
53
54
55
56
57
<?php
namespace Kanboard\Plugin\EmbedAnything;
use Kanboard\Core\Plugin\Base;
class Plugin extends Base
{
public function initialize()
{
if(file_exists("plugins/EmbedAnything/config.php"))
{
global $embedAnythingConfigs;
require_once('plugins/EmbedAnything/config.php');
$source = "";
foreach($embedAnythingConfigs as $key => $settings){
if(!empty($settings["url"])){
$source .= $settings["url"]." ";
}
}
$source = trim($source);
if (strlen($source) > 0){
$this->setContentSecurityPolicy(array('frame-src' => $source));
}
$this->template->hook->attach('template:project-header:view-switcher', 'EmbedAnything:project_header/views');
$this->hook->on('template:layout:css', array('template' => 'plugins/EmbedAnything/Asset/main.css'));
$this->hook->on('template:layout:js', array('template' => 'plugins/EmbedAnything/Asset/main.js'));
}
}
public function getPluginName()
{
return 'EmbedAnything';
}
public function getPluginDescription()
{
return t('Embed anything into Kanboard.');
}
public function getPluginAuthor()
{
return 'Greyaz';
}
public function getPluginVersion()
{
return '0.3.0';
}
public function getPluginHomepage()
{
return 'https://github.com/greyaz/EmbedAnything';
}
}