PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.6
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.6
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Views / admin / global_menu.php

global_menu.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.6, at app/Views/admin/global_menu.php

189 lines 8.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or die;
4
5 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template variables in view files
6
7 use FluentForm\App\Modules\Acl\Acl;
8
9 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Admin menu display, no nonce needed
10 $page = sanitize_text_field($_GET['page']);
11 ?>
12 <div class="ff_header">
13 <div class="ff_header_group">
14 <span class="plugin-name">
15 <img src="<?php echo esc_url($logo); ?>"/>
16 </span>
17 <span class="ff_menu_toggle">
18 <i class="ff-icon ff-icon-menu"></i>
19 </span>
20 </div>
21 <ul class="ff_menu">
22 <li class="<?php echo ($page == 'fluent_forms') ? 'active' : '' ?>">
23 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms')); ?>" class="ff_menu_link">
24 <?php esc_html_e('Forms', 'fluentform'); ?>
25 </a>
26 </li>
27 <li class="<?php echo ($page == 'fluent_forms_all_entries') ? 'active' : '' ?>">
28 <?php if (Acl::hasPermission('fluentform_entries_viewer')): ?>
29 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_all_entries'));?>" class="ff_menu_link">
30 <?php esc_html_e('Entries', 'fluentform'); ?>
31 </a>
32 <?php endif; ?>
33 </li>
34 <li class="<?php echo ($page == 'fluent_forms_reports') ? 'active' : '' ?>">
35 <?php if (Acl::hasPermission('fluentform_entries_viewer')): ?>
36 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_reports'));?>" class="ff_menu_link">
37 <?php esc_html_e('Reports', 'fluentform'); ?>
38 </a>
39 <?php endif; ?>
40 </li>
41 <li class="<?php echo ($page == 'fluent_forms_payment_entries') ? 'active' : '' ?>">
42 <?php if ($show_payment_entries && Acl::hasPermission('fluentform_view_payments')): ?>
43 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_payment_entries')); ?>" class="ff_menu_link">
44 <?php esc_html_e('Payments', 'fluentform'); ?>
45 </a>
46 <?php endif; ?>
47 </li>
48 <?php if (Acl::hasPermission('fluentform_settings_manager')): ?>
49 <li class="<?php echo ($page == 'fluent_forms_settings') ? 'active' : '' ?>">
50 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_settings')); ?>" class="ff_menu_link">
51 <?php esc_html_e('Global Settings', 'fluentform'); ?>
52 </a>
53 </li>
54 <li class="<?php echo ($page == 'fluent_forms_transfer') ? 'active' : '' ?>">
55 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_transfer')); ?>" class="ff_menu_link">
56 <?php esc_html_e('Tools', 'fluentform'); ?>
57 </a>
58 </li>
59 <li class="<?php echo ($page == 'fluent_forms_add_ons') ? 'active' : '' ?>">
60 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_add_ons')); ?>" class="ff_menu_link">
61 <?php esc_html_e('Integrations', 'fluentform'); ?>
62 </a>
63 </li>
64 <?php endif; ?>
65 <li>
66 <?php if ($show_payment && Acl::hasPermission('fluentform_view_payments')): ?>
67 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_settings#payments/general_settings')); ?>" class="ff_menu_link">
68 <?php esc_html_e('Payments', 'fluentform'); ?><span class="ff_new_badge">new</span>
69 </a>
70 <?php endif; ?>
71 </li>
72
73 <li class="<?php echo ($page == 'fluent_forms_docs') ? 'active' : '' ?>">
74 <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_docs')); ?>" class="ff_menu_link">
75 <?php esc_html_e('Support', 'fluentform'); ?>
76 </a>
77 </li>
78 <?php if(!defined('FLUENTFORMPRO')): ?>
79 <li>
80 <a target="_blank" rel="noopener" href="<?php echo esc_url(fluentform_upgrade_url()); ?>" class="ff_menu_link ff_menu_link_buy">
81 <?php esc_html_e('Upgrade to Pro', 'fluentform'); ?>
82 </a>
83 </li>
84 <?php endif; ?>
85 </ul>
86 <?php
87 $globalSearchActive = apply_filters('fluentform/global_search_active', 'yes');
88 $globalSearchButtonClickScript = "";
89 if ($globalSearchActive == 'yes') {
90 $globalSearchButtonClickScript = "jQuery('.global-search-menu-button').on('click', function() {
91 document.dispatchEvent(new CustomEvent('global-search-menu-button-click'));
92 });";
93 $user_agent = getenv("HTTP_USER_AGENT");
94 if (!empty($user_agent) && strpos($user_agent, "Win") !== FALSE) {
95 $key = "Ctrl ";
96 } else {
97 $key = "";
98 }
99 }
100 ?>
101 <?php if($globalSearchActive == 'yes'):?>
102 <button class="global-search-menu-button">
103 <span class="el-icon-search"></span> <span class="shortcut"><?php echo esc_html($key)?>K </span>
104 </button>
105 <?php endif; ?>
106 <?php
107
108 do_action_deprecated(
109 'fluentform_after_global_menu',
110 [
111 ],
112 FLUENTFORM_FRAMEWORK_UPGRADE,
113 'fluentform/after_global_menu',
114 'Use fluentform/after_global_menu instead of fluentform_after_global_menu.'
115 );
116 do_action('fluentform/after_global_menu');
117
118 wp_add_inline_script('fluent_forms_global', "
119 //for mobile nav
120 let globalHeaderMenuElem = jQuery('.ff_menu');
121 jQuery('.ff_menu_toggle').on('click', function() {
122 globalHeaderMenuElem.toggleClass('ff_menu_active');
123 });
124
125 $globalSearchButtonClickScript
126
127 // for setting sidebar
128 let globalSettingSidebarElem = jQuery('#ff_global_settings_sidebar');
129 let globalOverlayElem = jQuery('#global-overlay');
130 let globalSettingSidebarStateKey = 'fluentform_global_settings_sidebar_collapsed';
131 let globalSettingSidebarToggle = globalSettingSidebarElem.find('.ff_sidebar_toggle');
132 let isGlobalSettingDesktop = function() {
133 return window.matchMedia('(min-width: 769px)').matches;
134 };
135 let syncGlobalSettingSidebarMode = function() {
136 if (isGlobalSettingDesktop() && window.localStorage.getItem(globalSettingSidebarStateKey) === 'yes') {
137 globalSettingSidebarElem.addClass('ff_settings_sidebar_collapsed');
138 } else if (!isGlobalSettingDesktop()) {
139 globalSettingSidebarElem.removeClass('ff_settings_sidebar_collapsed');
140 }
141 };
142 let updateGlobalSettingToggleState = function() {
143 let collapseLabel = globalSettingSidebarToggle.data('collapse-label') || 'Collapse settings menu';
144 let expandLabel = globalSettingSidebarToggle.data('expand-label') || 'Expand settings menu';
145 let isExpanded = isGlobalSettingDesktop()
146 ? !globalSettingSidebarElem.hasClass('ff_settings_sidebar_collapsed')
147 : globalSettingSidebarElem.hasClass('active');
148
149 globalSettingSidebarToggle
150 .attr('aria-expanded', isExpanded ? 'true' : 'false')
151 .attr('aria-label', isExpanded ? collapseLabel : expandLabel)
152 .attr('title', isExpanded ? collapseLabel : expandLabel);
153 };
154
155 syncGlobalSettingSidebarMode();
156
157 globalSettingSidebarToggle.on('click', function() {
158 if (isGlobalSettingDesktop()) {
159 globalSettingSidebarElem.toggleClass('ff_settings_sidebar_collapsed');
160 window.localStorage.setItem(
161 globalSettingSidebarStateKey,
162 globalSettingSidebarElem.hasClass('ff_settings_sidebar_collapsed') ? 'yes' : 'no'
163 );
164 updateGlobalSettingToggleState();
165 return;
166 }
167
168 jQuery(globalSettingSidebarElem).add(globalOverlayElem).toggleClass('active');
169 updateGlobalSettingToggleState();
170 });
171
172 jQuery(globalOverlayElem).on('click', function() {
173 jQuery(globalOverlayElem).add(globalSettingSidebarElem).removeClass('active');
174 updateGlobalSettingToggleState();
175 });
176
177 jQuery(window).on('resize', function() {
178 syncGlobalSettingSidebarMode();
179 updateGlobalSettingToggleState();
180 });
181 updateGlobalSettingToggleState();
182
183 ");
184 ?>
185 </div>
186 <?php
187 do_action('fluentform/after_global_menu_render',$page);
188 ?>
189