-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plugin.php
49 lines (44 loc) · 1.29 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
<?php
namespace USOC\Plugin;
use Closure;
class ContentPlugin
{
/**
* @param string $name
* @param string $DisplayName
* @param string $Author
* @param string $infoUrl
* @param string $Url
* @param $addHandler
* @param $editHandler
* @param $deleteHandler
* @param \Closure $viewHandler
* @param bool $html
*/
public function __construct(
/**
* Name of the database table
*/
public string $name,
/**
* Name of the plugin shown for the user.
* In the best case it's a translated string.
* (It should match to "Create/Upload new ..."
* (for example "Create/Upload new blog page"))
*/
public string $DisplayName,
public string $Author,
public string $infoUrl,
public string $Url,
public ?Closure $addHandler,
public ?Closure $editHandler,
public ?Closure $deleteHandler,
public ?Closure $viewHandler,
public bool $html = true
)
{}
}
$a = new ContentPlugin("Test", "Test", "Test", "Test", "Test", function(){return "a";}, function(){}, function(){}, function(){});
$contentPlugins[] = $a;
echo ($contentPlugins[0]->addHandler)();
echo $contentPlugins[0]->addHandler->__invoke();