-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from CleanTalk/accordeon_interactive.ag
Scanner Interactivity
- Loading branch information
Showing
14 changed files
with
267 additions
and
20 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
lib/CleantalkSP/SpbctWP/Scanner/ScannerInteractivity/RefreshDataDTO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace CleantalkSP\SpbctWP\Scanner\ScannerInteractivity; | ||
|
||
use CleantalkSP\Templates\DTO; | ||
|
||
class RefreshDataDTO extends DTO | ||
{ | ||
public $do_refresh = false; | ||
public $control_tab = ''; | ||
|
||
protected $obligatory_properties = array( | ||
'do_refresh', | ||
'control_tab', | ||
); | ||
|
||
/** | ||
* @throws \Exception | ||
*/ | ||
public function __construct($data) | ||
{ | ||
parent::__construct($data); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
lib/CleantalkSP/SpbctWP/Scanner/ScannerInteractivity/ScannerInteractivityData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace CleantalkSP\SpbctWP\Scanner\ScannerInteractivity; | ||
|
||
class ScannerInteractivityData | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public static $scanner_stage; | ||
|
||
/** | ||
* @var RefreshDataDTO | ||
*/ | ||
public static $refresh_data; | ||
|
||
public static function prepare($stage, array $refresh_data) | ||
{ | ||
self::$scanner_stage = $stage; | ||
|
||
try { | ||
self::$refresh_data = new RefreshDataDTO($refresh_data); | ||
} catch (\Exception $e) { | ||
self::$refresh_data = null; | ||
} | ||
|
||
return array( | ||
'scanner_stage' => self::$scanner_stage, | ||
'refresh_data' => self::$refresh_data instanceof RefreshDataDTO | ||
? self::getDataArray(self::$refresh_data) | ||
: array(), | ||
'update_text' => __('Updated!', 'security_malware_firewall') | ||
); | ||
} | ||
|
||
public static function getDataArray(RefreshDataDTO $refresh_data) | ||
{ | ||
return array( | ||
'do_refresh' => $refresh_data->do_refresh, | ||
'control_tab' => $refresh_data->control_tab, | ||
); | ||
} | ||
} |
Oops, something went wrong.