PluginProbe
RSFirewall! / trunk
RSFirewall! vtrunk
rsfirewall / views / configuration.php

configuration.php in RSFirewall! trunk, at views/configuration.php

60 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 $current_section = $this->model->form->get_current_section();
14 $is_pro = ((isset($this->model->is_pro) && $this->model->is_pro) ? true : false);
15
16 $hide_save_on_pages = array();
17 if (!$is_pro) {
18 $hide_save_on_pages = array('rsfirewall_country_blocking', 'rsfirewall_two_factor_auth');
19 }
20 ?>
21
22 <!-- Create a header in the default WordPress 'wrap' container -->
23 <div class="wrap rsfirewall">
24 <h2><?php _e( 'RSFirewall! Firewall Configuration', 'rsfirewall' ); ?> - <a href="<?php echo wp_nonce_url(admin_url( 'admin.php?page=rsfirewall_configuration'), 'rsfirewall', 'rsf-actions'); ?>&handler=configuration&task=export_configuration" class="button-primary" onclick="RSFirewall.export_configuration()"><span class="dashicons dashicons-download" style="line-height:1.5"></span> <?php echo __('Export current configuration', 'rsfirewall'); ?></a></h2>
25 <?php settings_errors(); ?>
26 <h2 class="nav-tab-wrapper">
27 <?php
28 foreach ($this->model->form->sections as $section)
29 {
30 ?>
31 <a href="<?php menu_page_url('rsfirewall_configuration'); ?>&amp;section=<?php echo urlencode($section['name']); ?>" class="nav-tab<?php echo $current_section == $section['name'] ? ' nav-tab-active' : ((!$is_pro && in_array($section['name'], $hide_save_on_pages)) ? ' rs-only-pro' : ''); ?>"><?php echo esc_html($section['label']); ?></a>
32 <?php
33 }
34 ?>
35 </h2>
36 <?php
37 if ($is_pro && $current_section == 'rsfirewall_country_blocking' && !$this->model->check_php_version()->php_version_compat) {
38 echo $this->model->check_php_version()->message;
39 } else {
40 ?>
41 <form method="post" action="options.php" enctype="multipart/form-data">
42 <?php
43 settings_fields( $current_section );
44 do_settings_sections( $current_section );
45
46 if ($is_pro && $current_section == 'rsfirewall_country_blocking') {
47 echo wp_kses_post(__('This product includes GeoLite2 data created by MaxMind, available from <a href="http://www.maxmind.com" target="_blank">http://www.maxmind.com</a>.','rsfirewall'));
48 }
49
50 if ($is_pro || (!$is_pro && !in_array($current_section, $hide_save_on_pages))) {
51 submit_button();
52 }
53 ?>
54 </form>
55 <?php } ?>
56
57 </div><!-- /.wrap -->
58
59 <?php RSFirewall_Helper::load_rsmodal('output', $this->version);?>
60