Completed
Branch FET-3467-waitlists (9ee75b)
by
unknown
91:40 queued 79:00
created

About_Admin_Page::_reviews()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
if (!defined('EVENT_ESPRESSO_VERSION') )
3
	exit('NO direct script access allowed');
4
5
/**
6
 *
7
 * EE_About_Admin_Page
8
 *
9
 * This contains the logic for the About Event Espresso Pages
10
 *
11
 *
12
 * @package		EventEspresso
13
 * @subpackage	EE_Admin_Page\About_Admin_Page
14
 * @author		Darren Ethier
15
 *
16
 * ------------------------------------------------------------------------
17
 */
18
class About_Admin_Page extends EE_Admin_Page {
19
20
21 View Code Duplication
	protected function _init_page_props() {
22
		$this->page_slug = EE_ABOUT_PG_SLUG;
23
		$this->page_label = esc_html__('About Event Espresso', 'event_espresso');
24
		$this->_admin_base_url = EE_ABOUT_ADMIN_URL;
25
		$this->_admin_base_path = EE_ABOUT_ADMIN;
26
	}
27
28
29
30
	protected function _ajax_hooks() {
31
		//todo: all hooks for ajax goes here.
32
	}
33
34
35
36
	protected function _define_page_props() {
37
		$this->_labels = array();
38
		$this->_admin_page_title = $this->page_label;
39
	}
40
41
42
43 View Code Duplication
	protected function _set_page_routes() {
44
		$this->_page_routes = array(
45
			'default' => array(
46
				'func' => '_overview',
47
				'capability' => 'manage_options'
48
				),
49
			//'overview' => '_overview',
50
				//'func' => '_overview',
51
				//'capability' => 'ee_read_ee'
52
				//),
53
			'credits' => array(
54
				'func' => '_credits',
55
				'capability' => 'manage_options'
56
				),
57
			
58
			'decafvpro' => array(
59
				'func' => '_decafvpro',
60
				'capability' => 'manage_options'
61
				),
62
			'reviews' => array(
63
				'func' => '_reviews',
64
				'capability' => 'manage_options'
65
				),		
66
			);
67
	}
68
69
70
71 View Code Duplication
	protected function _set_page_config() {
72
		$this->_page_config = array(
73
			/*'default' => array(
74
				'nav' => array(
75
					'label' => __('What\'s New', 'event_espresso'),
76
					'order' => 10),
77
				'require_nonce' => FALSE
78
				),*/
79
			//'overview' => array(
80
			'default' => array(
81
				'nav' => array(
82
					'label' => esc_html__('About', 'event_espresso'),
83
					'order' => 20),
84
				'require_nonce' => FALSE
85
				),
86
			'credits' => array(
87
				'nav' => array(
88
					'label' => esc_html__('Credits', 'event_espresso'),
89
					'order' => 30),
90
				'require_nonce' => FALSE
91
				),
92
			
93
			'decafvpro' => array(
94
				'nav' => array(
95
					'label' => esc_html__('Decaf vs Regular', 'event_espresso'),
96
					'order' => 40),
97
				'require_nonce' => FALSE
98
				),
99
			'reviews' => array(
100
				'nav' => array(
101
					'label' => esc_html__('Reviews', 'event_espresso'),
102
					'order' => 50),
103
				'require_nonce' => FALSE
104
				),
105
			);
106
	}
107
108
109
110
	//none of the below group are currently used for Support pages
111
	protected function _add_screen_options() {}
112
	protected function _add_feature_pointers() {}
113
	public function admin_init() {}
114
	public function admin_notices() {}
115
	public function admin_footer_scripts() {}
116
	public function load_scripts_styles() {}
117
118
119
	protected function _whats_new() {
120
		/*$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
121
		$steps = $steps !== FALSE ? $steps : '';
122
		$this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
123
		$settings_message = $steps;
124
		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso' ) . $settings_message;
125
		$template = EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
126
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
127
		$this->display_about_admin_page();*/
128
	}
129
130
131
132
	protected function _overview() {
133
		/*$this->_template_args['admin_page_title'] = __('About Event Espresso', 'event_espresso');
134
		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso');
135
		$template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
136
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
137
		$this->display_about_admin_page();*/
138
139
		//Copied from _whats_new()
140
		$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE;
141
		$steps = $steps !== FALSE ? $steps : '';
142
		$this->_admin_page_title = sprintf( esc_html__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
143
		$settings_message = $steps;
144
		$this->_template_args['admin_page_subtitle'] = esc_html__('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso' ) . $settings_message;
145
		$template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
146
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
147
		$this->display_about_admin_page();
148
	}
149
150
151
152
	protected function _get_started_steps() {
153
		$steps = '<h2>'.esc_html__('Getting Started').'</h2>';
154
		$step_one = '<p>'.sprintf( esc_html__('%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_general_settings">', '</a>') .'</strong></p>';
155
		$step_two = '<p>'.sprintf( esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_payment_settings">', '</a>') .'</strong></p>';
156
		$step_three = '<p>'.sprintf( esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_events&action=create_new">', '</a>') .'</strong></p>';
157
158
		//done?
159
		$done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? FALSE : TRUE;
160
		$active_invoice_pm = EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Invoice' ) ) );
161
		$active_pms_count = EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart );
162
		//done step two if a non-invoice paymetn method is active; or there is more than one PM active, or
163
		//if only the invoice is active but it's clearly been updated
164
		$done_step_two = $active_pms_count > 1  ||
165
						 ( $active_pms_count === 1 && ! $active_invoice_pm )	||
166
						 ( $active_invoice_pm instanceof EE_Payment_Method && (
167
								 $active_invoice_pm->get_extra_meta( 'pdf_payee_name', TRUE, '' ) ||
168
								 $active_invoice_pm->get_extra_meta( 'pdf_payee_email', TRUE, '' ) ||
169
								 $active_invoice_pm->get_extra_meta( 'pdf_payee_tax_number', TRUE, '' ) ||
170
								 $active_invoice_pm->get_extra_meta( 'pdf_payee_address', TRUE, '' ) ||
171
								 $active_invoice_pm->get_extra_meta( 'page_extra_info', TRUE, '' )
172
								)
173
				);
174
		$done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? TRUE : FALSE;
175
176
		//if ALL steps are done, let's just return FALSE so we don't display anything
177
		if ( $done_step_one && $done_step_two && $done_step_three )
178
			return FALSE;
179
180
		//now let's put it together
181
		$steps .= sprintf( '%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>': '' );
182
		$steps .= sprintf( '%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>': '' );
183
		$steps .= sprintf( '%s' . $step_three . '%s', $done_step_three ? '<strike>' : '', $done_step_three ? '</strike>': '' );
184
185
		return $steps;
186
	}
187
188
189
190 View Code Duplication
	protected function _credits() {
191
		$this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
192
		$this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso');
193
		$template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
194
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
195
		$this->display_about_admin_page();
196
	}
197
198
	
199 View Code Duplication
	protected function _decafvpro() {
200
		$this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
201
		$this->_template_args['admin_page_subtitle'] = sprintf(__('Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s', 'event_espresso'), '<em>', '</em>', '<strong>', '</strong>');
202
		$template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
203
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
204
		$this->display_about_admin_page();
205
	}
206
207 View Code Duplication
	protected function _reviews() {
208
		$this->_template_args['admin_page_title'] = __('Rave Reviews About Event Espresso 4', 'event_espresso');
209
		$this->_template_args['admin_page_subtitle'] = __('At Event Espresso, customer satisfaction is our ultimate goal.', 'event_espresso');
210
		$template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
211
		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE );
212
		$this->display_about_admin_page();
213
	}
214
215
216
} //end Support_Admin_Page class
217