-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
59 lines (48 loc) · 1.53 KB
/
Copy pathPlugin.php
File metadata and controls
59 lines (48 loc) · 1.53 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace Kanboard\Plugin\PITM;
use Kanboard\Core\Plugin\Base;
use Kanboard\Plugin\PITM\Model\PasteFileModel;
class Plugin extends Base
{
public function initialize()
{
$this->hook->on('template:layout:css', array('template' => 'plugins/PITM/Assets/css/style.css'));
$this->hook->on('template:layout:js', array('template' => 'plugins/PITM/Assets/js/PITM.js'));
$container = $this->container;
$this->hook->on('model:task:creation:aftersave', function($task_id) use ($container) {
$model = new PasteFileModel($container);
$model->moveImagesToTask($task_id);
});
$this->route->addRoute('PITM/paste', 'PasteController', 'upload', 'PITM');
}
public function getClasses()
{
return [
'Plugin\PITM\Model' => [
'PasteFileModel'
]
];
}
public function getPluginName()
{
return "PasteImageToMarkdown";
}
public function getPluginAuthor()
{
return 'Tomas Dittmann';
}
public function getPluginVersion()
{
// 1.1.0 - remove custom image box implementation: the image isn't displayed anymore in Firefox 126 & 127
// just display the result from the image controller.
return '1.1.0';
}
public function getPluginDescription()
{
return 'enable pasting images to markdown-enbaled textfields';
}
public function getPluginHomepage()
{
return "https://github.com/Chaosmeister/PITM";
}
}