| 1 |
<?php |
| 2 |
|
| 3 |
do_action('gdsih_admin_panel_top'); |
| 4 |
|
| 5 |
$pages = gdsih_admin()->menu_items; |
| 6 |
$_page = gdsih_admin()->page; |
| 7 |
$_panel = gdsih_admin()->panel; |
| 8 |
|
| 9 |
$_real_page = $_page; |
| 10 |
|
| 11 |
if (!empty($panels)) { |
| 12 |
if ($_panel === false || empty($_panel)) { |
| 13 |
$_panel = 'index'; |
| 14 |
} |
| 15 |
|
| 16 |
$_available = array_keys($panels); |
| 17 |
|
| 18 |
if (!in_array($_panel, $_available)) { |
| 19 |
$_panel = 'index'; |
| 20 |
gdsih_admin()->panel = false; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
$_classes = array('d4p-wrap', 'wpv-'.GDSIH_WPV, 'd4p-page-'.$_real_page); |
| 26 |
|
| 27 |
if ($_panel !== false) { |
| 28 |
$_classes[] = 'd4p-panel'; |
| 29 |
$_classes[] = 'd4p-panel-'.$_panel; |
| 30 |
} |
| 31 |
|
| 32 |
$_message = ''; |
| 33 |
$_color = ''; |
| 34 |
|
| 35 |
if (isset($_GET['message']) && $_GET['message'] != '') { |
| 36 |
$msg = d4p_sanitize_slug($_GET['message']); |
| 37 |
$_error = isset($_GET['error-message']) ? $_GET['error-message'] : ''; |
| 38 |
|
| 39 |
switch ($msg) { |
| 40 |
case 'saved': |
| 41 |
$_message = __("Settings are saved.", "gd-security-headers"); |
| 42 |
break; |
| 43 |
case 'imported': |
| 44 |
$_message = __("Import operation completed.", "gd-security-headers"); |
| 45 |
break; |
| 46 |
case 'nothing': |
| 47 |
$_message = __("Nothing done.", "gd-security-headers"); |
| 48 |
break; |
| 49 |
default: |
| 50 |
$_message = apply_filters('gdsih_admin_message_text', '', $msg); |
| 51 |
break; |
| 52 |
} |
| 53 |
|
| 54 |
if ($_error != '') { |
| 55 |
$_message.= '<br/>'.$_error; |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
?> |
| 60 |
<div class="<?php echo join(' ', $_classes); ?>"> |
| 61 |
<div class="d4p-header"> |
| 62 |
<div class="d4p-navigator"> |
| 63 |
<ul> |
| 64 |
<li class="d4p-nav-button"> |
| 65 |
<a href="#"><i aria-hidden="true" class="<?php echo d4p_get_icon_class($pages[$_page]['icon']); ?>"></i> <?php echo $pages[$_page]['title']; ?></a> |
| 66 |
<ul> |
| 67 |
<?php |
| 68 |
|
| 69 |
foreach ($pages as $page => $obj) { |
| 70 |
if ($page != $_page) { |
| 71 |
echo '<li><a href="admin.php?page=gd-security-headers-'.$page.'"><i aria-hidden="true" class="'.(d4p_get_icon_class($obj['icon'], 'fw')).'"></i> '.$obj['title'].'</a></li>'; |
| 72 |
} else { |
| 73 |
echo '<li class="d4p-nav-current"><i aria-hidden="true" class="'.(d4p_get_icon_class($obj['icon'], 'fw')).'"></i> '.$obj['title'].'</li>'; |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
?> |
| 78 |
</ul> |
| 79 |
</li> |
| 80 |
<?php if (!empty($panels)) { ?> |
| 81 |
<li class="d4p-nav-button"> |
| 82 |
<a href="#"><i aria-hidden="true" class="<?php echo d4p_get_icon_class($panels[$_panel]['icon']); ?>"></i> <?php echo $panels[$_panel]['title']; ?></a> |
| 83 |
<ul> |
| 84 |
<?php |
| 85 |
|
| 86 |
foreach ($panels as $panel => $obj) { |
| 87 |
if ($panel != $_panel) { |
| 88 |
$extra = $panel != 'index' ? '&panel='.$panel : ''; |
| 89 |
|
| 90 |
echo '<li><a href="admin.php?page=gd-security-headers-'.$_real_page.$extra.'"><i aria-hidden="true" class="'.(d4p_get_icon_class($obj['icon'], 'fw')).'"></i> '.$obj['title'].'</a></li>'; |
| 91 |
} else { |
| 92 |
echo '<li class="d4p-nav-current"><i aria-hidden="true" class="'.(d4p_get_icon_class($obj['icon'], 'fw')).'"></i> '.$obj['title'].'</li>'; |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
?> |
| 97 |
</ul> |
| 98 |
</li> |
| 99 |
<?php } ?> |
| 100 |
</ul> |
| 101 |
</div> |
| 102 |
<div class="d4p-plugin"> |
| 103 |
GD Security Headers |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
<?php |
| 107 |
|
| 108 |
if ($_message != '') { |
| 109 |
echo '<div class="updated">'.$_message.'</div>'; |
| 110 |
} |
| 111 |
|
| 112 |
?> |
| 113 |
<div class="d4p-content"> |
| 114 |
|