| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
#[AllowDynamicProperties] |
| 3 |
class SH4_Notifications_Html_Admin_Controller_TurnOnOff |
| 4 |
{ |
| 5 |
public function __construct( |
| 6 |
HC3_Hooks $hooks, |
| 7 |
HC3_Post $post, |
| 8 |
HC3_Notificator $notificator |
| 9 |
) |
| 10 |
{ |
| 11 |
$this->post = $post; |
| 12 |
$this->notificator = $notificator; |
| 13 |
} |
| 14 |
|
| 15 |
public function execute() |
| 16 |
{ |
| 17 |
$isOff = $this->post->get('notifications_turnoff'); |
| 18 |
if( $isOff ){ |
| 19 |
$this->notificator->setOff(); |
| 20 |
} |
| 21 |
else { |
| 22 |
$this->notificator->setOn(); |
| 23 |
} |
| 24 |
|
| 25 |
$to = '-referrer-'; |
| 26 |
$msg = NULL; |
| 27 |
$return = array( $to, $msg ); |
| 28 |
|
| 29 |
return $return; |
| 30 |
} |
| 31 |
} |