PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 2.15
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v2.15
5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 All 35 releases
double-opt-in / core / UIMenu.class.php

UIMenu.class.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 2.15, at core/UIMenu.class.php

67 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace forge12\contactform7\CF7DoubleOptIn {
4 if (!defined('ABSPATH')) {
5 exit;
6 }
7 /**
8 *
9 */
10 class UIMenu
11 {
12 /**
13 * UI constructor.
14 * @param $slug
15 */
16 public function __construct()
17 {
18 add_action('f12_cf7_doubleoptin_admin_menu', array($this,'render'), 10, 3);
19 }
20
21 /**
22 *
23 * @param array<UIPage> $Pages
24 * @param string $active_slug
25 * @return void
26 */
27 public function render($Pages, $active_slug, $plugin_slug)
28 {
29 if(!is_array($Pages)){
30 $Pages = array($Pages);
31 }
32 ?>
33 <nav class="navbar">
34 <ul class="navbar-nav">
35 <?php do_action('before-forge12-plugin-menu-' . $plugin_slug); ?>
36 <?php foreach ($Pages as /** @var UIPage $Page */ $Page): ?>
37 <li class="forge12-plugin-menu-item">
38 <?php
39 $class = '';
40
41 $slug = $plugin_slug.'_'.$Page->getSlug();
42
43 if($Page->isDashboard()){
44 $slug =$plugin_slug;
45 }
46
47 if ($Page->getSlug() == $active_slug || ($Page->isDashboard() && empty($active_slug))) {
48 $class = 'active';
49 }
50
51 ?>
52 <a href="<?php echo esc_url(admin_url('admin.php')); ?>?page=<?php echo esc_attr($slug); ?>"
53 title="<?php echo esc_attr($Page->getTitle()); ?>"
54 class="<?php echo esc_attr($class).' '.esc_attr($Page->getClass()); ?>">
55 <?php echo esc_html($Page->getTitle()); ?>
56 </a>
57 </li>
58 <?php endforeach; ?>
59 <?php do_action('after-forge12-plugin-menu-' . $plugin_slug); ?>
60 </ul>
61 </nav>
62 <?php
63 }
64 }
65
66 new UIMenu();
67 }