| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Metricool\Features\Notifications\Notices; |
| 6 |
|
| 7 |
use Metricool\Support\Helpers\MetricoolUrl; |
| 8 |
use Metricool\Support\Helpers\Storages\EnvironmentConfig; |
| 9 |
|
| 10 |
class ExampleConnectionsWarning extends AbstractNotice |
| 11 |
{ |
| 12 |
public const IDENTIFIER = 'example_connections_warning'; |
| 13 |
protected bool $active = true; |
| 14 |
|
| 15 |
private EnvironmentConfig $env; |
| 16 |
|
| 17 |
public function __construct(EnvironmentConfig $env) |
| 18 |
{ |
| 19 |
$this->env = $env; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* @inheritDoc |
| 24 |
*/ |
| 25 |
public function getTitle(): string |
| 26 |
{ |
| 27 |
return __('This notice is a warning.', 'metricool'); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* @inheritDoc |
| 32 |
*/ |
| 33 |
public function getText(): string |
| 34 |
{ |
| 35 |
return __('This notice is a warning.', 'metricool'); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* @inheritDoc |
| 40 |
*/ |
| 41 |
public function getType(): string |
| 42 |
{ |
| 43 |
return self::TYPE_WARNING; |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* @inheritDoc |
| 48 |
*/ |
| 49 |
public function getRoute(): string |
| 50 |
{ |
| 51 |
return 'general'; |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* @inheritDoc |
| 56 |
*/ |
| 57 |
public function getAction(): array |
| 58 |
{ |
| 59 |
return [ |
| 60 |
'text' => __('Connect', 'metricool'), |
| 61 |
'link' => MetricoolUrl::adminUrl($this->env->getUrl('metricool.connect_network_url')), |
| 62 |
'target' => '_blank', |
| 63 |
]; |
| 64 |
} |
| 65 |
} |
| 66 |
|