PluginProbe
Property Hive / 2.2.6
Property Hive v2.2.6
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 / settings / class-ph-settings-demo-data.php

class-ph-settings-demo-data.php in Property Hive 2.2.6, at includes/admin/settings/class-ph-settings-demo-data.php

105 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PropertyHive Demo Data
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin
8 * @version 1.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 if ( ! class_exists( 'PH_Settings_Demo_Data' ) ) :
16
17 /**
18 * PH_Settings_Demo_Data
19 */
20 class PH_Settings_Demo_Data extends PH_Settings_Page {
21
22 /**
23 * Constructor.
24 */
25 public function __construct()
26 {
27 $this->id = 'demo_data';
28 $this->label = __( 'Demo Data', 'propertyhive' );
29
30 add_filter( 'propertyhive_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
31 add_action( 'propertyhive_settings_' . $this->id, array( $this, 'output' ) );
32 add_action( 'propertyhive_admin_field_demo_data', array( $this, 'demodata_setting' ) );
33 }
34
35 /**
36 * Get settings array
37 *
38 * @return array
39 */
40 public function get_settings()
41 {
42 global $hide_save_button;
43
44 $hide_save_button = TRUE;
45
46 return apply_filters( 'propertyhive_demo_data_settings', array(
47
48 array(
49 'type' => 'demo_data',
50 ),
51
52 array( 'type' => 'sectionend', 'id' => 'demo_data_options')
53
54 ) );
55 }
56
57 /**
58 * Output the settings
59 */
60 public function output()
61 {
62 $settings = $this->get_settings();
63
64 PH_Admin_Settings::output_fields( $settings );
65 }
66
67 /**
68 * Output link to demo data
69 *
70 * @access public
71 * @return void
72 */
73 public function demodata_setting()
74 {
75 ?>
76 <style type="text/css">
77
78 .demo-data .intro-text { width:81%; font-size:1.1em; }
79
80 </style>
81 <table class="form-table">
82 <tr>
83 <td class="demo-data">
84 <p class="intro-text">
85 To get an idea of how Property Hive works, if you're a new user you can quickly fill it with a set of demo data, including properties, applicants and more.
86 <br><br>
87 Simply activate our free Demo Data feature below to get started:
88 </p>
89 <br>
90 <p>
91 <a href="<?php echo esc_url(admin_url('admin.php?page=ph-settings&tab=features&profilter=free')); ?>" class="button button-primary">Activate Demo Data Feature</a>
92 &nbsp;
93 <a href="<?php echo esc_url(admin_url('admin.php?page=ph-settings&tab=demo_data&hidetab=1')); ?>">Hide This Page</a>
94 </p>
95 </td>
96 </tr>
97 </table>
98 <?php
99 }
100 }
101
102 endif;
103
104 return new PH_Settings_Demo_Data();
105