-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathExtDocButtonProvider.php
More file actions
51 lines (42 loc) · 1.02 KB
/
Copy pathExtDocButtonProvider.php
File metadata and controls
51 lines (42 loc) · 1.02 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
<?php
declare(strict_types=1);
namespace GeorgRinger\Doc\Widgets\Provider;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface;
/**
* Provide link for project documentation.
* Check whether EXT:doc is enabled and add link to module.
* No link is returned if not enabled.
*/
class ExtDocButtonProvider implements ButtonProviderInterface
{
/**
* @var string
*/
private $title;
/**
* @var string
*/
private $target;
public function __construct(string $title, string $target = '')
{
$this->title = $title;
$this->target = $target;
}
public function getTitle(): string
{
return $this->title;
}
public function getLink(): string
{
if (ExtensionManagementUtility::isLoaded('doc')) {
return 'open-docs-module';
}
return '';
}
public function getTarget(): string
{
return $this->target;
}
}