| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Popup Notification Type |
| 5 |
* |
| 6 |
* @package NotificationX\Types |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace NotificationX\Types; |
| 10 |
|
| 11 |
use NotificationX\Extensions\GlobalFields; |
| 12 |
use NotificationX\GetInstance; |
| 13 |
|
| 14 |
/** |
| 15 |
* Popup notification type for displaying modal-style notifications |
| 16 |
* @method static Popup get_instance($args = null) |
| 17 |
*/ |
| 18 |
class Popup extends Types { |
| 19 |
/** |
| 20 |
* Instance of Popup |
| 21 |
* |
| 22 |
* @var Popup |
| 23 |
*/ |
| 24 |
use GetInstance; |
| 25 |
|
| 26 |
public $priority = 16; // After NotificationBar (15) but before Reviews (20) |
| 27 |
public $themes = []; |
| 28 |
public $module = []; |
| 29 |
public $default_source = 'popup_notification'; |
| 30 |
public $id = 'popup'; |
| 31 |
// Theme keys are prefixed with the source id ('popup_notification_'), so the |
| 32 |
// default theme must be the fully-prefixed key. 'popup_theme-one' matched no |
| 33 |
// registered theme, leaving the initial theme invalid and breaking default |
| 34 |
// application for rules-gated fields (subtitle / coupon code). |
| 35 |
public $default_theme = 'popup_notification_theme-one'; |
| 36 |
public $link_type = 'popup_url'; |
| 37 |
|
| 38 |
/** |
| 39 |
* Initially Invoked when initialized. |
| 40 |
*/ |
| 41 |
public function __construct() { |
| 42 |
parent::__construct(); |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Runs when modules is enabled. |
| 47 |
* |
| 48 |
* @return void |
| 49 |
*/ |
| 50 |
public function init() { |
| 51 |
parent::init(); |
| 52 |
$this->title = __('Announcement', 'notificationx'); |
| 53 |
$this->dashboard_title = __('Announcement', 'notificationx'); |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Initialize popup-specific fields |
| 58 |
* |
| 59 |
* @return void |
| 60 |
*/ |
| 61 |
public function init_fields() { |
| 62 |
parent::init_fields(); |
| 63 |
// Additional field initialization can be added here |
| 64 |
} |
| 65 |
} |
| 66 |
|