PluginProbe
Property Hive / 2.2.3
Property Hive v2.2.3
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / admin / class-ph-admin-menus.php

class-ph-admin-menus.php in Property Hive 2.2.3, at includes/admin/class-ph-admin-menus.php

578 lines 20.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Setup menus in WP admin.
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin
8 * @version 1.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
13 if ( ! class_exists( 'PH_Admin_Menus' ) ) :
14
15 /**
16 * PH_Admin_Menus Class
17 */
18 class PH_Admin_Menus {
19
20 /**
21 * Hook in tabs.
22 */
23 public function __construct() {
24 // Add menus
25 add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 );
26 add_action( 'admin_menu', array( $this, 'import_properties_dummy_menu' ), 20 );
27 add_action( 'admin_menu', array( $this, 'reports_menu' ), 20 );
28 add_action( 'admin_menu', array( $this, 'settings_menu' ), 50 );
29 add_action( 'admin_menu', array( $this, 'crm_only_mode_menu' ), 99 );
30
31 add_action( 'admin_head', array( $this, 'menu_highlight' ) );
32
33 add_action( 'admin_bar_menu', array( $this, 'remove_from_admin_bar' ), 999);
34
35 // Handle saving settings earlier than load-{page} hook to avoid race conditions in conditional menus.
36 add_action( 'wp_loaded', array( $this, 'save_settings' ) );
37 }
38
39 public function save_settings() {
40 global $current_tab, $current_section;
41
42 // We should only save on the settings page.
43 if ( ! is_admin() || ! isset( $_GET['page'] ) || 'ph-settings' !== $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
44 return;
45 }
46
47 // Include settings pages.
48 PH_Admin_Settings::get_settings_pages();
49
50 // Get current tab/section.
51 $current_tab = empty( $_GET['tab'] ) ? 'general' : sanitize_title( wp_unslash( $_GET['tab'] ) ); // WPCS: input var okay, CSRF ok.
52 $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( wp_unslash( $_REQUEST['section'] ) ); // WPCS: input var okay, CSRF ok.
53
54 // Save settings if data has been posted.
55 if ( '' !== $current_section && apply_filters( "propertyhive_save_settings_{$current_tab}_{$current_section}", ! empty( $_POST['save'] ) ) ) { // WPCS: input var okay, CSRF ok.
56 PH_Admin_Settings::save();
57 } elseif ( '' === $current_section && apply_filters( "propertyhive_save_settings_{$current_tab}", ! empty( $_POST['save'] ) ) ) { // WPCS: input var okay, CSRF ok.
58 PH_Admin_Settings::save();
59 }
60
61 $redirect_after_save = empty( $_POST['redirect'] ) ? '' : sanitize_url( wp_unslash( $_POST['redirect'] ) );
62 if ( !empty($redirect_after_save) )
63 {
64 wp_safe_redirect($redirect_after_save . '&ph_message=' . __( 'Your settings have been saved.', 'propertyhive' ) );
65 die();
66 }
67 }
68
69 public function remove_from_admin_bar( $wp_admin_bar )
70 {
71 $current_user = wp_get_current_user();
72
73 $user_id = $current_user->ID;
74
75 $crm_only_mode = get_user_meta( $user_id, 'crm_only_mode', TRUE );
76
77 if ( $crm_only_mode == '1' )
78 {
79 $wp_admin_bar->remove_node('new-content');
80 }
81 }
82
83 public function crm_only_mode_menu()
84 {
85 $current_user = wp_get_current_user();
86
87 $user_id = $current_user->ID;
88
89 $crm_only_mode = get_user_meta( $user_id, 'crm_only_mode', TRUE );
90
91 if ( $crm_only_mode == '1' )
92 {
93 global $menu, $submenu, $wp_filter;
94
95 // remove all top-level menu items that isn't the Dashboard
96 foreach ( $menu as $i => $menuitem )
97 {
98 if (
99 ( !isset($menuitem[2]) || ( isset($menuitem[2]) && $menuitem[2] != 'index.php' ) )
100 &&
101 apply_filters( 'propertyhive_remove_menu_item_in_crm_only_mode', true, $menuitem ) === true
102 )
103 {
104 unset($menu[$i]);
105 }
106 }
107 if ( isset($submenu['propertyhive']) )
108 {
109 unset($submenu['propertyhive'][0]);
110 $position = 5;
111 foreach ( $submenu['propertyhive'] as $submenuitem )
112 {
113 $callback = '';
114 if ( substr($submenuitem[2], 0, 3) == 'ph-' )
115 {
116 $callback = array( $this, substr($submenuitem[2], 3) . '_page' );
117 }
118 elseif ( isset($wp_filter[sanitize_title(__( 'Property Hive', 'propertyhive' )) . '_page_' . $submenuitem[2]]) )
119 {
120 // get class name from callbacks then convert it to class name
121 // i.e. convert PH_Property_Import to PHPI()
122 $class_name = '';
123 $function_name = '';
124 if ( isset($wp_filter[sanitize_title(__( 'Property Hive', 'propertyhive' )) . '_page_' . $submenuitem[2]]->callbacks) )
125 {
126 foreach ( $wp_filter[sanitize_title(__( 'Property Hive', 'propertyhive' )) . '_page_' . $submenuitem[2]]->callbacks as $priority => $filter_callbacks )
127 {
128 foreach ( $filter_callbacks as $oddkey => $filter_callback )
129 {
130 if ( isset($filter_callback['function']) && count($filter_callback['function']) >= 2 )
131 {
132 $class_name = get_class($filter_callback['function'][0]);
133 $explode_class_name = explode("_", $class_name);
134
135 $class_name_bits = array();
136 foreach ( $explode_class_name as $exploded_class_name_bit )
137 {
138 if ( $exploded_class_name_bit == 'PH' )
139 {
140 $class_name_bits[] = $exploded_class_name_bit;
141 }
142 else
143 {
144 $class_name_bits[] = strtoupper(substr($exploded_class_name_bit, 0, 1));
145 }
146 }
147
148 $class_name = implode("", $class_name_bits);
149 $function_name = $filter_callback['function'][1];
150 }
151 }
152 }
153 }
154
155 if ( class_exists($class_name) && $class_name != '' && $function_name != '' )
156 {
157 $callback = array( $class_name(), $function_name );
158 }
159 elseif ( function_exists($class_name) && $class_name != '' && $function_name != '' )
160 {
161 $callback = array( $class_name(), $function_name );
162 }
163 }
164
165 add_menu_page( $submenuitem[3], $submenuitem[0], $submenuitem[1], $submenuitem[2], $callback, $this->get_menu_icon($submenuitem[2]), $position );
166 $position += 5;
167 }
168 unset($submenu['propertyhive']);
169 }
170 }
171 }
172
173 /**
174 * Add menu items
175 */
176 public function admin_menu() {
177 global $menu, $propertyhive;
178
179 //if ( current_user_can( 'manage_propertyhive' ) )
180 $menu[] = array( '', 'read', 'separator-propertyhive', '', 'wp-menu-separator propertyhive' );
181
182 add_menu_page( __( 'Property Hive', 'propertyhive' ), __( 'Property Hive', 'propertyhive' ), 'manage_propertyhive', 'propertyhive' , array( $this, 'settings_page' ), $this->get_menu_icon(), '54.5' );
183
184 add_submenu_page( 'propertyhive', __( 'Properties', 'propertyhive' ), __( 'Properties', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=property'/*, array( $this, 'attributes_page' )*/ );
185
186 if ( get_option('propertyhive_module_disabled_contacts', '') != 'yes' )
187 {
188 add_submenu_page( 'propertyhive', __( 'Property Owners and Landlords', 'propertyhive' ), __( 'Owners &amp; Landlords', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=contact&_contact_type=owner'/*, array( $this, 'attributes_page' )*/ );
189 add_submenu_page( 'propertyhive', __( 'Applicants', 'propertyhive' ), __( 'Applicants', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=contact&_contact_type=applicant'/*, array( $this, 'attributes_page' )*/ );
190 add_submenu_page( 'propertyhive', __( 'Third Party Contacts', 'propertyhive' ), __( 'Third Party Contacts', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=contact&_contact_type=thirdparty'/*, array( $this, 'attributes_page' )*/ );
191 }
192
193 if ( get_option('propertyhive_module_disabled_enquiries', '') != 'yes' )
194 {
195 $count = '';
196 if ( apply_filters( 'propertyhive_show_admin_menu_enquiry_count', TRUE ) === TRUE )
197 {
198 $args = array(
199 'post_type' => 'enquiry',
200 'nopaging' => true,
201 'fields' => 'ids',
202 'meta_query' => array(
203 array(
204 'key' => '_status',
205 'value' => 'open'
206 ),
207 array(
208 'key' => '_negotiator_id',
209 'value' => ''
210 ),
211 ),
212 );
213 $args = apply_filters( 'propertyhive_admin_menu_enquiry_count_args', $args );
214 $enquiry_query = new WP_Query( $args );
215 if ( $enquiry_query->have_posts() )
216 {
217 $count = ' <span class="update-plugins count-' . $enquiry_query->found_posts . '"><span class="plugin-count">' . $enquiry_query->found_posts . '</span></span>';
218 }
219 }
220 add_submenu_page( 'propertyhive', __( 'Enquiries', 'propertyhive' ), __( 'Enquiries', 'propertyhive' ) . $count, 'manage_propertyhive', 'edit.php?post_type=enquiry'/*, array( $this, 'attributes_page' )*/ );
221 }
222
223 if ( get_option('propertyhive_module_disabled_appraisals', '') != 'yes' )
224 {
225 add_submenu_page( 'propertyhive', __( 'Appraisals', 'propertyhive' ), __( 'Appraisals', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=appraisal'/*, array( $this, 'attributes_page' )*/ );
226 }
227
228 if ( get_option('propertyhive_module_disabled_viewings', '') != 'yes' )
229 {
230 add_submenu_page( 'propertyhive', __( 'Viewings', 'propertyhive' ), __( 'Viewings', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=viewing'/*, array( $this, 'attributes_page' )*/ );
231 }
232
233 if ( get_option('propertyhive_module_disabled_offers_sales', '') != 'yes' )
234 {
235 add_submenu_page( 'propertyhive', __( 'Offers', 'propertyhive' ), __( 'Offers', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=offer'/*, array( $this, 'attributes_page' )*/ );
236 add_submenu_page( 'propertyhive', __( 'Sales', 'propertyhive' ), __( 'Sales', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=sale'/*, array( $this, 'attributes_page' )*/ );
237 }
238
239 if ( get_option( 'propertyhive_active_departments_lettings' ) == 'yes' && get_option('propertyhive_module_disabled_tenancies', '') != 'yes' )
240 {
241 add_submenu_page( 'propertyhive', __( 'Tenancies', 'propertyhive' ), __( 'Tenancies', 'propertyhive' ), 'manage_propertyhive', 'edit.php?post_type=tenancy'/*, array( $this, 'attributes_page' )*/ );
242
243 $count = '';
244 if ( apply_filters( 'propertyhive_show_admin_menu_key_date_count', TRUE ) === TRUE )
245 {
246 $args = array(
247 'post_type' => 'key_date',
248 'nopaging' => true,
249 'fields' => 'ids',
250 'meta_query' => array(
251 array(
252 'key' => '_key_date_status',
253 'value' => 'pending'
254 ),
255 array(
256 'key' => '_date_due',
257 'value' => date('Y-m-d'),
258 'type' => 'date',
259 'compare' => '<=',
260 ),
261 ),
262 );
263 $args = apply_filters( 'propertyhive_admin_menu_key_date_count_args', $args );
264 $key_date_query = new WP_Query( $args );
265 if ( $key_date_query->have_posts() )
266 {
267 $count = ' <span class="update-plugins count-' . $key_date_query->found_posts . '"><span class="plugin-count">' . $key_date_query->found_posts . '</span></span>';
268 }
269 }
270 add_submenu_page( 'propertyhive', __( 'Management', 'propertyhive' ), __( 'Management', 'propertyhive' ) . $count, 'manage_propertyhive', 'edit.php?post_type=key_date&orderby=date_due&order=asc&status=upcoming_and_overdue&filter_action=Filter' );
271 }
272
273 if ( get_option('propertyhive_module_disabled_contacts', '') != 'yes' )
274 {
275 add_submenu_page( '', __( 'Applicant Matching Properties', 'propertyhive'), __( 'Applicant Matching Properties', 'propertyhive' ), 'manage_propertyhive', 'ph-matching-properties', array($this, 'matching_properties_page'));
276 add_submenu_page( '', __( 'Generate Applicant List', 'propertyhive'), __( 'Generate Applicant List', 'propertyhive' ), 'manage_propertyhive', 'ph-generate-applicant-list', array($this, 'generate_applicant_list_page'));
277 add_submenu_page( '', __( 'Applicant Matching Applicants', 'propertyhive'), __( 'Applicant Matching Properties', 'propertyhive' ), 'manage_propertyhive', 'ph-matching-applicants', array($this, 'matching_applicants_page'));
278 add_submenu_page( '', __( 'Merge Duplicate Contacts', 'propertyhive'), __( 'Merge Duplicate Contacts', 'propertyhive' ), 'manage_propertyhive', 'ph-merge-duplicate-contacts', array($this, 'generate_merge_duplicate_contacts_page'));
279 }
280 }
281
282 /**
283 * Add menu item
284 */
285 public function import_properties_dummy_menu()
286 {
287 // check clauses
288 if ( !current_user_can( 'manage_options' ) )
289 {
290 // Not an administrator
291 return;
292 }
293
294 if ( apply_filters( 'propertyhive_admin_menu_property_import_button', true ) !== true )
295 {
296 // Manually turned off by filter
297 return;
298 }
299
300 if ( class_exists('PH_Property_Import') )
301 {
302 // Already activated. Check can be used
303 if ( apply_filters( 'propertyhive_add_on_can_be_used', true, 'propertyhive-property-import' ) === true )
304 {
305 // Yes. Import add on is fine to use
306 return;
307 }
308 }
309
310 // check date installed more than when PRO went live
311 $propertyhive_install_timestamp = get_option( 'propertyhive_install_timestamp', '' );
312 if ( !empty($propertyhive_install_timestamp) )
313 {
314 $november_first_2023 = strtotime('2023-11-01 00:00:00');
315 if ( $propertyhive_install_timestamp < $november_first_2023 )
316 {
317 // Installed before 1st Nov 2023. Don't show anything
318 return;
319 }
320 }
321
322 $show_dummy_link = false;
323
324 $license_type = get_option( 'propertyhive_license_type', '' );
325 if ( $license_type == '' )
326 {
327 $show_dummy_link = true;
328 }
329
330 if ( !$show_dummy_link )
331 {
332 if ( $license_type == 'old' )
333 {
334 // Old user. Don't do anything
335 return;
336 }
337
338 if ( $license_type == 'pro' )
339 {
340 $license_key = get_option( 'propertyhive_pro_license_key', '' );
341 if ( empty($license_key) )
342 {
343 // No license key entered
344 $show_dummy_link = true;
345 }
346 else
347 {
348 if ( PH()->license->is_valid_pro_license_key() )
349 {
350 // valid license key.
351 return;
352 }
353 else
354 {
355 $show_dummy_link = true;
356 }
357 }
358 }
359 }
360
361 if ( $show_dummy_link === true )
362 {
363 add_submenu_page( 'propertyhive', __( 'Import Properties', 'propertyhive' ), __( 'Import Properties', 'propertyhive' ) . '<span class="update-plugins" style="padding:0 3px;"><span class="plugin-count">PRO</span></span>', 'manage_options', 'ph-import_properties_dummy', array( $this, 'import_properties_dummy_page' ) );
364 }
365 }
366
367 public function import_properties_dummy_page()
368 {
369 include_once( 'views/html-import-properties-dummy.php' );
370 }
371
372 /**
373 * Add menu item
374 */
375 public function reports_menu() {
376 add_submenu_page( 'propertyhive', __( 'Reports', 'propertyhive' ), __( 'Reports', 'propertyhive' ) , 'manage_propertyhive', 'ph-reports', array( $this, 'reports_page' ) );
377 }
378
379 /**
380 * Add menu item
381 */
382 public function settings_menu() {
383 $settings_page = add_submenu_page( 'propertyhive', __( 'Property Hive Settings', 'propertyhive' ), __( 'Settings', 'propertyhive' ) , 'manage_options', 'ph-settings', array( $this, 'settings_page' ) );
384
385 //add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) );
386 }
387
388 /**
389 * Loads gateways and shipping methods into memory for use within settings.
390 */
391 public function settings_page_init() {
392
393 }
394
395 /**
396 * Highlights the correct top level admin menu item for post type add screens.
397 *
398 * @access public
399 * @return void
400 */
401 public function menu_highlight() {
402
403 global $menu, $submenu, $parent_file, $submenu_file, $self, $post_type, $taxonomy;
404
405 $current_user = wp_get_current_user();
406
407 $user_id = $current_user->ID;
408
409 $crm_only_mode = get_user_meta( $user_id, 'crm_only_mode', TRUE );
410
411 if ( $crm_only_mode == '1' )
412 {
413 if ( $post_type == 'contact' && isset($_GET['_contact_type']) && !empty(ph_clean($_GET['_contact_type'])) )
414 {
415 $parent_file = 'edit.php?post_type=contact&_contact_type=' . ph_clean($_GET['_contact_type']);
416 }
417 }
418 else
419 {
420 $to_highlight_types = array( 'property', 'contact', 'enquiry', 'appraisal', 'viewing', 'offer', 'sale', 'tenancy', 'key_date' );
421
422 if ( isset( $post_type ) ) {
423 if ( in_array( $post_type, $to_highlight_types ) ) {
424 $submenu_file = 'edit.php?post_type=' . esc_attr( $post_type );
425 $parent_file = 'propertyhive';
426 }
427 }
428
429 if ( isset( $submenu['propertyhive'] ) && isset( $submenu['propertyhive'][1] ) ) {
430 $submenu['propertyhive'][0] = $submenu['propertyhive'][1];
431 unset( $submenu['propertyhive'][1] );
432 }
433 }
434 }
435
436 /**
437 * Init the reports page
438 */
439 public function reports_page() {
440 include_once( 'class-ph-admin-reports.php' );
441 PH_Admin_Reports::output();
442 }
443
444 /**
445 * Init the settings page
446 */
447 public function settings_page() {
448 include_once( 'class-ph-admin-settings.php' );
449 PH_Admin_Settings::output();
450 }
451
452 /**
453 * Init the applicant matching properties page
454 */
455 public function matching_properties_page() {
456 include_once( 'class-ph-admin-matching-properties.php' );
457 $ph_admin_matching_properties = new PH_Admin_Matching_Properties();
458 $ph_admin_matching_properties->output();
459 }
460
461 /**
462 * Init the applicant list page
463 */
464 public function generate_applicant_list_page() {
465 include_once( 'class-ph-admin-applicant-list.php' );
466 $ph_admin_applicant_list = new PH_Admin_Applicant_List();
467 $ph_admin_applicant_list->output();
468 }
469
470 /**
471 * Init the property matching applicants page
472 */
473 public function matching_applicants_page() {
474 include_once( 'class-ph-admin-matching-applicants.php' );
475 $ph_admin_matching_applicants = new PH_Admin_Matching_Applicants();
476 $ph_admin_matching_applicants->output();
477 }
478
479 /**
480 * Init the merge contacts page
481 */
482 public function generate_merge_duplicate_contacts_page() {
483 include_once( 'class-ph-admin-merge-contacts.php' );
484 $ph_admin_merge_contacts = new PH_Admin_Merge_Contacts();
485 $ph_admin_merge_contacts->output();
486 }
487
488 private function get_menu_icon( $section = '' )
489 {
490 // extract post type
491 $explode_section = explode("?", $section, 2);
492 $tab = '';
493 if ( count($explode_section) == 2 )
494 {
495 parse_str( $explode_section[1], $array );
496
497 if ( isset($array['post_type']) )
498 {
499 $section = $array['post_type'];
500 }
501 elseif ( isset($array['page']) )
502 {
503 $section = $array['page'];
504 if ( isset($array['tab']) )
505 {
506 $tab = $array['tab'];
507 }
508 }
509 }
510
511 $icon = PH()->plugin_url() . '/assets/images/menu-icon.png';
512 switch ( $section )
513 {
514 case "contact":
515 {
516 $icon = "dashicons-admin-users";
517 break;
518 }
519 case "property":
520 {
521 $icon = "dashicons-admin-home";
522 break;
523 }
524 case "appraisal":
525 {
526 $icon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgwIiBoZWlnaHQ9IjM5MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxnPgogIDx0aXRsZT5MYXllciAxPC90aXRsZT4KICA8cGF0aCBmaWxsPSIjZjBmMGYxIiBpZD0ic3ZnXzEiIGQ9Im0xOTAuMjA5MDU3LDYuMjExNDA4Yy0xMDMuNzU0LDAgLTE4OC4xNjEsODQuNDEzIC0xODguMTYxLDE4OC4xNjdzODQuNDA3LDE4OC4xNTUgMTg4LjE2MSwxODguMTU1YzEwMy43NiwwIDE4OC4xNjcsLTg0LjQwMSAxODguMTY3LC0xODguMTU1cy04NC40MDcsLTE4OC4xNjcgLTE4OC4xNjcsLTE4OC4xNjd6bTAsMzQ2LjY0MmMtODcuMzgzLDAgLTE1OC40NzYsLTcxLjA5MyAtMTU4LjQ3NiwtMTU4LjQ3NmMwLC04Ny4zOTUgNzEuMDkyLC0xNTguNDg3IDE1OC40NzYsLTE1OC40ODdjODcuMzg5LDAgMTU4LjQ4Nyw3MS4wOTMgMTU4LjQ4NywxNTguNDg3YzAuMDAxLDg3LjM4MyAtNzEuMDk4LDE1OC40NzYgLTE1OC40ODcsMTU4LjQ3NnoiLz4KICA8cGF0aCBmaWxsPSIjZjBmMGYxIiBpZD0ic3ZnXzIiIGQ9Im0yMTcuMjIxMDYsMTE1LjY4MjRjMTQuODA2LDAgMTguODY3LDEwLjczOSAyMi45MjksMjMuNTIybDEzLjkzOCwtMTcuNzA3Yy00LjY0NSwtMTguNTg3IC0xNy40MjIsLTI5LjYxMSAtNDIuOTY3LC0yOS42MTFjLTQzLjg0NSwwIC00OS4wNjYsMzEuOTMxIC00OS4wNjYsNTkuNzk0bDAsMzAuMjA1bC0yMS40OSwwbC01LjgwMywyNC4zOTFsMjUuODM1LDBjLTMuMTkzLDMyLjgxMSAtMTEuNjEyLDYzLjU3NSAtMzQuMjYxLDkwLjU4MmwxMjUuMTQ2LDBsMCwtMzAuMTk1bC03MC41NjcsMGM5LjAwMiwtMjAuNjIxIDEyLjQ5OCwtMzguNjE0IDEzLjk0OCwtNjAuMzg5bDQ4LjQ3OSwwbDUuODEsLTI0LjM5MWwtNTMuMTM0LDBsMCwtMjQuMzkxYzAsLTIyLjY0MSAxLjE2NiwtNDEuODEgMjEuMjAzLC00MS44MXoiLz4KIDwvZz4KPC9zdmc+";
527 break;
528 }
529 case "viewing":
530 {
531 $icon = "dashicons-visibility";
532 break;
533 }
534 case "enquiry":
535 {
536 $icon = "dashicons-admin-comments";
537 break;
538 }
539 case "offer":
540 case "sale":
541 {
542 $icon = "dashicons-tag";
543 break;
544 }
545 case "tenancy":
546 {
547 $icon = "dashicons-admin-network";
548 break;
549 }
550 case "key_date":
551 {
552 $icon = "dashicons-admin-network";
553 break;
554 }
555 case "ph-reports":
556 {
557 $icon = "dashicons-chart-bar";
558 break;
559 }
560 case "ph-settings":
561 {
562 $icon = "dashicons-admin-settings";
563 if ( $tab == 'addons' )
564 {
565 $icon = "dashicons-insert";
566 }
567 break;
568 }
569 }
570 $icon = apply_filters( 'propertyhive_menu_icon', $icon, $section );
571 return $icon;
572 }
573
574 }
575
576 endif;
577
578 return new PH_Admin_Menus();