PluginProbe
Property Hive / 1.4.53
Property Hive v1.4.53
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-dashboard.php

class-ph-admin-dashboard.php in Property Hive 1.4.53, at includes/admin/class-ph-admin-dashboard.php

81 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 * Admin Dashboard
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin
8 * @version 1.0.0
9 */
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly
12 }
13 if ( ! class_exists( 'PH_Admin_Dashboard' ) ) :
14
15 /**
16 * PH_Admin_Dashboard Class.
17 */
18 class PH_Admin_Dashboard {
19
20 /**
21 * Hook in tabs.
22 */
23 public function __construct() {
24 // Only hook in admin parts if the user has admin access
25 if ( current_user_can( 'manage_options' ) ) {
26 add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
27 }
28 }
29
30 /**
31 * Init dashboard widgets.
32 */
33 public function init() {
34 wp_add_dashboard_widget( 'propertyhive_dashboard_news', __( 'Property Hive News', 'propertyhive' ), array( $this, 'news_widget' ) );
35
36 if ( get_option('propertyhive_module_disabled_viewings', '') != 'yes' )
37 {
38 wp_add_dashboard_widget( 'propertyhive_dashboard_viewings_awaiting_applicant_feedback', __( 'Viewings Awaiting Applicant Feedback', 'propertyhive' ), array( $this, 'viewings_awaiting_applicant_feedback_widget' ) );
39 }
40
41 if (
42 (
43 get_option('propertyhive_module_disabled_appraisals', '') != 'yes' &&
44 get_option('propertyhive_module_disabled_viewings', '') != 'yes'
45 )
46 ||
47 apply_filters( 'propertyhive_show_my_upcoming_appointments_dashboard_widget', false ) === true
48 )
49 {
50 wp_add_dashboard_widget( 'propertyhive_dashboard_my_upcoming_appointments', __( 'My Upcoming Appointments', 'propertyhive' ), array( $this, 'my_upcoming_appointments_widget' ) );
51 }
52 }
53
54 /*
55 * Property Hive News Widget
56 */
57 public function news_widget()
58 {
59 echo '<div id="ph_dashboard_news">Loading...</div>';
60 }
61
62 /*
63 * Property Hive Viewings Awaiting Applicant Feedback Widget
64 */
65 public function viewings_awaiting_applicant_feedback_widget()
66 {
67 echo '<div id="ph_dashboard_viewings_awaiting_applicant_feedback">Loading...</div>';
68 }
69
70 /*
71 * Property Hive My Upcoming Appointments Widget
72 */
73 public function my_upcoming_appointments_widget()
74 {
75 echo '<div id="ph_dashboard_my_upcoming_appointments">Loading...</div>';
76 }
77 }
78
79 endif;
80
81 return new PH_Admin_Dashboard();