| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
#[AllowDynamicProperties] |
| 3 |
class SH4_Conf_Html_Admin_Controller_ShiftStatus |
| 4 |
{ |
| 5 |
public function __construct( |
| 6 |
HC3_Hooks $hooks, |
| 7 |
HC3_Post $post, |
| 8 |
HC3_Settings $settings |
| 9 |
) |
| 10 |
{ |
| 11 |
$this->post = $hooks->wrap($post); |
| 12 |
$this->settings = $hooks->wrap($settings); |
| 13 |
} |
| 14 |
|
| 15 |
public function execute() |
| 16 |
{ |
| 17 |
$take = array( |
| 18 |
'shifts_no_draft', 'shifts_confirm_publish' |
| 19 |
); |
| 20 |
|
| 21 |
foreach( $take as $k ){ |
| 22 |
$v = $this->post->get($k); |
| 23 |
$this->settings->set( $k, $v ); |
| 24 |
} |
| 25 |
|
| 26 |
$return = array( 'admin/conf/shiftstatus', '__Settings Updated__' ); |
| 27 |
return $return; |
| 28 |
} |
| 29 |
} |