| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package RSFirewall! |
| 4 |
* @copyright (c) 2018 RSJoomla! |
| 5 |
* @link https://www.rsjoomla.com |
| 6 |
* @license GNU General Public License http://www.gnu.org/licenses/gpl-3.0.en.html |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'WPINC' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
try { |
| 14 |
$original_file = $this->model->get_remote_file(); |
| 15 |
$local_file = $this->model->get_local_file(); |
| 16 |
$filename = $this->model->get_file(); |
| 17 |
$hash = $this->model->get_hash(); |
| 18 |
|
| 19 |
?> |
| 20 |
|
| 21 |
<!-- Create a header in the default WordPress 'wrap' container --> |
| 22 |
<div class="wrap rsfirewall"> |
| 23 |
<!-- Title --> |
| 24 |
<div class="row margin-bottom-x1"> |
| 25 |
<div class="col-md-12"> |
| 26 |
<h3><?php echo esc_html__( 'File Differences', 'rsfirewall' ); ?></h3> |
| 27 |
<hr/> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
<div class="rsfirewall-replace-original text-center"> |
| 31 |
<button type="button" id="replace-original" class="rsfirewall-fix-action" |
| 32 |
onclick="RSFirewall.diffs.download('<?php echo esc_html( $filename ); ?>', '<?php echo $hash; ?>', this)"><?php echo esc_html__( 'Download Original', 'rsfirewall' ) ?></button> |
| 33 |
</div> |
| 34 |
<!-- /.Title --> |
| 35 |
<!-- Info Boxes --> |
| 36 |
<?php |
| 37 |
echo RSFirewall_Helper_Diff::toTable( RSFirewall_Helper_Diff::compare( $original_file, $local_file ), '', '', array( |
| 38 |
sprintf( esc_html__( 'Original (Remote file): %s', 'rsfirewall' ), $this->model->get_remote_filename() ), |
| 39 |
sprintf( esc_html__( 'Your version (Local file): %s', 'rsfirewall' ), realpath( $this->model->get_local_filename() ) ) |
| 40 |
) ); |
| 41 |
?> |
| 42 |
<!-- /.Info Boxes --> |
| 43 |
</div><!-- /.wrap --> |
| 44 |
<?php } catch(Exception $e) { ?> |
| 45 |
<div class="notice notice-error"><p><?php echo $e->getMessage(); ?></p></div> |
| 46 |
<?php } |
| 47 |
|