Completed
Branch fix-dummy-related-question-qst... (e5efcf)
by
unknown
07:49 queued 03:45
created
caffeinated/admin/extend/events/Tickets_List_Table.class.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,30 +97,30 @@
 block discarded – undo
97 97
                     'action' => 'trash_ticket',
98 98
                     'TKT_ID' => $item->ID(),
99 99
                 ), EVENTS_ADMIN_URL);
100
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
101
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
102
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
100
+                $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'
101
+                                    . esc_attr__('Move Ticket to trash', 'event_espresso').'">'
102
+                                    . esc_html__('Trash', 'event_espresso').'</a>';
103 103
             } else {
104 104
                 // restore price link
105 105
                 $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
106 106
                     'action' => 'restore_ticket',
107 107
                     'TKT_ID' => $item->ID(),
108 108
                 ), EVENTS_ADMIN_URL);
109
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
110
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
111
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
109
+                $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'
110
+                                      . esc_attr__('Restore Ticket', 'event_espresso').'">'
111
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
112 112
                 // delete price link
113 113
                 $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
114 114
                     'action' => 'delete_ticket',
115 115
                     'TKT_ID' => $item->ID(),
116 116
                 ), EVENTS_ADMIN_URL);
117
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
118
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
119
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
117
+                $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'
118
+                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'
119
+                                     . esc_html__('Delete Permanently', 'event_espresso').'</a>';
120 120
             }
121 121
         }
122 122
 
123
-        return $item->get('TKT_name') . $this->row_actions($actions);
123
+        return $item->get('TKT_name').$this->row_actions($actions);
124 124
     }
125 125
 
126 126
 
Please login to merge, or discard this patch.
Indentation   +147 added lines, -147 removed lines patch added patch discarded remove patch
@@ -15,151 +15,151 @@
 block discarded – undo
15 15
  */
16 16
 class Tickets_List_Table extends EE_Admin_List_Table
17 17
 {
18
-    protected function _setup_data()
19
-    {
20
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
21
-        $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
22
-        $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
23
-        $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
24
-    }
25
-
26
-
27
-    protected function _set_properties()
28
-    {
29
-        $this->_wp_list_args = array(
30
-            'singular' => esc_html__('ticket', 'event_espresso'),
31
-            'plural'   => esc_html__('tickets', 'event_espresso'),
32
-            'ajax'     => true,
33
-            'screen'   => $this->_admin_page->get_current_screen()->id,
34
-        );
35
-
36
-        $this->_columns = array(
37
-            'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
38
-            'TKT_name'        => esc_html__('Name', 'event_espresso'),
39
-            'TKT_description' => esc_html__('Description', 'event_espresso'),
40
-            'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
41
-            'TKT_uses'        => esc_html__('Datetimes', 'event_espresso'),
42
-            'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
43
-            'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
44
-            'TKT_price'       => esc_html__('Price', 'event_espresso'),
45
-            'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
46
-        );
47
-
48
-        $this->_sortable_columns = array(
49
-            // TRUE means its already sorted
50
-            'TKT_name'        => array('TKT_name' => true),
51
-            'TKT_description' => array('TKT_description' => false),
52
-            'TKT_qty'         => array('TKT_qty' => false),
53
-            'TKT_uses'        => array('TKT_uses' => false),
54
-            'TKT_min'         => array('TKT_min' => false),
55
-            'TKT_max'         => array('TKT_max' => false),
56
-            'TKT_price'       => array('TKT_price' => false),
57
-        );
58
-
59
-        $this->_hidden_columns = array();
60
-    }
61
-
62
-
63
-    protected function _get_table_filters()
64
-    {
65
-    }
66
-
67
-
68
-    protected function _add_view_counts()
69
-    {
70
-        $this->_views['all']['count'] = $this->_all_data_count;
71
-        $this->_views['trashed']['count'] = $this->_trashed_count;
72
-    }
73
-
74
-
75
-    public function column_cb($item)
76
-    {
77
-        return $item->ID() === 1
78
-            ? '<span class="ee-lock-icon"></span>'
79
-            : sprintf(
80
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
81
-                $item->ID()
82
-            );
83
-    }
84
-
85
-
86
-    public function column_TKT_name($item)
87
-    {
88
-        // build row actions
89
-        $actions = array();
90
-
91
-        // trash links
92
-        if ($item->ID() !== 1) {
93
-            if ($this->_view == 'all') {
94
-                $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
95
-                    'action' => 'trash_ticket',
96
-                    'TKT_ID' => $item->ID(),
97
-                ), EVENTS_ADMIN_URL);
98
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
99
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
100
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
101
-            } else {
102
-                // restore price link
103
-                $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
104
-                    'action' => 'restore_ticket',
105
-                    'TKT_ID' => $item->ID(),
106
-                ), EVENTS_ADMIN_URL);
107
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
108
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
109
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
110
-                // delete price link
111
-                $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
112
-                    'action' => 'delete_ticket',
113
-                    'TKT_ID' => $item->ID(),
114
-                ), EVENTS_ADMIN_URL);
115
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
116
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
117
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
118
-            }
119
-        }
120
-
121
-        return $item->get('TKT_name') . $this->row_actions($actions);
122
-    }
123
-
124
-
125
-    public function column_TKT_description($item)
126
-    {
127
-        return $item->get('TKT_description');
128
-    }
129
-
130
-
131
-    public function column_TKT_qty($item)
132
-    {
133
-        return $item->get_pretty('TKT_qty', 'text');
134
-    }
135
-
136
-
137
-    public function column_TKT_uses($item)
138
-    {
139
-        return $item->get_pretty('TKT_uses', 'text');
140
-    }
141
-
142
-
143
-    public function column_TKT_min($item)
144
-    {
145
-        return $item->get('TKT_min');
146
-    }
147
-
148
-
149
-    public function column_TKT_max($item)
150
-    {
151
-        return $item->get_pretty('TKT_max', 'text');
152
-    }
153
-
154
-
155
-    public function column_TKT_price($item)
156
-    {
157
-        return EEH_Template::format_currency($item->get('TKT_price'));
158
-    }
159
-
160
-
161
-    public function column_TKT_taxable($item)
162
-    {
163
-        return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
164
-    }
18
+	protected function _setup_data()
19
+	{
20
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
21
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
22
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
23
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
24
+	}
25
+
26
+
27
+	protected function _set_properties()
28
+	{
29
+		$this->_wp_list_args = array(
30
+			'singular' => esc_html__('ticket', 'event_espresso'),
31
+			'plural'   => esc_html__('tickets', 'event_espresso'),
32
+			'ajax'     => true,
33
+			'screen'   => $this->_admin_page->get_current_screen()->id,
34
+		);
35
+
36
+		$this->_columns = array(
37
+			'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
38
+			'TKT_name'        => esc_html__('Name', 'event_espresso'),
39
+			'TKT_description' => esc_html__('Description', 'event_espresso'),
40
+			'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
41
+			'TKT_uses'        => esc_html__('Datetimes', 'event_espresso'),
42
+			'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
43
+			'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
44
+			'TKT_price'       => esc_html__('Price', 'event_espresso'),
45
+			'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
46
+		);
47
+
48
+		$this->_sortable_columns = array(
49
+			// TRUE means its already sorted
50
+			'TKT_name'        => array('TKT_name' => true),
51
+			'TKT_description' => array('TKT_description' => false),
52
+			'TKT_qty'         => array('TKT_qty' => false),
53
+			'TKT_uses'        => array('TKT_uses' => false),
54
+			'TKT_min'         => array('TKT_min' => false),
55
+			'TKT_max'         => array('TKT_max' => false),
56
+			'TKT_price'       => array('TKT_price' => false),
57
+		);
58
+
59
+		$this->_hidden_columns = array();
60
+	}
61
+
62
+
63
+	protected function _get_table_filters()
64
+	{
65
+	}
66
+
67
+
68
+	protected function _add_view_counts()
69
+	{
70
+		$this->_views['all']['count'] = $this->_all_data_count;
71
+		$this->_views['trashed']['count'] = $this->_trashed_count;
72
+	}
73
+
74
+
75
+	public function column_cb($item)
76
+	{
77
+		return $item->ID() === 1
78
+			? '<span class="ee-lock-icon"></span>'
79
+			: sprintf(
80
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
81
+				$item->ID()
82
+			);
83
+	}
84
+
85
+
86
+	public function column_TKT_name($item)
87
+	{
88
+		// build row actions
89
+		$actions = array();
90
+
91
+		// trash links
92
+		if ($item->ID() !== 1) {
93
+			if ($this->_view == 'all') {
94
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
95
+					'action' => 'trash_ticket',
96
+					'TKT_ID' => $item->ID(),
97
+				), EVENTS_ADMIN_URL);
98
+				$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
99
+									. esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
100
+									. esc_html__('Trash', 'event_espresso') . '</a>';
101
+			} else {
102
+				// restore price link
103
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
104
+					'action' => 'restore_ticket',
105
+					'TKT_ID' => $item->ID(),
106
+				), EVENTS_ADMIN_URL);
107
+				$actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
108
+									  . esc_attr__('Restore Ticket', 'event_espresso') . '">'
109
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
110
+				// delete price link
111
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
112
+					'action' => 'delete_ticket',
113
+					'TKT_ID' => $item->ID(),
114
+				), EVENTS_ADMIN_URL);
115
+				$actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
116
+									 . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
117
+									 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
118
+			}
119
+		}
120
+
121
+		return $item->get('TKT_name') . $this->row_actions($actions);
122
+	}
123
+
124
+
125
+	public function column_TKT_description($item)
126
+	{
127
+		return $item->get('TKT_description');
128
+	}
129
+
130
+
131
+	public function column_TKT_qty($item)
132
+	{
133
+		return $item->get_pretty('TKT_qty', 'text');
134
+	}
135
+
136
+
137
+	public function column_TKT_uses($item)
138
+	{
139
+		return $item->get_pretty('TKT_uses', 'text');
140
+	}
141
+
142
+
143
+	public function column_TKT_min($item)
144
+	{
145
+		return $item->get('TKT_min');
146
+	}
147
+
148
+
149
+	public function column_TKT_max($item)
150
+	{
151
+		return $item->get_pretty('TKT_max', 'text');
152
+	}
153
+
154
+
155
+	public function column_TKT_price($item)
156
+	{
157
+		return EEH_Template::format_currency($item->get('TKT_price'));
158
+	}
159
+
160
+
161
+	public function column_TKT_taxable($item)
162
+	{
163
+		return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
164
+	}
165 165
 }
Please login to merge, or discard this patch.
admin/extend/transactions/Extend_Transactions_Admin_Page.core.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
     public function __construct($routing = true)
35 35
     {
36 36
         parent::__construct($routing);
37
-        define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/');
38
-        define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/');
39
-        define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/');
37
+        define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'transactions/templates/');
38
+        define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'transactions/assets/');
39
+        define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'transactions/assets/');
40 40
     }
41 41
 
42 42
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     protected function _extend_page_config()
50 50
     {
51
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions';
51
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'transactions';
52 52
 
53 53
         $new_page_routes = array(
54 54
             'reports' => array(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         wp_register_script(
91 91
             'ee-txn-reports-js',
92
-            TXN_CAF_ASSETS_URL . 'ee-transaction-admin-reports.js',
92
+            TXN_CAF_ASSETS_URL.'ee-transaction-admin-reports.js',
93 93
             array('google-charts'),
94 94
             EVENT_ESPRESSO_VERSION,
95 95
             true
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     protected function _transaction_reports()
121 121
     {
122
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
122
+        $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
123 123
         $this->_admin_page_title = esc_html__('Transactions', 'event_espresso');
124 124
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
125 125
             $template_path,
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             }
163 163
 
164 164
             // setup the date range.
165
-            $beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
165
+            $beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
166 166
             $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
167 167
             $subtitle = sprintf(
168 168
                 wp_strip_all_tags(
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 wp_strip_all_tags(
186 186
                     __('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
187 187
                 ),
188
-                '<h2>' . $report_title . '</h2><p>',
188
+                '<h2>'.$report_title.'</h2><p>',
189 189
                 '</p>'
190 190
             ),
191 191
         );
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             }
229 229
 
230 230
             // setup the date range.
231
-            $beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
231
+            $beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
232 232
             $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
233 233
             $subtitle = sprintf(
234 234
                 wp_strip_all_tags(
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                 wp_strip_all_tags(
252 252
                     __('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
253 253
                 ),
254
-                '<h2>' . $report_title . '</h2><p>',
254
+                '<h2>'.$report_title.'</h2><p>',
255 255
                 '</p>'
256 256
             ),
257 257
         );
Please login to merge, or discard this patch.
Indentation   +242 added lines, -242 removed lines patch added patch discarded remove patch
@@ -14,246 +14,246 @@
 block discarded – undo
14 14
  */
15 15
 class Extend_Transactions_Admin_Page extends Transactions_Admin_Page
16 16
 {
17
-    /**
18
-     * This is used to hold the reports template data which is setup early in the request.
19
-     *
20
-     * @type array
21
-     */
22
-    protected $_reports_template_data = array();
23
-
24
-    /**
25
-     * @Constructor
26
-     * @access public
27
-     *
28
-     * @param bool $routing
29
-     *
30
-     * @return \Extend_Transactions_Admin_Page
31
-     */
32
-    public function __construct($routing = true)
33
-    {
34
-        parent::__construct($routing);
35
-        define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/');
36
-        define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/');
37
-        define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/');
38
-    }
39
-
40
-
41
-    /**
42
-     *    _extend_page_config
43
-     *
44
-     * @access protected
45
-     * @return void
46
-     */
47
-    protected function _extend_page_config()
48
-    {
49
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions';
50
-
51
-        $new_page_routes = array(
52
-            'reports' => array(
53
-                'func'       => '_transaction_reports',
54
-                'capability' => 'ee_read_transactions',
55
-            ),
56
-        );
57
-
58
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
59
-
60
-        $new_page_config = array(
61
-            'reports' => array(
62
-                'nav'           => array(
63
-                    'label' => esc_html__('Reports', 'event_espresso'),
64
-                    'order' => 20,
65
-                ),
66
-                'help_tabs'     => array(
67
-                    'transactions_reports_help_tab' => array(
68
-                        'title'    => esc_html__('Transaction Reports', 'event_espresso'),
69
-                        'filename' => 'transactions_reports',
70
-                    ),
71
-                ),
72
-                'require_nonce' => false,
73
-            ),
74
-        );
75
-        $this->_page_config = array_merge($this->_page_config, $new_page_config);
76
-    }
77
-
78
-
79
-    /**
80
-     *    load_scripts_styles_reports
81
-     *
82
-     * @access public
83
-     * @return void
84
-     */
85
-    public function load_scripts_styles_reports()
86
-    {
87
-        wp_register_script(
88
-            'ee-txn-reports-js',
89
-            TXN_CAF_ASSETS_URL . 'ee-transaction-admin-reports.js',
90
-            array('google-charts'),
91
-            EVENT_ESPRESSO_VERSION,
92
-            true
93
-        );
94
-        wp_enqueue_script('ee-txn-reports-js');
95
-        $this->_transaction_reports_js_setup();
96
-        EE_Registry::$i18n_js_strings['currency_format'] = EEH_Money::get_format_for_google_charts();
97
-    }
98
-
99
-
100
-    /**
101
-     * This is called when javascript is being enqueued to setup the various data needed for the reports js.
102
-     * Also $this->{$_reports_template_data} property is set for later usage by the _transaction_reports method.
103
-     */
104
-    protected function _transaction_reports_js_setup()
105
-    {
106
-        $this->_reports_template_data['admin_reports'][] = $this->_revenue_per_day_report();
107
-        $this->_reports_template_data['admin_reports'][] = $this->_revenue_per_event_report();
108
-    }
109
-
110
-
111
-    /**
112
-     * _transaction_reports
113
-     *    generates Business Reports regarding Transactions
114
-     *
115
-     * @return void
116
-     */
117
-    protected function _transaction_reports()
118
-    {
119
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
120
-        $this->_admin_page_title = esc_html__('Transactions', 'event_espresso');
121
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
122
-            $template_path,
123
-            $this->_reports_template_data,
124
-            true
125
-        );
126
-
127
-        // the final template wrapper
128
-        $this->display_admin_page_with_no_sidebar();
129
-    }
130
-
131
-
132
-    /**
133
-     * _revenue_per_day_report
134
-     * generates Business Report showing Total Revenue per Day.
135
-     *
136
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
137
-     *
138
-     * @return string
139
-     */
140
-    private function _revenue_per_day_report($period = '-1 month')
141
-    {
142
-
143
-        $report_ID = 'txn-admin-revenue-per-day-report-dv';
144
-
145
-        $TXN = EEM_Transaction::instance();
146
-
147
-        $results = $TXN->get_revenue_per_day_report($period);
148
-        $results = (array) $results;
149
-        $revenue = array();
150
-        $subtitle = '';
151
-
152
-        if ($results) {
153
-            $revenue[] = array(
154
-                esc_html__('Date (only shows dates that have a revenue greater than 1)', 'event_espresso'),
155
-                esc_html__('Total Revenue', 'event_espresso'),
156
-            );
157
-            foreach ($results as $result) {
158
-                $revenue[] = array($result->txnDate, (float) $result->revenue);
159
-            }
160
-
161
-            // setup the date range.
162
-            $beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
163
-            $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
164
-            $subtitle = sprintf(
165
-                wp_strip_all_tags(
166
-                    _x('For the period: %s to %s', 'Used to give date range', 'event_espresso')
167
-                ),
168
-                $beginning_date->format('Y-m-d'),
169
-                $ending_date->format('Y-m-d')
170
-            );
171
-        }
172
-
173
-        $report_title = wp_strip_all_tags(__('Total Revenue per Day', 'event_espresso'));
174
-
175
-        $report_params = array(
176
-            'title'     => $report_title,
177
-            'subtitle'  => $subtitle,
178
-            'id'        => $report_ID,
179
-            'revenue'   => $revenue,
180
-            'noResults' => empty($revenue) || count($revenue) === 1,
181
-            'noTxnMsg'  => sprintf(
182
-                wp_strip_all_tags(
183
-                    __('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
184
-                ),
185
-                '<h2>' . $report_title . '</h2><p>',
186
-                '</p>'
187
-            ),
188
-        );
189
-        wp_localize_script('ee-txn-reports-js', 'txnRevPerDay', $report_params);
190
-
191
-        return $report_ID;
192
-    }
193
-
194
-
195
-    /**
196
-     * _revenue_per_event_report
197
-     * generates Business Report showing total revenue per event.
198
-     *
199
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
200
-     *
201
-     * @return int
202
-     */
203
-    private function _revenue_per_event_report($period = '-1 month')
204
-    {
205
-
206
-        $report_ID = 'txn-admin-revenue-per-event-report-dv';
207
-
208
-        $TXN = EEM_Transaction::instance();
209
-        $results = $TXN->get_revenue_per_event_report($period);
210
-        $results = (array) $results;
211
-        $revenue = array();
212
-        $subtitle = '';
213
-
214
-        if ($results) {
215
-            $revenue[] = array(
216
-                esc_html__('Event (only events that have a revenue greater than 1 are shown)', 'event_espresso'),
217
-                esc_html__('Total Revenue', 'event_espresso'),
218
-            );
219
-            foreach ($results as $result) {
220
-                if ($result->revenue > 1) {
221
-                    $event_name = stripslashes(html_entity_decode($result->event_name, ENT_QUOTES, 'UTF-8'));
222
-                    $event_name = wp_trim_words($event_name, 5, '...');
223
-                    $revenue[] = array($event_name, (float) $result->revenue);
224
-                }
225
-            }
226
-
227
-            // setup the date range.
228
-            $beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
229
-            $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
230
-            $subtitle = sprintf(
231
-                wp_strip_all_tags(
232
-                    _x('For the period: %s to %s', 'Used to give date range', 'event_espresso')
233
-                ),
234
-                $beginning_date->format('Y-m-d'),
235
-                $ending_date->format('Y-m-d')
236
-            );
237
-        }
238
-
239
-        $report_title = wp_strip_all_tags(__('Total Revenue per Event', 'event_espresso'));
240
-
241
-        $report_params = array(
242
-            'title'     => $report_title,
243
-            'subtitle'  => $subtitle,
244
-            'id'        => $report_ID,
245
-            'revenue'   => $revenue,
246
-            'noResults' => empty($revenue),
247
-            'noTxnMsg'  => sprintf(
248
-                wp_strip_all_tags(
249
-                    __('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
250
-                ),
251
-                '<h2>' . $report_title . '</h2><p>',
252
-                '</p>'
253
-            ),
254
-        );
255
-        wp_localize_script('ee-txn-reports-js', 'txnRevPerEvent', $report_params);
256
-
257
-        return $report_ID;
258
-    }
17
+	/**
18
+	 * This is used to hold the reports template data which is setup early in the request.
19
+	 *
20
+	 * @type array
21
+	 */
22
+	protected $_reports_template_data = array();
23
+
24
+	/**
25
+	 * @Constructor
26
+	 * @access public
27
+	 *
28
+	 * @param bool $routing
29
+	 *
30
+	 * @return \Extend_Transactions_Admin_Page
31
+	 */
32
+	public function __construct($routing = true)
33
+	{
34
+		parent::__construct($routing);
35
+		define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/');
36
+		define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/');
37
+		define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/');
38
+	}
39
+
40
+
41
+	/**
42
+	 *    _extend_page_config
43
+	 *
44
+	 * @access protected
45
+	 * @return void
46
+	 */
47
+	protected function _extend_page_config()
48
+	{
49
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions';
50
+
51
+		$new_page_routes = array(
52
+			'reports' => array(
53
+				'func'       => '_transaction_reports',
54
+				'capability' => 'ee_read_transactions',
55
+			),
56
+		);
57
+
58
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
59
+
60
+		$new_page_config = array(
61
+			'reports' => array(
62
+				'nav'           => array(
63
+					'label' => esc_html__('Reports', 'event_espresso'),
64
+					'order' => 20,
65
+				),
66
+				'help_tabs'     => array(
67
+					'transactions_reports_help_tab' => array(
68
+						'title'    => esc_html__('Transaction Reports', 'event_espresso'),
69
+						'filename' => 'transactions_reports',
70
+					),
71
+				),
72
+				'require_nonce' => false,
73
+			),
74
+		);
75
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
76
+	}
77
+
78
+
79
+	/**
80
+	 *    load_scripts_styles_reports
81
+	 *
82
+	 * @access public
83
+	 * @return void
84
+	 */
85
+	public function load_scripts_styles_reports()
86
+	{
87
+		wp_register_script(
88
+			'ee-txn-reports-js',
89
+			TXN_CAF_ASSETS_URL . 'ee-transaction-admin-reports.js',
90
+			array('google-charts'),
91
+			EVENT_ESPRESSO_VERSION,
92
+			true
93
+		);
94
+		wp_enqueue_script('ee-txn-reports-js');
95
+		$this->_transaction_reports_js_setup();
96
+		EE_Registry::$i18n_js_strings['currency_format'] = EEH_Money::get_format_for_google_charts();
97
+	}
98
+
99
+
100
+	/**
101
+	 * This is called when javascript is being enqueued to setup the various data needed for the reports js.
102
+	 * Also $this->{$_reports_template_data} property is set for later usage by the _transaction_reports method.
103
+	 */
104
+	protected function _transaction_reports_js_setup()
105
+	{
106
+		$this->_reports_template_data['admin_reports'][] = $this->_revenue_per_day_report();
107
+		$this->_reports_template_data['admin_reports'][] = $this->_revenue_per_event_report();
108
+	}
109
+
110
+
111
+	/**
112
+	 * _transaction_reports
113
+	 *    generates Business Reports regarding Transactions
114
+	 *
115
+	 * @return void
116
+	 */
117
+	protected function _transaction_reports()
118
+	{
119
+		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
120
+		$this->_admin_page_title = esc_html__('Transactions', 'event_espresso');
121
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
122
+			$template_path,
123
+			$this->_reports_template_data,
124
+			true
125
+		);
126
+
127
+		// the final template wrapper
128
+		$this->display_admin_page_with_no_sidebar();
129
+	}
130
+
131
+
132
+	/**
133
+	 * _revenue_per_day_report
134
+	 * generates Business Report showing Total Revenue per Day.
135
+	 *
136
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
137
+	 *
138
+	 * @return string
139
+	 */
140
+	private function _revenue_per_day_report($period = '-1 month')
141
+	{
142
+
143
+		$report_ID = 'txn-admin-revenue-per-day-report-dv';
144
+
145
+		$TXN = EEM_Transaction::instance();
146
+
147
+		$results = $TXN->get_revenue_per_day_report($period);
148
+		$results = (array) $results;
149
+		$revenue = array();
150
+		$subtitle = '';
151
+
152
+		if ($results) {
153
+			$revenue[] = array(
154
+				esc_html__('Date (only shows dates that have a revenue greater than 1)', 'event_espresso'),
155
+				esc_html__('Total Revenue', 'event_espresso'),
156
+			);
157
+			foreach ($results as $result) {
158
+				$revenue[] = array($result->txnDate, (float) $result->revenue);
159
+			}
160
+
161
+			// setup the date range.
162
+			$beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
163
+			$ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
164
+			$subtitle = sprintf(
165
+				wp_strip_all_tags(
166
+					_x('For the period: %s to %s', 'Used to give date range', 'event_espresso')
167
+				),
168
+				$beginning_date->format('Y-m-d'),
169
+				$ending_date->format('Y-m-d')
170
+			);
171
+		}
172
+
173
+		$report_title = wp_strip_all_tags(__('Total Revenue per Day', 'event_espresso'));
174
+
175
+		$report_params = array(
176
+			'title'     => $report_title,
177
+			'subtitle'  => $subtitle,
178
+			'id'        => $report_ID,
179
+			'revenue'   => $revenue,
180
+			'noResults' => empty($revenue) || count($revenue) === 1,
181
+			'noTxnMsg'  => sprintf(
182
+				wp_strip_all_tags(
183
+					__('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
184
+				),
185
+				'<h2>' . $report_title . '</h2><p>',
186
+				'</p>'
187
+			),
188
+		);
189
+		wp_localize_script('ee-txn-reports-js', 'txnRevPerDay', $report_params);
190
+
191
+		return $report_ID;
192
+	}
193
+
194
+
195
+	/**
196
+	 * _revenue_per_event_report
197
+	 * generates Business Report showing total revenue per event.
198
+	 *
199
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
200
+	 *
201
+	 * @return int
202
+	 */
203
+	private function _revenue_per_event_report($period = '-1 month')
204
+	{
205
+
206
+		$report_ID = 'txn-admin-revenue-per-event-report-dv';
207
+
208
+		$TXN = EEM_Transaction::instance();
209
+		$results = $TXN->get_revenue_per_event_report($period);
210
+		$results = (array) $results;
211
+		$revenue = array();
212
+		$subtitle = '';
213
+
214
+		if ($results) {
215
+			$revenue[] = array(
216
+				esc_html__('Event (only events that have a revenue greater than 1 are shown)', 'event_espresso'),
217
+				esc_html__('Total Revenue', 'event_espresso'),
218
+			);
219
+			foreach ($results as $result) {
220
+				if ($result->revenue > 1) {
221
+					$event_name = stripslashes(html_entity_decode($result->event_name, ENT_QUOTES, 'UTF-8'));
222
+					$event_name = wp_trim_words($event_name, 5, '...');
223
+					$revenue[] = array($event_name, (float) $result->revenue);
224
+				}
225
+			}
226
+
227
+			// setup the date range.
228
+			$beginning_date = new DateTime('now' . $period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
229
+			$ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
230
+			$subtitle = sprintf(
231
+				wp_strip_all_tags(
232
+					_x('For the period: %s to %s', 'Used to give date range', 'event_espresso')
233
+				),
234
+				$beginning_date->format('Y-m-d'),
235
+				$ending_date->format('Y-m-d')
236
+			);
237
+		}
238
+
239
+		$report_title = wp_strip_all_tags(__('Total Revenue per Event', 'event_espresso'));
240
+
241
+		$report_params = array(
242
+			'title'     => $report_title,
243
+			'subtitle'  => $subtitle,
244
+			'id'        => $report_ID,
245
+			'revenue'   => $revenue,
246
+			'noResults' => empty($revenue),
247
+			'noTxnMsg'  => sprintf(
248
+				wp_strip_all_tags(
249
+					__('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso')
250
+				),
251
+				'<h2>' . $report_title . '</h2><p>',
252
+				'</p>'
253
+			),
254
+		);
255
+		wp_localize_script('ee-txn-reports-js', 'txnRevPerEvent', $report_params);
256
+
257
+		return $report_ID;
258
+	}
259 259
 }
Please login to merge, or discard this patch.
caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
     public function __construct($routing = true)
22 22
     {
23 23
         parent::__construct($routing);
24
-        define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/');
24
+        define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'about/templates/');
25 25
     }
26 26
 
27 27
 
28 28
     protected function _extend_page_config()
29 29
     {
30
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about';
30
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'about';
31 31
     }
32 32
 
33 33
     protected function _set_page_routes()
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
         $this->_template_args['admin_page_subtitle'] = esc_html__(
115 115
             'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
116 116
             'event_espresso'
117
-        ) . $settings_message;
118
-        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php')
119
-            ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
117
+        ).$settings_message;
118
+        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php')
119
+            ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH.'whats_new.template.php';
120 120
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
121 121
             $template,
122 122
             $this->_template_args,
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
             'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
134 134
             'event_espresso'
135 135
         );
136
-        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php')
136
+        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php')
137 137
             ? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php'
138
-            : EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
138
+            : EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php';
139 139
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
140 140
             $template,
141 141
             $this->_template_args,
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
155 155
             'event_espresso'
156 156
         );
157
-        $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
157
+        $template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php';
158 158
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
159 159
             $template,
160 160
             $this->_template_args,
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             '<strong>',
180 180
             '</strong>'
181 181
         );
182
-        $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
182
+        $template = EE_ABOUT_TEMPLATE_PATH.'decafvpro.template.php';
183 183
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
184 184
             $template,
185 185
             $this->_template_args,
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             'At Event Espresso, customer satisfaction is our ultimate goal.',
196 196
             'event_espresso'
197 197
         );
198
-        $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
198
+        $template = EE_ABOUT_TEMPLATE_PATH.'reviews.template.php';
199 199
         $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
200 200
             $template,
201 201
             $this->_template_args,
Please login to merge, or discard this patch.
Indentation   +177 added lines, -177 removed lines patch added patch discarded remove patch
@@ -16,189 +16,189 @@
 block discarded – undo
16 16
  */
17 17
 class Extend_About_Admin_Page extends About_Admin_Page
18 18
 {
19
-    public function __construct($routing = true)
20
-    {
21
-        parent::__construct($routing);
22
-        define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/');
23
-    }
24
-
25
-
26
-    protected function _extend_page_config()
27
-    {
28
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about';
29
-    }
30
-
31
-    protected function _set_page_routes()
32
-    {
33
-        $this->_page_routes = array(
34
-            'default'  => array(
35
-                'func'       => '_whats_new',
36
-                'capability' => 'manage_options',
37
-            ),
38
-            'overview' => array(
39
-                'func'       => '_overview',
40
-                'capability' => 'manage_options',
41
-            ),
42
-            'credits'  => array(
43
-                'func'       => '_credits',
44
-                'capability' => 'manage_options',
45
-            ),
46
-            /*'decafvpro' => array(
19
+	public function __construct($routing = true)
20
+	{
21
+		parent::__construct($routing);
22
+		define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/');
23
+	}
24
+
25
+
26
+	protected function _extend_page_config()
27
+	{
28
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about';
29
+	}
30
+
31
+	protected function _set_page_routes()
32
+	{
33
+		$this->_page_routes = array(
34
+			'default'  => array(
35
+				'func'       => '_whats_new',
36
+				'capability' => 'manage_options',
37
+			),
38
+			'overview' => array(
39
+				'func'       => '_overview',
40
+				'capability' => 'manage_options',
41
+			),
42
+			'credits'  => array(
43
+				'func'       => '_credits',
44
+				'capability' => 'manage_options',
45
+			),
46
+			/*'decafvpro' => array(
47 47
                 'func' => '_decafvpro',
48 48
                 'capability' => 'manage_options'
49 49
                 ),*/
50
-            'reviews'  => array(
51
-                'func'       => '_reviews',
52
-                'capability' => 'manage_options',
53
-            ),
54
-
55
-
56
-        );
57
-    }
58
-
59
-
60
-    protected function _set_page_config()
61
-    {
62
-        $this->_page_config = array(
63
-            'default'  => array(
64
-                'nav'           => array(
65
-                    'label' => esc_html__('What\'s New', 'event_espresso'),
66
-                    'order' => 10,
67
-                ),
68
-                'require_nonce' => false,
69
-            ),
70
-            'overview' => array(
71
-                'nav'           => array(
72
-                    'label' => esc_html__('About', 'event_espresso'),
73
-                    'order' => 20,
74
-                ),
75
-                'require_nonce' => false,
76
-            ),
77
-            'credits'  => array(
78
-                'nav'           => array(
79
-                    'label' => esc_html__('Credits', 'event_espresso'),
80
-                    'order' => 30,
81
-                ),
82
-                'require_nonce' => false,
83
-            ),
84
-            /*'decafvpro' => array(
50
+			'reviews'  => array(
51
+				'func'       => '_reviews',
52
+				'capability' => 'manage_options',
53
+			),
54
+
55
+
56
+		);
57
+	}
58
+
59
+
60
+	protected function _set_page_config()
61
+	{
62
+		$this->_page_config = array(
63
+			'default'  => array(
64
+				'nav'           => array(
65
+					'label' => esc_html__('What\'s New', 'event_espresso'),
66
+					'order' => 10,
67
+				),
68
+				'require_nonce' => false,
69
+			),
70
+			'overview' => array(
71
+				'nav'           => array(
72
+					'label' => esc_html__('About', 'event_espresso'),
73
+					'order' => 20,
74
+				),
75
+				'require_nonce' => false,
76
+			),
77
+			'credits'  => array(
78
+				'nav'           => array(
79
+					'label' => esc_html__('Credits', 'event_espresso'),
80
+					'order' => 30,
81
+				),
82
+				'require_nonce' => false,
83
+			),
84
+			/*'decafvpro' => array(
85 85
                 'nav' => array(
86 86
                     'label' => esc_html__('Decaf vs Regular', 'event_espresso'),
87 87
                     'order' => 40),
88 88
                 'require_nonce' => FALSE
89 89
                 ),*/
90
-            'reviews'  => array(
91
-                'nav'           => array(
92
-                    'label' => esc_html__('Reviews', 'event_espresso'),
93
-                    'order' => 50,
94
-                ),
95
-                'require_nonce' => false,
96
-            ),
97
-
98
-        );
99
-    }
100
-
101
-
102
-    protected function _whats_new()
103
-    {
104
-        $steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance
105
-            ? $this->_get_started_steps() : false;
106
-        $steps = $steps !== false ? $steps : '';
107
-        $this->_admin_page_title = sprintf(
108
-            esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
109
-            EVENT_ESPRESSO_VERSION
110
-        );
111
-        $settings_message = $steps;
112
-        $this->_template_args['admin_page_subtitle'] = esc_html__(
113
-            'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
114
-            'event_espresso'
115
-        ) . $settings_message;
116
-        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php')
117
-            ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
118
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
119
-            $template,
120
-            $this->_template_args,
121
-            true
122
-        );
123
-        $this->display_about_admin_page();
124
-    }
125
-
126
-
127
-    protected function _overview()
128
-    {
129
-        $this->_admin_page_title = esc_html__('About Event Espresso', 'event_espresso');
130
-        $this->_template_args['admin_page_subtitle'] = esc_html__(
131
-            'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
132
-            'event_espresso'
133
-        );
134
-        $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php')
135
-            ? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php'
136
-            : EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
137
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
138
-            $template,
139
-            $this->_template_args,
140
-            true
141
-        );
142
-        $this->display_about_admin_page();
143
-    }
144
-
145
-    protected function _credits()
146
-    {
147
-        // $this->_template_args['admin_page_title'] = sprintf(
148
-        //     esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
149
-        //     EVENT_ESPRESSO_VERSION
150
-        // );
151
-        $this->_template_args['admin_page_subtitle'] = esc_html__(
152
-            'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
153
-            'event_espresso'
154
-        );
155
-        $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
156
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
157
-            $template,
158
-            $this->_template_args,
159
-            true
160
-        );
161
-        $this->display_about_admin_page();
162
-    }
163
-
164
-    protected function _decafvpro()
165
-    {
166
-        $this->_template_args['admin_page_title'] = sprintf(
167
-            esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
168
-            EVENT_ESPRESSO_VERSION
169
-        );
170
-        $this->_template_args['admin_page_subtitle'] = sprintf(
171
-            esc_html__(
172
-                'Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s',
173
-                'event_espresso'
174
-            ),
175
-            '<em>',
176
-            '</em>',
177
-            '<strong>',
178
-            '</strong>'
179
-        );
180
-        $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
181
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
182
-            $template,
183
-            $this->_template_args,
184
-            true
185
-        );
186
-        $this->display_about_admin_page();
187
-    }
188
-
189
-    protected function _reviews()
190
-    {
191
-        $this->_template_args['admin_page_title'] = esc_html__('Rave Reviews About Event Espresso 4', 'event_espresso');
192
-        $this->_template_args['admin_page_subtitle'] = esc_html__(
193
-            'At Event Espresso, customer satisfaction is our ultimate goal.',
194
-            'event_espresso'
195
-        );
196
-        $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
197
-        $this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
198
-            $template,
199
-            $this->_template_args,
200
-            true
201
-        );
202
-        $this->display_about_admin_page();
203
-    }
90
+			'reviews'  => array(
91
+				'nav'           => array(
92
+					'label' => esc_html__('Reviews', 'event_espresso'),
93
+					'order' => 50,
94
+				),
95
+				'require_nonce' => false,
96
+			),
97
+
98
+		);
99
+	}
100
+
101
+
102
+	protected function _whats_new()
103
+	{
104
+		$steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance
105
+			? $this->_get_started_steps() : false;
106
+		$steps = $steps !== false ? $steps : '';
107
+		$this->_admin_page_title = sprintf(
108
+			esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
109
+			EVENT_ESPRESSO_VERSION
110
+		);
111
+		$settings_message = $steps;
112
+		$this->_template_args['admin_page_subtitle'] = esc_html__(
113
+			'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
114
+			'event_espresso'
115
+		) . $settings_message;
116
+		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php')
117
+			? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php';
118
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
119
+			$template,
120
+			$this->_template_args,
121
+			true
122
+		);
123
+		$this->display_about_admin_page();
124
+	}
125
+
126
+
127
+	protected function _overview()
128
+	{
129
+		$this->_admin_page_title = esc_html__('About Event Espresso', 'event_espresso');
130
+		$this->_template_args['admin_page_subtitle'] = esc_html__(
131
+			'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
132
+			'event_espresso'
133
+		);
134
+		$template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php')
135
+			? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php'
136
+			: EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php';
137
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
138
+			$template,
139
+			$this->_template_args,
140
+			true
141
+		);
142
+		$this->display_about_admin_page();
143
+	}
144
+
145
+	protected function _credits()
146
+	{
147
+		// $this->_template_args['admin_page_title'] = sprintf(
148
+		//     esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
149
+		//     EVENT_ESPRESSO_VERSION
150
+		// );
151
+		$this->_template_args['admin_page_subtitle'] = esc_html__(
152
+			'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.',
153
+			'event_espresso'
154
+		);
155
+		$template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
156
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
157
+			$template,
158
+			$this->_template_args,
159
+			true
160
+		);
161
+		$this->display_about_admin_page();
162
+	}
163
+
164
+	protected function _decafvpro()
165
+	{
166
+		$this->_template_args['admin_page_title'] = sprintf(
167
+			esc_html__('Welcome to Event Espresso %s', 'event_espresso'),
168
+			EVENT_ESPRESSO_VERSION
169
+		);
170
+		$this->_template_args['admin_page_subtitle'] = sprintf(
171
+			esc_html__(
172
+				'Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s',
173
+				'event_espresso'
174
+			),
175
+			'<em>',
176
+			'</em>',
177
+			'<strong>',
178
+			'</strong>'
179
+		);
180
+		$template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php';
181
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
182
+			$template,
183
+			$this->_template_args,
184
+			true
185
+		);
186
+		$this->display_about_admin_page();
187
+	}
188
+
189
+	protected function _reviews()
190
+	{
191
+		$this->_template_args['admin_page_title'] = esc_html__('Rave Reviews About Event Espresso 4', 'event_espresso');
192
+		$this->_template_args['admin_page_subtitle'] = esc_html__(
193
+			'At Event Espresso, customer satisfaction is our ultimate goal.',
194
+			'event_espresso'
195
+		);
196
+		$template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php';
197
+		$this->_template_args['about_admin_page_content'] = EEH_Template::display_template(
198
+			$template,
199
+			$this->_template_args,
200
+			true
201
+		);
202
+		$this->display_about_admin_page();
203
+	}
204 204
 }
Please login to merge, or discard this patch.
Extend_Registration_Form_Questions_Admin_List_Table.class.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $system_question = $item->is_system_question();
27 27
         $actions = array();
28 28
 
29
-        if (! defined('REG_ADMIN_URL')) {
29
+        if ( ! defined('REG_ADMIN_URL')) {
30 30
             define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
31 31
         }
32 32
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
             )
70 70
         ) {
71 71
             $actions = array(
72
-                'edit' => '<a href="' . $edit_link . '" title="'
73
-                          . esc_html__('Edit Question', 'event_espresso') . '">'
74
-                          . esc_html__('Edit', 'event_espresso') . '</a>',
72
+                'edit' => '<a href="'.$edit_link.'" title="'
73
+                          . esc_html__('Edit Question', 'event_espresso').'">'
74
+                          . esc_html__('Edit', 'event_espresso').'</a>',
75 75
             );
76 76
         }
77 77
 
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
                 $item->ID()
85 85
             )
86 86
         ) {
87
-                $actions['delete'] = '<a href="' . $trash_link . '" title="'
88
-                                     . esc_html__('Trash Question', 'event_espresso') . '">'
89
-                                     . esc_html__('Trash', 'event_espresso') . '</a>';
87
+                $actions['delete'] = '<a href="'.$trash_link.'" title="'
88
+                                     . esc_html__('Trash Question', 'event_espresso').'">'
89
+                                     . esc_html__('Trash', 'event_espresso').'</a>';
90 90
         }
91 91
 
92 92
         if ($this->_view == 'trash') {
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
                     $item->ID()
98 98
                 )
99 99
             ) {
100
-                $actions['restore'] = '<a href="' . $restore_link . '" title="'
101
-                                      . esc_html__('Restore Question', 'event_espresso') . '">'
102
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
100
+                $actions['restore'] = '<a href="'.$restore_link.'" title="'
101
+                                      . esc_html__('Restore Question', 'event_espresso').'">'
102
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
103 103
             }
104 104
             if (
105 105
                 $item->count_related('Answer') === 0
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
                     $item->ID()
110 110
                 )
111 111
             ) {
112
-                    $actions['delete'] = '<a href="' . $delete_link . '" title="'
113
-                                         . esc_html__('Delete Question Permanently', 'event_espresso') . '">'
114
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
112
+                    $actions['delete'] = '<a href="'.$delete_link.'" title="'
113
+                                         . esc_html__('Delete Question Permanently', 'event_espresso').'">'
114
+                                         . esc_html__('Delete Permanently', 'event_espresso').'</a>';
115 115
             }
116 116
         }
117 117
         if (
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
                 'espresso_registration_form_edit_question'
121 121
             )
122 122
         ) {
123
-            $actions['duplicate'] = '<a href="' . $duplicate_link . '" title="'
124
-                                    . esc_html__('Duplicate Question', 'event_espresso') . '">'
125
-                                    . esc_html__('Duplicate', 'event_espresso') . '</a>';
123
+            $actions['duplicate'] = '<a href="'.$duplicate_link.'" title="'
124
+                                    . esc_html__('Duplicate Question', 'event_espresso').'">'
125
+                                    . esc_html__('Duplicate', 'event_espresso').'</a>';
126 126
         }
127 127
 
128 128
         $content = EE_Registry::instance()->CAP->current_user_can(
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             'espresso_registration_form_edit_question',
131 131
             $item->ID()
132 132
         )
133
-            ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>'
133
+            ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->display_text().'</a></strong>'
134 134
             : $item->display_text();
135 135
         $content .= $this->row_actions($actions);
136 136
         return $content;
Please login to merge, or discard this patch.
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -15,123 +15,123 @@
 block discarded – undo
15 15
  */
16 16
 class Extend_Registration_Form_Questions_Admin_List_Table extends Registration_Form_Questions_Admin_List_Table
17 17
 {
18
-    public function __construct($admin_page)
19
-    {
20
-        parent::__construct($admin_page);
21
-    }
18
+	public function __construct($admin_page)
19
+	{
20
+		parent::__construct($admin_page);
21
+	}
22 22
 
23
-    public function column_display_text(EE_Question $item)
24
-    {
25
-        $system_question = $item->is_system_question();
26
-        $actions = array();
23
+	public function column_display_text(EE_Question $item)
24
+	{
25
+		$system_question = $item->is_system_question();
26
+		$actions = array();
27 27
 
28
-        if (! defined('REG_ADMIN_URL')) {
29
-            define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
30
-        }
28
+		if (! defined('REG_ADMIN_URL')) {
29
+			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
30
+		}
31 31
 
32
-        $edit_query_args = array(
33
-            'action' => 'edit_question',
34
-            'QST_ID' => $item->ID(),
35
-        );
32
+		$edit_query_args = array(
33
+			'action' => 'edit_question',
34
+			'QST_ID' => $item->ID(),
35
+		);
36 36
 
37
-        $trash_query_args = array(
38
-            'action' => 'trash_question',
39
-            'QST_ID' => $item->ID(),
40
-        );
37
+		$trash_query_args = array(
38
+			'action' => 'trash_question',
39
+			'QST_ID' => $item->ID(),
40
+		);
41 41
 
42
-        $restore_query_args = array(
43
-            'action' => 'restore_question',
44
-            'QST_ID' => $item->ID(),
45
-        );
42
+		$restore_query_args = array(
43
+			'action' => 'restore_question',
44
+			'QST_ID' => $item->ID(),
45
+		);
46 46
 
47
-        $delete_query_args = array(
48
-            'action' => 'delete_questions',
49
-            'QST_ID' => $item->ID(),
50
-        );
47
+		$delete_query_args = array(
48
+			'action' => 'delete_questions',
49
+			'QST_ID' => $item->ID(),
50
+		);
51 51
 
52
-        $duplicate_query_args = array(
53
-            'action' => 'duplicate_question',
54
-            'QST_ID' => $item->ID(),
55
-        );
52
+		$duplicate_query_args = array(
53
+			'action' => 'duplicate_question',
54
+			'QST_ID' => $item->ID(),
55
+		);
56 56
 
57
-        $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
58
-        $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
59
-        $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
60
-        $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
61
-        $duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL);
57
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
58
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
59
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
60
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
61
+		$duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL);
62 62
 
63
-        if (
64
-            EE_Registry::instance()->CAP->current_user_can(
65
-                'ee_edit_question',
66
-                'espresso_registration_form_edit_question',
67
-                $item->ID()
68
-            )
69
-        ) {
70
-            $actions = array(
71
-                'edit' => '<a href="' . $edit_link . '" title="'
72
-                          . esc_html__('Edit Question', 'event_espresso') . '">'
73
-                          . esc_html__('Edit', 'event_espresso') . '</a>',
74
-            );
75
-        }
63
+		if (
64
+			EE_Registry::instance()->CAP->current_user_can(
65
+				'ee_edit_question',
66
+				'espresso_registration_form_edit_question',
67
+				$item->ID()
68
+			)
69
+		) {
70
+			$actions = array(
71
+				'edit' => '<a href="' . $edit_link . '" title="'
72
+						  . esc_html__('Edit Question', 'event_espresso') . '">'
73
+						  . esc_html__('Edit', 'event_espresso') . '</a>',
74
+			);
75
+		}
76 76
 
77
-        if (
78
-            ! $system_question
79
-            && $this->_view != 'trash'
80
-            && EE_Registry::instance()->CAP->current_user_can(
81
-                'ee_delete_question',
82
-                'espresso_registration_form_trash_question',
83
-                $item->ID()
84
-            )
85
-        ) {
86
-                $actions['delete'] = '<a href="' . $trash_link . '" title="'
87
-                                     . esc_html__('Trash Question', 'event_espresso') . '">'
88
-                                     . esc_html__('Trash', 'event_espresso') . '</a>';
89
-        }
77
+		if (
78
+			! $system_question
79
+			&& $this->_view != 'trash'
80
+			&& EE_Registry::instance()->CAP->current_user_can(
81
+				'ee_delete_question',
82
+				'espresso_registration_form_trash_question',
83
+				$item->ID()
84
+			)
85
+		) {
86
+				$actions['delete'] = '<a href="' . $trash_link . '" title="'
87
+									 . esc_html__('Trash Question', 'event_espresso') . '">'
88
+									 . esc_html__('Trash', 'event_espresso') . '</a>';
89
+		}
90 90
 
91
-        if ($this->_view == 'trash') {
92
-            if (
93
-                EE_Registry::instance()->CAP->current_user_can(
94
-                    'ee_delete_question',
95
-                    'espresso_registration_form_restore_question',
96
-                    $item->ID()
97
-                )
98
-            ) {
99
-                $actions['restore'] = '<a href="' . $restore_link . '" title="'
100
-                                      . esc_html__('Restore Question', 'event_espresso') . '">'
101
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
102
-            }
103
-            if (
104
-                $item->count_related('Answer') === 0
105
-                && EE_Registry::instance()->CAP->current_user_can(
106
-                    'ee_delete_question',
107
-                    'espresso_registration_form_delete_questions',
108
-                    $item->ID()
109
-                )
110
-            ) {
111
-                    $actions['delete'] = '<a href="' . $delete_link . '" title="'
112
-                                         . esc_html__('Delete Question Permanently', 'event_espresso') . '">'
113
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
114
-            }
115
-        }
116
-        if (
117
-            EE_Registry::instance()->CAP->current_user_can(
118
-                'ee_edit_questions',
119
-                'espresso_registration_form_edit_question'
120
-            )
121
-        ) {
122
-            $actions['duplicate'] = '<a href="' . $duplicate_link . '" title="'
123
-                                    . esc_html__('Duplicate Question', 'event_espresso') . '">'
124
-                                    . esc_html__('Duplicate', 'event_espresso') . '</a>';
125
-        }
91
+		if ($this->_view == 'trash') {
92
+			if (
93
+				EE_Registry::instance()->CAP->current_user_can(
94
+					'ee_delete_question',
95
+					'espresso_registration_form_restore_question',
96
+					$item->ID()
97
+				)
98
+			) {
99
+				$actions['restore'] = '<a href="' . $restore_link . '" title="'
100
+									  . esc_html__('Restore Question', 'event_espresso') . '">'
101
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
102
+			}
103
+			if (
104
+				$item->count_related('Answer') === 0
105
+				&& EE_Registry::instance()->CAP->current_user_can(
106
+					'ee_delete_question',
107
+					'espresso_registration_form_delete_questions',
108
+					$item->ID()
109
+				)
110
+			) {
111
+					$actions['delete'] = '<a href="' . $delete_link . '" title="'
112
+										 . esc_html__('Delete Question Permanently', 'event_espresso') . '">'
113
+										 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
114
+			}
115
+		}
116
+		if (
117
+			EE_Registry::instance()->CAP->current_user_can(
118
+				'ee_edit_questions',
119
+				'espresso_registration_form_edit_question'
120
+			)
121
+		) {
122
+			$actions['duplicate'] = '<a href="' . $duplicate_link . '" title="'
123
+									. esc_html__('Duplicate Question', 'event_espresso') . '">'
124
+									. esc_html__('Duplicate', 'event_espresso') . '</a>';
125
+		}
126 126
 
127
-        $content = EE_Registry::instance()->CAP->current_user_can(
128
-            'ee_edit_question',
129
-            'espresso_registration_form_edit_question',
130
-            $item->ID()
131
-        )
132
-            ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>'
133
-            : $item->display_text();
134
-        $content .= $this->row_actions($actions);
135
-        return $content;
136
-    }
127
+		$content = EE_Registry::instance()->CAP->current_user_can(
128
+			'ee_edit_question',
129
+			'espresso_registration_form_edit_question',
130
+			$item->ID()
131
+		)
132
+			? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>'
133
+			: $item->display_text();
134
+		$content .= $this->row_actions($actions);
135
+		return $content;
136
+	}
137 137
 }
Please login to merge, or discard this patch.
Registration_Form_Question_Groups_Admin_List_Table.class.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                    'espresso_registration_form_trash_question_groups',
125 125
                    $item->ID()
126 126
                )
127
-            ? '<span class="' . $lock_icon . '"></span>'
127
+            ? '<span class="'.$lock_icon.'"></span>'
128 128
               . sprintf(
129 129
                   '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />',
130 130
                   $item->ID()
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     public function column_id(EE_Question_Group $item)
140 140
     {
141 141
         $content = $item->ID();
142
-        $content .= '  <span class="show-on-mobile-view-only">' . $item->name() . '</span>';
142
+        $content .= '  <span class="show-on-mobile-view-only">'.$item->name().'</span>';
143 143
         return $content;
144 144
     }
145 145
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $actions = array();
150 150
 
151 151
         // return $item->name();
152
-        if (! defined('REG_ADMIN_URL')) {
152
+        if ( ! defined('REG_ADMIN_URL')) {
153 153
             define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
154 154
         }
155 155
 
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
             )
188 188
         ) {
189 189
             $actions = array(
190
-                'edit' => '<a href="' . $edit_link . '" title="'
191
-                          . esc_attr__('Edit Question Group', 'event_espresso') . '">'
192
-                          . esc_html__('Edit', 'event_espresso') . '</a>',
190
+                'edit' => '<a href="'.$edit_link.'" title="'
191
+                          . esc_attr__('Edit Question Group', 'event_espresso').'">'
192
+                          . esc_html__('Edit', 'event_espresso').'</a>',
193 193
             );
194 194
         }
195 195
         if (
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
                 $item->ID()
202 202
             )
203 203
         ) {
204
-            $actions['delete'] = '<a href="' . $trash_link . '" title="'
205
-                                 . esc_attr__('Delete Question Group', 'event_espresso') . '">'
206
-                                 . esc_html__('Trash', 'event_espresso') . '</a>';
204
+            $actions['delete'] = '<a href="'.$trash_link.'" title="'
205
+                                 . esc_attr__('Delete Question Group', 'event_espresso').'">'
206
+                                 . esc_html__('Trash', 'event_espresso').'</a>';
207 207
         }
208 208
 
209 209
         if ($this->_view == 'trash') {
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
                     $item->ID()
215 215
                 )
216 216
             ) {
217
-                $actions['restore'] = '<a href="' . $restore_link . '" title="'
218
-                                      . esc_attr__('Restore Question Group', 'event_espresso') . '">'
219
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
217
+                $actions['restore'] = '<a href="'.$restore_link.'" title="'
218
+                                      . esc_attr__('Restore Question Group', 'event_espresso').'">'
219
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
220 220
             }
221 221
 
222 222
             if (
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
                     $item->ID()
228 228
                 )
229 229
             ) {
230
-                    $actions['delete'] = '<a href="' . $delete_link . '" title="'
231
-                                         . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">'
232
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
230
+                    $actions['delete'] = '<a href="'.$delete_link.'" title="'
231
+                                         . esc_attr__('Delete Question Group Permanently', 'event_espresso').'">'
232
+                                         . esc_html__('Delete Permanently', 'event_espresso').'</a>';
233 233
             }
234 234
         }
235 235
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             'espresso_registration_form_edit_question_group',
239 239
             $item->ID()
240 240
         )
241
-            ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>'
241
+            ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>'
242 242
             : $item->name();
243 243
         $content .= $this->row_actions($actions);
244 244
         return $content;
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
 
260 260
     public function column_show_group_name(EE_Question_Group $item)
261 261
     {
262
-        return $this->_yes_no[ $item->show_group_name() ];
262
+        return $this->_yes_no[$item->show_group_name()];
263 263
     }
264 264
 
265 265
 
266 266
     public function column_show_group_desc(EE_Question_Group $item)
267 267
     {
268
-        return $this->_yes_no[ $item->show_group_desc() ];
268
+        return $this->_yes_no[$item->show_group_desc()];
269 269
     }
270 270
 }
Please login to merge, or discard this patch.
Indentation   +237 added lines, -237 removed lines patch added patch discarded remove patch
@@ -28,241 +28,241 @@
 block discarded – undo
28 28
  */
29 29
 class Registration_Form_Question_Groups_Admin_List_Table extends EE_Admin_List_Table
30 30
 {
31
-    public function __construct($admin_page)
32
-    {
33
-        parent::__construct($admin_page);
34
-    }
35
-
36
-
37
-    protected function _setup_data()
38
-    {
39
-        $this->_data = $this->_view != 'trash'
40
-            ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, false)
41
-            : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, false);
42
-        $this->_all_data_count = $this->_view != 'trash'
43
-            ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, true)
44
-            : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, true);
45
-    }
46
-
47
-
48
-    protected function _set_properties()
49
-    {
50
-        $this->_wp_list_args = array(
51
-            'singular' => esc_html__('question group', 'event_espresso'),
52
-            'plural'   => esc_html__('question groups', 'event_espresso'),
53
-            'ajax'     => true, // for now,
54
-            'screen'   => $this->_admin_page->get_current_screen()->id,
55
-        );
56
-
57
-        $this->_columns = array(
58
-            'cb'              => '<input type="checkbox" />',
59
-            'id'              => esc_html__('ID', 'event_espresso'),
60
-            'name'            => esc_html__('Group Name', 'event_espresso'),
61
-            'description'     => esc_html__('Description', 'event_espresso'),
62
-            'show_group_name' => esc_html__('Show Name', 'event_espresso'),
63
-            'show_group_desc' => esc_html__('Show Desc', 'event_espresso'),
64
-        );
65
-
66
-        $this->_sortable_columns = array(
67
-            'id'   => array('QSG_ID' => false),
68
-            'name' => array('QSG_name' => false),
69
-        );
70
-
71
-        $this->_hidden_columns = array(
72
-            'id',
73
-        );
74
-
75
-        $this->_ajax_sorting_callback = 'update_question_group_order';
76
-    }
77
-
78
-
79
-    // not needed
80
-    protected function _get_table_filters()
81
-    {
82
-        return array();
83
-    }
84
-
85
-
86
-    protected function _add_view_counts()
87
-    {
88
-        $this->_views['all']['count'] = $this->_admin_page->get_question_groups(
89
-            $this->_per_page,
90
-            $this->_current_page,
91
-            true
92
-        );
93
-        if (
94
-            EE_Registry::instance()->CAP->current_user_can(
95
-                'ee_delete_question_groups',
96
-                'espresso_registration_form_trash_question_group'
97
-            )
98
-        ) {
99
-            $this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups(
100
-                $this->_per_page,
101
-                $this->_current_page,
102
-                true
103
-            );
104
-        }
105
-    }
106
-
107
-
108
-    public function column_cb($item)
109
-    {
110
-        $system_group = $item->get('QSG_system');
111
-        $has_questions_with_answers = $item->has_questions_with_answers();
112
-        $lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers
113
-            ? 'ee-lock-icon ee-alternate-color'
114
-            : 'ee-lock-icon ee-system-lock';
115
-        return $system_group > 0
116
-               || ($system_group === 0
117
-                    && $this->_view == 'trash'
118
-                    && $has_questions_with_answers
119
-                )
120
-               || ! EE_Registry::instance()->CAP->current_user_can(
121
-                   'ee_delete_question_groups',
122
-                   'espresso_registration_form_trash_question_groups',
123
-                   $item->ID()
124
-               )
125
-            ? '<span class="' . $lock_icon . '"></span>'
126
-              . sprintf(
127
-                  '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />',
128
-                  $item->ID()
129
-              )
130
-            : sprintf(
131
-                '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />',
132
-                $item->ID()
133
-            );
134
-    }
135
-
136
-
137
-    public function column_id(EE_Question_Group $item)
138
-    {
139
-        $content = $item->ID();
140
-        $content .= '  <span class="show-on-mobile-view-only">' . $item->name() . '</span>';
141
-        return $content;
142
-    }
143
-
144
-
145
-    public function column_name(EE_Question_Group $item)
146
-    {
147
-        $actions = array();
148
-
149
-        // return $item->name();
150
-        if (! defined('REG_ADMIN_URL')) {
151
-            define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
152
-        }
153
-
154
-        $edit_query_args = array(
155
-            'action' => 'edit_question_group',
156
-            'QSG_ID' => $item->ID(),
157
-        );
158
-
159
-        $trash_query_args = array(
160
-            'action' => 'trash_question_group',
161
-            'QSG_ID' => $item->ID(),
162
-        );
163
-
164
-        $restore_query_args = array(
165
-            'action' => 'restore_question_group',
166
-            'QSG_ID' => $item->ID(),
167
-        );
168
-
169
-        $delete_query_args = array(
170
-            'action' => 'delete_question_group',
171
-            'QSG_ID' => $item->ID(),
172
-        );
173
-
174
-
175
-        $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
176
-        $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
177
-        $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
178
-        $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
179
-
180
-        if (
181
-            EE_Registry::instance()->CAP->current_user_can(
182
-                'ee_edit_question_group',
183
-                'espresso_registration_form_edit_question_group',
184
-                $item->ID()
185
-            )
186
-        ) {
187
-            $actions = array(
188
-                'edit' => '<a href="' . $edit_link . '" title="'
189
-                          . esc_attr__('Edit Question Group', 'event_espresso') . '">'
190
-                          . esc_html__('Edit', 'event_espresso') . '</a>',
191
-            );
192
-        }
193
-        if (
194
-            $item->get('QSG_system') < 1
195
-            && $this->_view != 'trash'
196
-            && EE_Registry::instance()->CAP->current_user_can(
197
-                'ee_delete_question_group',
198
-                'espresso_registration_form_trash_question_group',
199
-                $item->ID()
200
-            )
201
-        ) {
202
-            $actions['delete'] = '<a href="' . $trash_link . '" title="'
203
-                                 . esc_attr__('Delete Question Group', 'event_espresso') . '">'
204
-                                 . esc_html__('Trash', 'event_espresso') . '</a>';
205
-        }
206
-
207
-        if ($this->_view == 'trash') {
208
-            if (
209
-                EE_Registry::instance()->CAP->current_user_can(
210
-                    'ee_delete_question_group',
211
-                    'espresso_registration_form_restore_question_group',
212
-                    $item->ID()
213
-                )
214
-            ) {
215
-                $actions['restore'] = '<a href="' . $restore_link . '" title="'
216
-                                      . esc_attr__('Restore Question Group', 'event_espresso') . '">'
217
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
218
-            }
219
-
220
-            if (
221
-                ! $item->has_questions_with_answers()
222
-                && EE_Registry::instance()->CAP->current_user_can(
223
-                    'ee_delete_question_group',
224
-                    'espresso_registration_form_delete_question_group',
225
-                    $item->ID()
226
-                )
227
-            ) {
228
-                    $actions['delete'] = '<a href="' . $delete_link . '" title="'
229
-                                         . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">'
230
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
231
-            }
232
-        }
233
-
234
-        $content = EE_Registry::instance()->CAP->current_user_can(
235
-            'ee_edit_question_group',
236
-            'espresso_registration_form_edit_question_group',
237
-            $item->ID()
238
-        )
239
-            ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>'
240
-            : $item->name();
241
-        $content .= $this->row_actions($actions);
242
-        return $content;
243
-    }
244
-
245
-
246
-    public function column_identifier(EE_Question_Group $item)
247
-    {
248
-        return $item->identifier();
249
-    }
250
-
251
-
252
-    public function column_description(EE_Question_Group $item)
253
-    {
254
-        return $item->desc();
255
-    }
256
-
257
-
258
-    public function column_show_group_name(EE_Question_Group $item)
259
-    {
260
-        return $this->_yes_no[ $item->show_group_name() ];
261
-    }
262
-
263
-
264
-    public function column_show_group_desc(EE_Question_Group $item)
265
-    {
266
-        return $this->_yes_no[ $item->show_group_desc() ];
267
-    }
31
+	public function __construct($admin_page)
32
+	{
33
+		parent::__construct($admin_page);
34
+	}
35
+
36
+
37
+	protected function _setup_data()
38
+	{
39
+		$this->_data = $this->_view != 'trash'
40
+			? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, false)
41
+			: $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, false);
42
+		$this->_all_data_count = $this->_view != 'trash'
43
+			? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, true)
44
+			: $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, true);
45
+	}
46
+
47
+
48
+	protected function _set_properties()
49
+	{
50
+		$this->_wp_list_args = array(
51
+			'singular' => esc_html__('question group', 'event_espresso'),
52
+			'plural'   => esc_html__('question groups', 'event_espresso'),
53
+			'ajax'     => true, // for now,
54
+			'screen'   => $this->_admin_page->get_current_screen()->id,
55
+		);
56
+
57
+		$this->_columns = array(
58
+			'cb'              => '<input type="checkbox" />',
59
+			'id'              => esc_html__('ID', 'event_espresso'),
60
+			'name'            => esc_html__('Group Name', 'event_espresso'),
61
+			'description'     => esc_html__('Description', 'event_espresso'),
62
+			'show_group_name' => esc_html__('Show Name', 'event_espresso'),
63
+			'show_group_desc' => esc_html__('Show Desc', 'event_espresso'),
64
+		);
65
+
66
+		$this->_sortable_columns = array(
67
+			'id'   => array('QSG_ID' => false),
68
+			'name' => array('QSG_name' => false),
69
+		);
70
+
71
+		$this->_hidden_columns = array(
72
+			'id',
73
+		);
74
+
75
+		$this->_ajax_sorting_callback = 'update_question_group_order';
76
+	}
77
+
78
+
79
+	// not needed
80
+	protected function _get_table_filters()
81
+	{
82
+		return array();
83
+	}
84
+
85
+
86
+	protected function _add_view_counts()
87
+	{
88
+		$this->_views['all']['count'] = $this->_admin_page->get_question_groups(
89
+			$this->_per_page,
90
+			$this->_current_page,
91
+			true
92
+		);
93
+		if (
94
+			EE_Registry::instance()->CAP->current_user_can(
95
+				'ee_delete_question_groups',
96
+				'espresso_registration_form_trash_question_group'
97
+			)
98
+		) {
99
+			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups(
100
+				$this->_per_page,
101
+				$this->_current_page,
102
+				true
103
+			);
104
+		}
105
+	}
106
+
107
+
108
+	public function column_cb($item)
109
+	{
110
+		$system_group = $item->get('QSG_system');
111
+		$has_questions_with_answers = $item->has_questions_with_answers();
112
+		$lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers
113
+			? 'ee-lock-icon ee-alternate-color'
114
+			: 'ee-lock-icon ee-system-lock';
115
+		return $system_group > 0
116
+			   || ($system_group === 0
117
+					&& $this->_view == 'trash'
118
+					&& $has_questions_with_answers
119
+				)
120
+			   || ! EE_Registry::instance()->CAP->current_user_can(
121
+				   'ee_delete_question_groups',
122
+				   'espresso_registration_form_trash_question_groups',
123
+				   $item->ID()
124
+			   )
125
+			? '<span class="' . $lock_icon . '"></span>'
126
+			  . sprintf(
127
+				  '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />',
128
+				  $item->ID()
129
+			  )
130
+			: sprintf(
131
+				'<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />',
132
+				$item->ID()
133
+			);
134
+	}
135
+
136
+
137
+	public function column_id(EE_Question_Group $item)
138
+	{
139
+		$content = $item->ID();
140
+		$content .= '  <span class="show-on-mobile-view-only">' . $item->name() . '</span>';
141
+		return $content;
142
+	}
143
+
144
+
145
+	public function column_name(EE_Question_Group $item)
146
+	{
147
+		$actions = array();
148
+
149
+		// return $item->name();
150
+		if (! defined('REG_ADMIN_URL')) {
151
+			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
152
+		}
153
+
154
+		$edit_query_args = array(
155
+			'action' => 'edit_question_group',
156
+			'QSG_ID' => $item->ID(),
157
+		);
158
+
159
+		$trash_query_args = array(
160
+			'action' => 'trash_question_group',
161
+			'QSG_ID' => $item->ID(),
162
+		);
163
+
164
+		$restore_query_args = array(
165
+			'action' => 'restore_question_group',
166
+			'QSG_ID' => $item->ID(),
167
+		);
168
+
169
+		$delete_query_args = array(
170
+			'action' => 'delete_question_group',
171
+			'QSG_ID' => $item->ID(),
172
+		);
173
+
174
+
175
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
176
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
177
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
178
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
179
+
180
+		if (
181
+			EE_Registry::instance()->CAP->current_user_can(
182
+				'ee_edit_question_group',
183
+				'espresso_registration_form_edit_question_group',
184
+				$item->ID()
185
+			)
186
+		) {
187
+			$actions = array(
188
+				'edit' => '<a href="' . $edit_link . '" title="'
189
+						  . esc_attr__('Edit Question Group', 'event_espresso') . '">'
190
+						  . esc_html__('Edit', 'event_espresso') . '</a>',
191
+			);
192
+		}
193
+		if (
194
+			$item->get('QSG_system') < 1
195
+			&& $this->_view != 'trash'
196
+			&& EE_Registry::instance()->CAP->current_user_can(
197
+				'ee_delete_question_group',
198
+				'espresso_registration_form_trash_question_group',
199
+				$item->ID()
200
+			)
201
+		) {
202
+			$actions['delete'] = '<a href="' . $trash_link . '" title="'
203
+								 . esc_attr__('Delete Question Group', 'event_espresso') . '">'
204
+								 . esc_html__('Trash', 'event_espresso') . '</a>';
205
+		}
206
+
207
+		if ($this->_view == 'trash') {
208
+			if (
209
+				EE_Registry::instance()->CAP->current_user_can(
210
+					'ee_delete_question_group',
211
+					'espresso_registration_form_restore_question_group',
212
+					$item->ID()
213
+				)
214
+			) {
215
+				$actions['restore'] = '<a href="' . $restore_link . '" title="'
216
+									  . esc_attr__('Restore Question Group', 'event_espresso') . '">'
217
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
218
+			}
219
+
220
+			if (
221
+				! $item->has_questions_with_answers()
222
+				&& EE_Registry::instance()->CAP->current_user_can(
223
+					'ee_delete_question_group',
224
+					'espresso_registration_form_delete_question_group',
225
+					$item->ID()
226
+				)
227
+			) {
228
+					$actions['delete'] = '<a href="' . $delete_link . '" title="'
229
+										 . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">'
230
+										 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
231
+			}
232
+		}
233
+
234
+		$content = EE_Registry::instance()->CAP->current_user_can(
235
+			'ee_edit_question_group',
236
+			'espresso_registration_form_edit_question_group',
237
+			$item->ID()
238
+		)
239
+			? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>'
240
+			: $item->name();
241
+		$content .= $this->row_actions($actions);
242
+		return $content;
243
+	}
244
+
245
+
246
+	public function column_identifier(EE_Question_Group $item)
247
+	{
248
+		return $item->identifier();
249
+	}
250
+
251
+
252
+	public function column_description(EE_Question_Group $item)
253
+	{
254
+		return $item->desc();
255
+	}
256
+
257
+
258
+	public function column_show_group_name(EE_Question_Group $item)
259
+	{
260
+		return $this->_yes_no[ $item->show_group_name() ];
261
+	}
262
+
263
+
264
+	public function column_show_group_desc(EE_Question_Group $item)
265
+	{
266
+		return $this->_yes_no[ $item->show_group_desc() ];
267
+	}
268 268
 }
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Pricing_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
         define('PRICING_PG_SLUG', 'pricing');
31 31
         define('PRICING_LABEL', esc_html__('Pricing', 'event_espresso'));
32 32
         define('PRICING_PG_NAME', ucwords(str_replace('_', '', PRICING_PG_SLUG)));
33
-        define('PRICING_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . PRICING_PG_SLUG . '/');
34
-        define('PRICING_ADMIN_URL', admin_url('admin.php?page=' . PRICING_PG_SLUG));
35
-        define('PRICING_ASSETS_PATH', PRICING_ADMIN . 'assets/');
36
-        define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/assets/');
37
-        define('PRICING_TEMPLATE_PATH', PRICING_ADMIN . 'templates/');
38
-        define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/templates/');
33
+        define('PRICING_ADMIN', EE_CORE_CAF_ADMIN.'new/'.PRICING_PG_SLUG.'/');
34
+        define('PRICING_ADMIN_URL', admin_url('admin.php?page='.PRICING_PG_SLUG));
35
+        define('PRICING_ASSETS_PATH', PRICING_ADMIN.'assets/');
36
+        define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new/'.PRICING_PG_SLUG.'/assets/');
37
+        define('PRICING_TEMPLATE_PATH', PRICING_ADMIN.'templates/');
38
+        define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new/'.PRICING_PG_SLUG.'/templates/');
39 39
 
40 40
         parent::__construct();
41
-        $this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . '/';
41
+        $this->_folder_path = EE_CORE_CAF_ADMIN.'new/'.$this->_folder_name.'/';
42 42
     }
43 43
 
44 44
 
Please login to merge, or discard this patch.
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -13,52 +13,52 @@
 block discarded – undo
13 13
  */
14 14
 class Pricing_Admin_Page_Init extends EE_Admin_Page_Init
15 15
 {
16
-    /**
17
-     *        constructor
18
-     *
19
-     * @Constructor
20
-     * @access public
21
-     * @return Pricing_Admin_Page_Init
22
-     */
23
-    public function __construct()
24
-    {
16
+	/**
17
+	 *        constructor
18
+	 *
19
+	 * @Constructor
20
+	 * @access public
21
+	 * @return Pricing_Admin_Page_Init
22
+	 */
23
+	public function __construct()
24
+	{
25 25
 
26
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
26
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
27 27
 
28
-        define('PRICING_PG_SLUG', 'pricing');
29
-        define('PRICING_LABEL', esc_html__('Pricing', 'event_espresso'));
30
-        define('PRICING_PG_NAME', ucwords(str_replace('_', '', PRICING_PG_SLUG)));
31
-        define('PRICING_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . PRICING_PG_SLUG . '/');
32
-        define('PRICING_ADMIN_URL', admin_url('admin.php?page=' . PRICING_PG_SLUG));
33
-        define('PRICING_ASSETS_PATH', PRICING_ADMIN . 'assets/');
34
-        define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/assets/');
35
-        define('PRICING_TEMPLATE_PATH', PRICING_ADMIN . 'templates/');
36
-        define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/templates/');
28
+		define('PRICING_PG_SLUG', 'pricing');
29
+		define('PRICING_LABEL', esc_html__('Pricing', 'event_espresso'));
30
+		define('PRICING_PG_NAME', ucwords(str_replace('_', '', PRICING_PG_SLUG)));
31
+		define('PRICING_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . PRICING_PG_SLUG . '/');
32
+		define('PRICING_ADMIN_URL', admin_url('admin.php?page=' . PRICING_PG_SLUG));
33
+		define('PRICING_ASSETS_PATH', PRICING_ADMIN . 'assets/');
34
+		define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/assets/');
35
+		define('PRICING_TEMPLATE_PATH', PRICING_ADMIN . 'templates/');
36
+		define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . PRICING_PG_SLUG . '/templates/');
37 37
 
38
-        parent::__construct();
39
-        $this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . '/';
40
-    }
38
+		parent::__construct();
39
+		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . '/';
40
+	}
41 41
 
42 42
 
43
-    protected function _set_init_properties()
44
-    {
45
-        $this->label = PRICING_LABEL;
46
-    }
43
+	protected function _set_init_properties()
44
+	{
45
+		$this->label = PRICING_LABEL;
46
+	}
47 47
 
48 48
 
49
-    protected function _set_menu_map()
50
-    {
51
-        $this->_menu_map = new EE_Admin_Page_Sub_Menu(
52
-            array(
53
-                'menu_group'      => 'management',
54
-                'menu_order'      => 20,
55
-                'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
56
-                'parent_slug'     => 'espresso_events',
57
-                'menu_slug'       => PRICING_PG_SLUG,
58
-                'menu_label'      => PRICING_LABEL,
59
-                'capability'      => 'ee_read_default_prices',
60
-                'admin_init_page' => $this,
61
-            )
62
-        );
63
-    }
49
+	protected function _set_menu_map()
50
+	{
51
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(
52
+			array(
53
+				'menu_group'      => 'management',
54
+				'menu_order'      => 20,
55
+				'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
56
+				'parent_slug'     => 'espresso_events',
57
+				'menu_slug'       => PRICING_PG_SLUG,
58
+				'menu_label'      => PRICING_LABEL,
59
+				'capability'      => 'ee_read_default_prices',
60
+				'admin_init_page' => $this,
61
+			)
62
+		);
63
+	}
64 64
 }
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Prices_List_Table.class.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function __construct($admin_page)
29 29
     {
30 30
         parent::__construct($admin_page);
31
-        require_once(EE_MODELS . 'EEM_Price_Type.model.php');
31
+        require_once(EE_MODELS.'EEM_Price_Type.model.php');
32 32
         $this->_PRT = EEM_Price_Type::instance();
33 33
         $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
34 34
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $new_row .= ' rowsortable';
105 105
         }
106 106
 
107
-        return ' class="' . $new_row . '"';
107
+        return ' class="'.$new_row.'"';
108 108
     }
109 109
 
110 110
 
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
                 'action' => 'edit_price',
138 138
                 'id'     => $item->ID(),
139 139
             ), PRICING_ADMIN_URL);
140
-            $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="'
141
-                               . esc_attr__('Edit Price', 'event_espresso') . '">'
142
-                               . esc_html__('Edit', 'event_espresso') . '</a>';
140
+            $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'
141
+                               . esc_attr__('Edit Price', 'event_espresso').'">'
142
+                               . esc_html__('Edit', 'event_espresso').'</a>';
143 143
         }
144 144
 
145 145
         $name_link = EE_Registry::instance()->CAP->current_user_can(
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
             'edit_price',
148 148
             $item->ID()
149 149
         )
150
-            ? '<a href="' . $edit_lnk_url . '" title="'
151
-              . esc_attr__('Edit Price', 'event_espresso') . '">'
152
-              . stripslashes($item->name()) . '</a>'
150
+            ? '<a href="'.$edit_lnk_url.'" title="'
151
+              . esc_attr__('Edit Price', 'event_espresso').'">'
152
+              . stripslashes($item->name()).'</a>'
153 153
             : $item->name();
154 154
 
155 155
         if ($item->type_obj()->base_type() !== 1) {
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
                         'id'       => $item->ID(),
168 168
                         'noheader' => true,
169 169
                     ), PRICING_ADMIN_URL);
170
-                    $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
171
-                                        . esc_attr__('Move Price to Trash', 'event_espresso') . '">'
172
-                                        . esc_html__('Move to Trash', 'event_espresso') . '</a>';
170
+                    $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'
171
+                                        . esc_attr__('Move Price to Trash', 'event_espresso').'">'
172
+                                        . esc_html__('Move to Trash', 'event_espresso').'</a>';
173 173
                 }
174 174
             } else {
175 175
                 if (
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
                         'id'       => $item->ID(),
186 186
                         'noheader' => true,
187 187
                     ), PRICING_ADMIN_URL);
188
-                    $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
189
-                                          . esc_attr__('Restore Price', 'event_espresso') . '">'
190
-                                          . esc_html__('Restore', 'event_espresso') . '</a>';
188
+                    $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'
189
+                                          . esc_attr__('Restore Price', 'event_espresso').'">'
190
+                                          . esc_html__('Restore', 'event_espresso').'</a>';
191 191
                 }
192 192
 
193 193
                 // delete price link
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
                         'id'       => $item->ID(),
204 204
                         'noheader' => true,
205 205
                     ), PRICING_ADMIN_URL);
206
-                    $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
207
-                                         . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
208
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
206
+                    $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'
207
+                                         . esc_attr__('Delete Price Permanently', 'event_espresso').'">'
208
+                                         . esc_html__('Delete Permanently', 'event_espresso').'</a>';
209 209
                 }
210 210
             }
211 211
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
     public function column_type($item)
224 224
     {
225
-        return $this->_price_types[ $item->type() ]->name();
225
+        return $this->_price_types[$item->type()]->name();
226 226
     }
227 227
 
228 228
 
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 
235 235
     public function column_amount($item)
236 236
     {
237
-        if ($this->_price_types[ $item->type() ]->is_percent()) {
238
-            return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
237
+        if ($this->_price_types[$item->type()]->is_percent()) {
238
+            return '<div class="pad-amnt-rght">'.number_format($item->amount(), 1).'%</div>';
239 239
         } else {
240
-            return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
240
+            return '<div class="pad-amnt-rght">'.EEH_Template::format_currency($item->amount()).'</div>';
241 241
         }
242 242
     }
243 243
 }
Please login to merge, or discard this patch.
Indentation   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -15,228 +15,228 @@
 block discarded – undo
15 15
  */
16 16
 class Prices_List_Table extends EE_Admin_List_Table
17 17
 {
18
-    private $_PRT;
19
-
20
-    /**
21
-     * Array of price types.
22
-     *
23
-     * @var EE_Price_Type[]
24
-     */
25
-    protected $_price_types = array();
26
-
27
-    public function __construct($admin_page)
28
-    {
29
-        parent::__construct($admin_page);
30
-        require_once(EE_MODELS . 'EEM_Price_Type.model.php');
31
-        $this->_PRT = EEM_Price_Type::instance();
32
-        $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
33
-    }
34
-
35
-
36
-    protected function _setup_data()
37
-    {
38
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
39
-        $this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed);
40
-        $this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false);
41
-        $this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true);
42
-    }
43
-
44
-
45
-    protected function _set_properties()
46
-    {
47
-        $this->_wp_list_args = array(
48
-            'singular' => esc_html__('price', 'event_espresso'),
49
-            'plural'   => esc_html__('prices', 'event_espresso'),
50
-            'ajax'     => true,
51
-            'screen'   => $this->_admin_page->get_current_screen()->id,
52
-        );
53
-
54
-        $this->_columns = array(
55
-            'cb'          => '<input type="checkbox" />', // Render a checkbox instead of text
56
-            'name'        => esc_html__('Name', 'event_espresso'),
57
-            'type'        => esc_html__('Price Type', 'event_espresso'),
58
-            'description' => esc_html__('Description', 'event_espresso'),
59
-            'amount'      => esc_html__('Amount', 'event_espresso'),
60
-        );
61
-
62
-        $this->_sortable_columns = array(
63
-            // true means its already sorted
64
-            'name'   => array('name' => false),
65
-            'type'   => array('type' => false),
66
-            'amount' => array('amount' => false),
67
-        );
68
-
69
-        $this->_hidden_columns = array();
70
-
71
-        $this->_ajax_sorting_callback = 'update_prices_order';
72
-    }
73
-
74
-
75
-    protected function _get_table_filters()
76
-    {
77
-    }
78
-
79
-
80
-    protected function _add_view_counts()
81
-    {
82
-        $this->_views['all']['count'] = $this->_all_data_count;
83
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
84
-            $this->_views['trashed']['count'] = $this->_trashed_count;
85
-        }
86
-    }
87
-
88
-
89
-    /**
90
-     * overriding parent method so that we can make sure the row isn't sortable for certain items
91
-     *
92
-     * @param  object $item the current item
93
-     * @return string
94
-     */
95
-    protected function _get_row_class($item)
96
-    {
97
-        static $row_class = '';
98
-        $row_class = ($row_class == '' ? 'alternate' : '');
99
-
100
-        $new_row = $row_class;
101
-
102
-        if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) {
103
-            $new_row .= ' rowsortable';
104
-        }
105
-
106
-        return ' class="' . $new_row . '"';
107
-    }
108
-
109
-
110
-    public function column_cb($item)
111
-    {
112
-        if ($item->type_obj()->base_type() !== 1) {
113
-            return sprintf(
114
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
115
-                $item->ID()
116
-            );
117
-        }
118
-        return '';
119
-    }
120
-
121
-
122
-    public function column_name($item)
123
-    {
124
-
125
-        // Build row actions
126
-        $actions = array();
127
-        // edit price link
128
-        if (
129
-            EE_Registry::instance()->CAP->current_user_can(
130
-                'ee_edit_default_price',
131
-                'pricing_edit_price',
132
-                $item->ID()
133
-            )
134
-        ) {
135
-            $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
136
-                'action' => 'edit_price',
137
-                'id'     => $item->ID(),
138
-            ), PRICING_ADMIN_URL);
139
-            $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="'
140
-                               . esc_attr__('Edit Price', 'event_espresso') . '">'
141
-                               . esc_html__('Edit', 'event_espresso') . '</a>';
142
-        }
143
-
144
-        $name_link = EE_Registry::instance()->CAP->current_user_can(
145
-            'ee_edit_default_price',
146
-            'edit_price',
147
-            $item->ID()
148
-        )
149
-            ? '<a href="' . $edit_lnk_url . '" title="'
150
-              . esc_attr__('Edit Price', 'event_espresso') . '">'
151
-              . stripslashes($item->name()) . '</a>'
152
-            : $item->name();
153
-
154
-        if ($item->type_obj()->base_type() !== 1) {
155
-            if ($this->_view == 'all') {
156
-                // trash price link
157
-                if (
158
-                    EE_Registry::instance()->CAP->current_user_can(
159
-                        'ee_delete_default_price',
160
-                        'pricing_trash_price',
161
-                        $item->ID()
162
-                    )
163
-                ) {
164
-                    $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
165
-                        'action'   => 'trash_price',
166
-                        'id'       => $item->ID(),
167
-                        'noheader' => true,
168
-                    ), PRICING_ADMIN_URL);
169
-                    $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
170
-                                        . esc_attr__('Move Price to Trash', 'event_espresso') . '">'
171
-                                        . esc_html__('Move to Trash', 'event_espresso') . '</a>';
172
-                }
173
-            } else {
174
-                if (
175
-                    EE_Registry::instance()->CAP->current_user_can(
176
-                        'ee_delete_default_price',
177
-                        'pricing_restore_price',
178
-                        $item->ID()
179
-                    )
180
-                ) {
181
-                    // restore price link
182
-                    $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
183
-                        'action'   => 'restore_price',
184
-                        'id'       => $item->ID(),
185
-                        'noheader' => true,
186
-                    ), PRICING_ADMIN_URL);
187
-                    $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
188
-                                          . esc_attr__('Restore Price', 'event_espresso') . '">'
189
-                                          . esc_html__('Restore', 'event_espresso') . '</a>';
190
-                }
191
-
192
-                // delete price link
193
-                if (
194
-                    EE_Registry::instance()->CAP->current_user_can(
195
-                        'ee_delete_default_price',
196
-                        'pricing_delete_price',
197
-                        $item->ID()
198
-                    )
199
-                ) {
200
-                    $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
201
-                        'action'   => 'delete_price',
202
-                        'id'       => $item->ID(),
203
-                        'noheader' => true,
204
-                    ), PRICING_ADMIN_URL);
205
-                    $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
206
-                                         . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
207
-                                         . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
208
-                }
209
-            }
210
-        }
211
-
212
-        // Return the name contents
213
-        return sprintf(
214
-            '%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
215
-            $name_link,
216
-            $item->ID(),
217
-            $this->row_actions($actions)
218
-        );
219
-    }
220
-
221
-
222
-    public function column_type($item)
223
-    {
224
-        return $this->_price_types[ $item->type() ]->name();
225
-    }
226
-
227
-
228
-    public function column_description($item)
229
-    {
230
-        return stripslashes($item->desc());
231
-    }
232
-
233
-
234
-    public function column_amount($item)
235
-    {
236
-        if ($this->_price_types[ $item->type() ]->is_percent()) {
237
-            return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
238
-        } else {
239
-            return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
240
-        }
241
-    }
18
+	private $_PRT;
19
+
20
+	/**
21
+	 * Array of price types.
22
+	 *
23
+	 * @var EE_Price_Type[]
24
+	 */
25
+	protected $_price_types = array();
26
+
27
+	public function __construct($admin_page)
28
+	{
29
+		parent::__construct($admin_page);
30
+		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
31
+		$this->_PRT = EEM_Price_Type::instance();
32
+		$this->_price_types = $this->_PRT->get_all_deleted_and_undeleted();
33
+	}
34
+
35
+
36
+	protected function _setup_data()
37
+	{
38
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
39
+		$this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed);
40
+		$this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false);
41
+		$this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true);
42
+	}
43
+
44
+
45
+	protected function _set_properties()
46
+	{
47
+		$this->_wp_list_args = array(
48
+			'singular' => esc_html__('price', 'event_espresso'),
49
+			'plural'   => esc_html__('prices', 'event_espresso'),
50
+			'ajax'     => true,
51
+			'screen'   => $this->_admin_page->get_current_screen()->id,
52
+		);
53
+
54
+		$this->_columns = array(
55
+			'cb'          => '<input type="checkbox" />', // Render a checkbox instead of text
56
+			'name'        => esc_html__('Name', 'event_espresso'),
57
+			'type'        => esc_html__('Price Type', 'event_espresso'),
58
+			'description' => esc_html__('Description', 'event_espresso'),
59
+			'amount'      => esc_html__('Amount', 'event_espresso'),
60
+		);
61
+
62
+		$this->_sortable_columns = array(
63
+			// true means its already sorted
64
+			'name'   => array('name' => false),
65
+			'type'   => array('type' => false),
66
+			'amount' => array('amount' => false),
67
+		);
68
+
69
+		$this->_hidden_columns = array();
70
+
71
+		$this->_ajax_sorting_callback = 'update_prices_order';
72
+	}
73
+
74
+
75
+	protected function _get_table_filters()
76
+	{
77
+	}
78
+
79
+
80
+	protected function _add_view_counts()
81
+	{
82
+		$this->_views['all']['count'] = $this->_all_data_count;
83
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
84
+			$this->_views['trashed']['count'] = $this->_trashed_count;
85
+		}
86
+	}
87
+
88
+
89
+	/**
90
+	 * overriding parent method so that we can make sure the row isn't sortable for certain items
91
+	 *
92
+	 * @param  object $item the current item
93
+	 * @return string
94
+	 */
95
+	protected function _get_row_class($item)
96
+	{
97
+		static $row_class = '';
98
+		$row_class = ($row_class == '' ? 'alternate' : '');
99
+
100
+		$new_row = $row_class;
101
+
102
+		if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) {
103
+			$new_row .= ' rowsortable';
104
+		}
105
+
106
+		return ' class="' . $new_row . '"';
107
+	}
108
+
109
+
110
+	public function column_cb($item)
111
+	{
112
+		if ($item->type_obj()->base_type() !== 1) {
113
+			return sprintf(
114
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
115
+				$item->ID()
116
+			);
117
+		}
118
+		return '';
119
+	}
120
+
121
+
122
+	public function column_name($item)
123
+	{
124
+
125
+		// Build row actions
126
+		$actions = array();
127
+		// edit price link
128
+		if (
129
+			EE_Registry::instance()->CAP->current_user_can(
130
+				'ee_edit_default_price',
131
+				'pricing_edit_price',
132
+				$item->ID()
133
+			)
134
+		) {
135
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
136
+				'action' => 'edit_price',
137
+				'id'     => $item->ID(),
138
+			), PRICING_ADMIN_URL);
139
+			$actions['edit'] = '<a href="' . $edit_lnk_url . '" title="'
140
+							   . esc_attr__('Edit Price', 'event_espresso') . '">'
141
+							   . esc_html__('Edit', 'event_espresso') . '</a>';
142
+		}
143
+
144
+		$name_link = EE_Registry::instance()->CAP->current_user_can(
145
+			'ee_edit_default_price',
146
+			'edit_price',
147
+			$item->ID()
148
+		)
149
+			? '<a href="' . $edit_lnk_url . '" title="'
150
+			  . esc_attr__('Edit Price', 'event_espresso') . '">'
151
+			  . stripslashes($item->name()) . '</a>'
152
+			: $item->name();
153
+
154
+		if ($item->type_obj()->base_type() !== 1) {
155
+			if ($this->_view == 'all') {
156
+				// trash price link
157
+				if (
158
+					EE_Registry::instance()->CAP->current_user_can(
159
+						'ee_delete_default_price',
160
+						'pricing_trash_price',
161
+						$item->ID()
162
+					)
163
+				) {
164
+					$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
165
+						'action'   => 'trash_price',
166
+						'id'       => $item->ID(),
167
+						'noheader' => true,
168
+					), PRICING_ADMIN_URL);
169
+					$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
170
+										. esc_attr__('Move Price to Trash', 'event_espresso') . '">'
171
+										. esc_html__('Move to Trash', 'event_espresso') . '</a>';
172
+				}
173
+			} else {
174
+				if (
175
+					EE_Registry::instance()->CAP->current_user_can(
176
+						'ee_delete_default_price',
177
+						'pricing_restore_price',
178
+						$item->ID()
179
+					)
180
+				) {
181
+					// restore price link
182
+					$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
183
+						'action'   => 'restore_price',
184
+						'id'       => $item->ID(),
185
+						'noheader' => true,
186
+					), PRICING_ADMIN_URL);
187
+					$actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
188
+										  . esc_attr__('Restore Price', 'event_espresso') . '">'
189
+										  . esc_html__('Restore', 'event_espresso') . '</a>';
190
+				}
191
+
192
+				// delete price link
193
+				if (
194
+					EE_Registry::instance()->CAP->current_user_can(
195
+						'ee_delete_default_price',
196
+						'pricing_delete_price',
197
+						$item->ID()
198
+					)
199
+				) {
200
+					$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
201
+						'action'   => 'delete_price',
202
+						'id'       => $item->ID(),
203
+						'noheader' => true,
204
+					), PRICING_ADMIN_URL);
205
+					$actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
206
+										 . esc_attr__('Delete Price Permanently', 'event_espresso') . '">'
207
+										 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
208
+				}
209
+			}
210
+		}
211
+
212
+		// Return the name contents
213
+		return sprintf(
214
+			'%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
215
+			$name_link,
216
+			$item->ID(),
217
+			$this->row_actions($actions)
218
+		);
219
+	}
220
+
221
+
222
+	public function column_type($item)
223
+	{
224
+		return $this->_price_types[ $item->type() ]->name();
225
+	}
226
+
227
+
228
+	public function column_description($item)
229
+	{
230
+		return stripslashes($item->desc());
231
+	}
232
+
233
+
234
+	public function column_amount($item)
235
+	{
236
+		if ($this->_price_types[ $item->type() ]->is_percent()) {
237
+			return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>';
238
+		} else {
239
+			return '<div class="pad-amnt-rght">' . EEH_Template::format_currency($item->amount()) . '</div>';
240
+		}
241
+	}
242 242
 }
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@
 block discarded – undo
42 42
 
43 43
         define('TICKETS_PG_SLUG', 'tickets');
44 44
         define('TICKETS_LABEL', esc_html__('Default Tickets', 'event_espresso'));
45
-        define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . TICKETS_PG_SLUG . '/');
46
-        define('TICKETS_ADMIN_URL', admin_url('admin.php?page=' . TICKETS_PG_SLUG));
47
-        define('TICKETS_ASSETS_PATH', TICKETS_ADMIN . 'assets/');
48
-        define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/assets/');
49
-        define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN . 'templates/');
50
-        define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/templates/');
45
+        define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN.'new/'.TICKETS_PG_SLUG.'/');
46
+        define('TICKETS_ADMIN_URL', admin_url('admin.php?page='.TICKETS_PG_SLUG));
47
+        define('TICKETS_ASSETS_PATH', TICKETS_ADMIN.'assets/');
48
+        define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new/'.TICKETS_PG_SLUG.'/assets/');
49
+        define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN.'templates/');
50
+        define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new/'.TICKETS_PG_SLUG.'/templates/');
51 51
 
52 52
         parent::__construct();
53
-        $this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . DS;
53
+        $this->_folder_path = EE_CORE_CAF_ADMIN.'new/'.$this->_folder_name.DS;
54 54
     }
55 55
 
56 56
 
Please login to merge, or discard this patch.
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -26,51 +26,51 @@
 block discarded – undo
26 26
  */
27 27
 class Tickets_Admin_Page_Init extends EE_Admin_Page_Init
28 28
 {
29
-    /**
30
-     *        constructor
31
-     *
32
-     * @Constructor
33
-     * @access public
34
-     * @return void
35
-     */
36
-    public function __construct()
37
-    {
29
+	/**
30
+	 *        constructor
31
+	 *
32
+	 * @Constructor
33
+	 * @access public
34
+	 * @return void
35
+	 */
36
+	public function __construct()
37
+	{
38 38
 
39
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
39
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
40 40
 
41
-        define('TICKETS_PG_SLUG', 'tickets');
42
-        define('TICKETS_LABEL', esc_html__('Default Tickets', 'event_espresso'));
43
-        define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . TICKETS_PG_SLUG . '/');
44
-        define('TICKETS_ADMIN_URL', admin_url('admin.php?page=' . TICKETS_PG_SLUG));
45
-        define('TICKETS_ASSETS_PATH', TICKETS_ADMIN . 'assets/');
46
-        define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/assets/');
47
-        define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN . 'templates/');
48
-        define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/templates/');
41
+		define('TICKETS_PG_SLUG', 'tickets');
42
+		define('TICKETS_LABEL', esc_html__('Default Tickets', 'event_espresso'));
43
+		define('TICKETS_ADMIN', EE_CORE_CAF_ADMIN . 'new/' . TICKETS_PG_SLUG . '/');
44
+		define('TICKETS_ADMIN_URL', admin_url('admin.php?page=' . TICKETS_PG_SLUG));
45
+		define('TICKETS_ASSETS_PATH', TICKETS_ADMIN . 'assets/');
46
+		define('TICKETS_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/assets/');
47
+		define('TICKETS_TEMPLATE_PATH', TICKETS_ADMIN . 'templates/');
48
+		define('TICKETS_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new/' . TICKETS_PG_SLUG . '/templates/');
49 49
 
50
-        parent::__construct();
51
-        $this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . DS;
52
-    }
50
+		parent::__construct();
51
+		$this->_folder_path = EE_CORE_CAF_ADMIN . 'new/' . $this->_folder_name . DS;
52
+	}
53 53
 
54 54
 
55
-    protected function _set_init_properties()
56
-    {
57
-        $this->label = TICKETS_LABEL;
58
-    }
55
+	protected function _set_init_properties()
56
+	{
57
+		$this->label = TICKETS_LABEL;
58
+	}
59 59
 
60 60
 
61
-    protected function _set_menu_map()
62
-    {
63
-        $this->_menu_map = new EE_Admin_Page_Sub_Menu(
64
-            array(
65
-                'menu_group'      => 'management',
66
-                'menu_order'      => 15,
67
-                'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
68
-                'parent_slug'     => 'espresso_events',
69
-                'menu_slug'       => TICKETS_PG_SLUG,
70
-                'menu_label'      => TICKETS_LABEL,
71
-                'capability'      => 'ee_read_default_tickets',
72
-                'admin_init_page' => $this,
73
-            )
74
-        );
75
-    }
61
+	protected function _set_menu_map()
62
+	{
63
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(
64
+			array(
65
+				'menu_group'      => 'management',
66
+				'menu_order'      => 15,
67
+				'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
68
+				'parent_slug'     => 'espresso_events',
69
+				'menu_slug'       => TICKETS_PG_SLUG,
70
+				'menu_label'      => TICKETS_LABEL,
71
+				'capability'      => 'ee_read_default_tickets',
72
+				'admin_init_page' => $this,
73
+			)
74
+		);
75
+	}
76 76
 }
Please login to merge, or discard this patch.
caffeinated/admin/new/tickets/Tickets_List_Table.class.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,30 +100,30 @@
 block discarded – undo
100 100
                     'action' => 'trash_ticket',
101 101
                     'TKT_ID' => $item->ID(),
102 102
                 ), TICKETS_ADMIN_URL);
103
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
104
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
105
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
103
+                $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'
104
+                                    . esc_attr__('Move Ticket to trash', 'event_espresso').'">'
105
+                                    . esc_html__('Trash', 'event_espresso').'</a>';
106 106
             } else {
107 107
                 // restore price link
108 108
                 $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
109 109
                     'action' => 'restore_ticket',
110 110
                     'TKT_ID' => $item->ID(),
111 111
                 ), TICKETS_ADMIN_URL);
112
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
113
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
114
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
112
+                $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'
113
+                                      . esc_attr__('Restore Ticket', 'event_espresso').'">'
114
+                                      . esc_html__('Restore', 'event_espresso').'</a>';
115 115
                 // delete price link
116 116
                 $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
117 117
                     'action' => 'delete_ticket',
118 118
                     'TKT_ID' => $item->ID(),
119 119
                 ), TICKETS_ADMIN_URL);
120
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
121
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
122
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
120
+                $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'
121
+                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'
122
+                                     . esc_html__('Delete Permanently', 'event_espresso').'</a>';
123 123
             }
124 124
         }
125 125
 
126
-        return $item->get('TKT_name') . $this->row_actions($actions);
126
+        return $item->get('TKT_name').$this->row_actions($actions);
127 127
     }
128 128
 
129 129
 
Please login to merge, or discard this patch.
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -16,153 +16,153 @@
 block discarded – undo
16 16
  */
17 17
 class Tickets_List_Table extends EE_Admin_List_Table
18 18
 {
19
-    protected function _setup_data()
20
-    {
21
-        $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
22
-        $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
23
-        $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
24
-        $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
25
-    }
26
-
27
-
28
-    protected function _set_properties()
29
-    {
30
-        $this->_wp_list_args = array(
31
-            'singular' => esc_html__('ticket', 'event_espresso'),
32
-            'plural'   => esc_html__('tickets', 'event_espresso'),
33
-            'ajax'     => true,
34
-            'screen'   => $this->_admin_page->get_current_screen()->id,
35
-        );
36
-
37
-        $this->_columns = array(
38
-            'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
39
-            'TKT_name'        => esc_html__('Name', 'event_espresso'),
40
-            'TKT_description' => esc_html__('Description', 'event_espresso'),
41
-            'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
42
-            'TKT_uses'        => esc_html__('Uses', 'event_espresso'),
43
-            'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
44
-            'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
45
-            'TKT_price'       => esc_html__('Price', 'event_espresso'),
46
-            'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
47
-        );
48
-
49
-        $this->_sortable_columns = array(
50
-            // TRUE means its already sorted
51
-            'TKT_name'        => array('TKT_name', true),
52
-            'TKT_description' => array('TKT_description', false),
53
-            'TKT_qty'         => array('TKT_qty', false),
54
-            'TKT_uses'        => array('TKT_uses', false),
55
-            'TKT_min'         => array('TKT_min', false),
56
-            'TKT_max'         => array('TKT_max', false),
57
-            'TKT_price'       => array('TKT_price', false),
58
-        );
59
-
60
-        $this->_hidden_columns = array();
61
-    }
62
-
63
-
64
-    protected function _get_table_filters()
65
-    {
66
-    }
67
-
68
-
69
-    protected function _add_view_counts()
70
-    {
71
-        $this->_views['all']['count'] = $this->_all_data_count;
72
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) {
73
-            $this->_views['trashed']['count'] = $this->_trashed_count;
74
-        }
75
-    }
76
-
77
-
78
-    public function column_cb($item)
79
-    {
80
-        return $item->ID() === 1
81
-            ? '<span class="ee-lock-icon"></span>'
82
-            : sprintf(
83
-                '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
84
-                $item->ID()
85
-            );
86
-    }
87
-
88
-
89
-    public function column_TKT_name($item)
90
-    {
91
-        // build row actions
92
-        $actions = array();
93
-
94
-        // trash links
95
-        if ($item->ID() !== 1) {
96
-            if ($this->_view == 'all') {
97
-                $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
98
-                    'action' => 'trash_ticket',
99
-                    'TKT_ID' => $item->ID(),
100
-                ), TICKETS_ADMIN_URL);
101
-                $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
102
-                                    . esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
103
-                                    . esc_html__('Trash', 'event_espresso') . '</a>';
104
-            } else {
105
-                // restore price link
106
-                $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
107
-                    'action' => 'restore_ticket',
108
-                    'TKT_ID' => $item->ID(),
109
-                ), TICKETS_ADMIN_URL);
110
-                $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
111
-                                      . esc_attr__('Restore Ticket', 'event_espresso') . '">'
112
-                                      . esc_html__('Restore', 'event_espresso') . '</a>';
113
-                // delete price link
114
-                $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
115
-                    'action' => 'delete_ticket',
116
-                    'TKT_ID' => $item->ID(),
117
-                ), TICKETS_ADMIN_URL);
118
-                $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
119
-                                     . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
120
-                                     . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
121
-            }
122
-        }
123
-
124
-        return $item->get('TKT_name') . $this->row_actions($actions);
125
-    }
126
-
127
-
128
-    public function column_TKT_description($item)
129
-    {
130
-        return $item->get('TKT_description');
131
-    }
132
-
133
-
134
-    public function column_TKT_qty($item)
135
-    {
136
-        return $item->get_pretty('TKT_qty', 'text');
137
-    }
138
-
139
-
140
-    public function column_TKT_uses($item)
141
-    {
142
-        return $item->get_pretty('TKT_uses', 'text');
143
-    }
144
-
145
-
146
-    public function column_TKT_min($item)
147
-    {
148
-        return $item->get('TKT_min');
149
-    }
150
-
151
-
152
-    public function column_TKT_max($item)
153
-    {
154
-        return $item->get_pretty('TKT_max', 'text');
155
-    }
156
-
157
-
158
-    public function column_TKT_price($item)
159
-    {
160
-        return EEH_Template::format_currency($item->get('TKT_price'));
161
-    }
162
-
163
-
164
-    public function column_TKT_taxable($item)
165
-    {
166
-        return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
167
-    }
19
+	protected function _setup_data()
20
+	{
21
+		$trashed = $this->_admin_page->get_view() == 'trashed' ? true : false;
22
+		$this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed);
23
+		$this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false);
24
+		$this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true);
25
+	}
26
+
27
+
28
+	protected function _set_properties()
29
+	{
30
+		$this->_wp_list_args = array(
31
+			'singular' => esc_html__('ticket', 'event_espresso'),
32
+			'plural'   => esc_html__('tickets', 'event_espresso'),
33
+			'ajax'     => true,
34
+			'screen'   => $this->_admin_page->get_current_screen()->id,
35
+		);
36
+
37
+		$this->_columns = array(
38
+			'cb'              => '<input type="checkbox" />', // Render a checkbox instead of text
39
+			'TKT_name'        => esc_html__('Name', 'event_espresso'),
40
+			'TKT_description' => esc_html__('Description', 'event_espresso'),
41
+			'TKT_qty'         => esc_html__('Quantity', 'event_espresso'),
42
+			'TKT_uses'        => esc_html__('Uses', 'event_espresso'),
43
+			'TKT_min'         => esc_html__('Minimum', 'event_espresso'),
44
+			'TKT_max'         => esc_html__('Maximum', 'event_espresso'),
45
+			'TKT_price'       => esc_html__('Price', 'event_espresso'),
46
+			'TKT_taxable'     => esc_html__('Taxable', 'event_espresso'),
47
+		);
48
+
49
+		$this->_sortable_columns = array(
50
+			// TRUE means its already sorted
51
+			'TKT_name'        => array('TKT_name', true),
52
+			'TKT_description' => array('TKT_description', false),
53
+			'TKT_qty'         => array('TKT_qty', false),
54
+			'TKT_uses'        => array('TKT_uses', false),
55
+			'TKT_min'         => array('TKT_min', false),
56
+			'TKT_max'         => array('TKT_max', false),
57
+			'TKT_price'       => array('TKT_price', false),
58
+		);
59
+
60
+		$this->_hidden_columns = array();
61
+	}
62
+
63
+
64
+	protected function _get_table_filters()
65
+	{
66
+	}
67
+
68
+
69
+	protected function _add_view_counts()
70
+	{
71
+		$this->_views['all']['count'] = $this->_all_data_count;
72
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) {
73
+			$this->_views['trashed']['count'] = $this->_trashed_count;
74
+		}
75
+	}
76
+
77
+
78
+	public function column_cb($item)
79
+	{
80
+		return $item->ID() === 1
81
+			? '<span class="ee-lock-icon"></span>'
82
+			: sprintf(
83
+				'<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />',
84
+				$item->ID()
85
+			);
86
+	}
87
+
88
+
89
+	public function column_TKT_name($item)
90
+	{
91
+		// build row actions
92
+		$actions = array();
93
+
94
+		// trash links
95
+		if ($item->ID() !== 1) {
96
+			if ($this->_view == 'all') {
97
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
98
+					'action' => 'trash_ticket',
99
+					'TKT_ID' => $item->ID(),
100
+				), TICKETS_ADMIN_URL);
101
+				$actions['trash'] = '<a href="' . $trash_lnk_url . '" title="'
102
+									. esc_attr__('Move Ticket to trash', 'event_espresso') . '">'
103
+									. esc_html__('Trash', 'event_espresso') . '</a>';
104
+			} else {
105
+				// restore price link
106
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
107
+					'action' => 'restore_ticket',
108
+					'TKT_ID' => $item->ID(),
109
+				), TICKETS_ADMIN_URL);
110
+				$actions['restore'] = '<a href="' . $restore_lnk_url . '" title="'
111
+									  . esc_attr__('Restore Ticket', 'event_espresso') . '">'
112
+									  . esc_html__('Restore', 'event_espresso') . '</a>';
113
+				// delete price link
114
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array(
115
+					'action' => 'delete_ticket',
116
+					'TKT_ID' => $item->ID(),
117
+				), TICKETS_ADMIN_URL);
118
+				$actions['delete'] = '<a href="' . $delete_lnk_url . '" title="'
119
+									 . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">'
120
+									 . esc_html__('Delete Permanently', 'event_espresso') . '</a>';
121
+			}
122
+		}
123
+
124
+		return $item->get('TKT_name') . $this->row_actions($actions);
125
+	}
126
+
127
+
128
+	public function column_TKT_description($item)
129
+	{
130
+		return $item->get('TKT_description');
131
+	}
132
+
133
+
134
+	public function column_TKT_qty($item)
135
+	{
136
+		return $item->get_pretty('TKT_qty', 'text');
137
+	}
138
+
139
+
140
+	public function column_TKT_uses($item)
141
+	{
142
+		return $item->get_pretty('TKT_uses', 'text');
143
+	}
144
+
145
+
146
+	public function column_TKT_min($item)
147
+	{
148
+		return $item->get('TKT_min');
149
+	}
150
+
151
+
152
+	public function column_TKT_max($item)
153
+	{
154
+		return $item->get_pretty('TKT_max', 'text');
155
+	}
156
+
157
+
158
+	public function column_TKT_price($item)
159
+	{
160
+		return EEH_Template::format_currency($item->get('TKT_price'));
161
+	}
162
+
163
+
164
+	public function column_TKT_taxable($item)
165
+	{
166
+		return $item->get('TKT_taxable') ? esc_html__('Yes', 'event_espresso') : esc_html__('No', 'event_espresso');
167
+	}
168 168
 }
Please login to merge, or discard this patch.