PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 2.2.4
Tutor LMS – eLearning and online course solution v2.2.4
3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.11 1.2.12 1.2.13 1.2.20 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / classes / Tools_V2.php
tutor / classes Last commit date
Addons.php 2 years ago Admin.php 2 years ago Ajax.php 3 years ago Announcements.php 3 years ago Assets.php 3 years ago Backend_Page_Trait.php 3 years ago Course.php 3 years ago Course_Embed.php 3 years ago Course_Filter.php 3 years ago Course_List.php 2 years ago Course_Settings_Tabs.php 3 years ago Course_Widget.php 3 years ago Custom_Validation.php 3 years ago Dashboard.php 3 years ago FormHandler.php 2 years ago Frontend.php 3 years ago Gutenberg.php 3 years ago Input.php 3 years ago Instructor.php 2 years ago Instructors_List.php 3 years ago Lesson.php 2 years ago Options_V2.php 2 years ago Post_types.php 3 years ago Private_Course_Access.php 3 years ago Q_and_A.php 3 years ago Question_Answers_List.php 3 years ago Quiz.php 2 years ago Quiz_Attempts_List.php 2 years ago RestAPI.php 3 years ago Reviews.php 3 years ago Rewrite_Rules.php 3 years ago Shortcode.php 2 years ago Student.php 2 years ago Students_List.php 3 years ago Taxonomies.php 3 years ago Template.php 2 years ago Theme_Compatibility.php 3 years ago Tools.php 3 years ago Tools_V2.php 3 years ago Tutor.php 3 years ago TutorEDD.php 2 years ago Tutor_Base.php 3 years ago Tutor_Setup.php 3 years ago Upgrader.php 3 years ago User.php 3 years ago Utils.php 2 years ago Video_Stream.php 3 years ago Withdraw.php 2 years ago Withdraw_Requests_List.php 3 years ago WooCommerce.php 2 years ago
Tools_V2.php
594 lines
1 <?php
2
3 /**
4 * Options for TutorLMS
5 *
6 * @package Tutor\Tools
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 2.0.0
10 */
11
12 namespace Tutor;
13
14 use TUTOR\Admin;
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 /**
21 * Tools class
22 *
23 * @since 2.0.0
24 */
25 class Tools_V2 {
26
27 /**
28 * Environment status
29 *
30 * @since 2.0.0
31 *
32 * @var string
33 */
34 private $environment_status;
35
36 /**
37 * Tools filed
38 *
39 * @since 2.0.0
40 *
41 * @var mixed
42 */
43 private $tools_fields;
44
45 /**
46 * Apply settings
47 *
48 * @since 2.0.0
49 *
50 * @return void send wp_json response
51 */
52 public function tutor_apply_settings() {
53 $tutor_settings_log = get_option( 'tutor_settings_log' );
54 $apply_id = $this->get_request_data( 'apply_id' );
55
56 update_option( 'tutor_option', $tutor_settings_log[ $apply_id ]['dataset'] );
57
58 wp_send_json_success( $tutor_settings_log[ $apply_id ] );
59 }
60
61 /**
62 * Get request data
63 *
64 * @since 2.0.0
65 *
66 * @param mixed $var var.
67 *
68 * @return mixed
69 */
70 public function get_request_data( $var ) {
71 return Input::sanitize_request_data( $var, null );
72 }
73
74 /**
75 * Tools page
76 *
77 * @since 2.0.0
78 *
79 * @return void including template
80 */
81 public function load_tools_page() {
82 $tools_fields = $this->get_tools_fields();
83 $tutor_setup = array( 'tutor-setup' => $tools_fields['tutor-setup'] );
84 unset( $tools_fields['tutor-setup'] );
85 $tools_fields = array_merge( $tools_fields, $tutor_setup );
86
87 $active_tab = Input::get( 'sub_page', 'status' );
88 include tutor()->path . '/views/options/tools.php';
89 }
90
91 /**
92 * Function options_tools
93 *
94 * @since 2.0.0
95 *
96 * @return array
97 */
98 private function get_tools_fields() {
99 global $wpdb;
100
101 if ( $this->tools_fields ) {
102 // Return fields if already prepared.
103 return $this->tools_fields;
104 }
105
106 $attr_tools = array(
107 'status' => array(
108 'label' => __( 'Status', 'tutor' ),
109 'slug' => 'status',
110 'desc' => __( 'Status Settings', 'tutor' ),
111 'template' => 'status',
112 'view_path' => tutor()->path . 'views/options/template/',
113 'icon' => 'tutor-icon-chart-pie',
114 'blocks' => array(
115 'wordpress_environment' => array(
116 'label' => __( 'WordPress environment', 'tutor' ),
117 'slug' => 'wordpress_environment',
118 'classes' => 'wordpress_environment',
119 'block_type' => 'column',
120 'fieldset' => array(
121 array(
122 array(
123 'key' => 'home_url',
124 'type' => 'info_row',
125 'label' => __( 'Home URL', 'tutor' ),
126 'status' => 'default',
127 'default' => $this->status( 'home_url' ),
128 ),
129 ),
130 array(
131 array(
132 'key' => 'wordpress_version',
133 'type' => 'info_col',
134 'label' => __( 'WordPress version', 'tutor' ),
135 'status' => 'default',
136 'default' => $this->status( 'wordpress_version' ),
137
138 ),
139 array(
140 'key' => 'wordpress_multisite',
141 'type' => 'info_col',
142 'label' => __( 'WordPress multisite', 'tutor' ),
143 'status' => 'default',
144 'default' => $this->status( 'wordpress_multisite' ),
145
146 ),
147 array(
148 'key' => 'wordpress_debug_mode',
149 'type' => 'info_col',
150 'label' => __( 'WordPress debug mode', 'tutor' ),
151 'status' => ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) ? 'success' : 'default',
152 'default' => $this->status( 'wordpress_debug_mode' ),
153
154 ),
155 array(
156 'key' => 'language',
157 'type' => 'info_col',
158 'label' => __( 'Language', 'tutor' ),
159 'status' => 'default',
160 'default' => $this->status( 'language' ),
161
162 ),
163 ),
164 array(
165 array(
166 'key' => 'site_url',
167 'type' => 'info_row',
168 'label' => __( 'Site URL', 'tutor' ),
169 'status' => 'default',
170 'default' => $this->status( 'site_url' ),
171
172 ),
173 ),
174 array(
175 array(
176 'key' => 'tutor_version',
177 'type' => 'info_col',
178 'label' => __( 'Tutor version', 'tutor' ),
179 'status' => 'success',
180 'default' => $this->status( 'tutor_version' ),
181
182 ),
183 array(
184 'key' => 'wordpress_memory_limit',
185 'type' => 'info_col',
186 'label' => __( 'WordPress memory limit', 'tutor' ),
187 'status' => 'success',
188 'default' => $this->status( 'wordpress_memory_limit' ),
189
190 ),
191 array(
192 'key' => 'wordpress_cron',
193 'type' => 'info_col',
194 'label' => __( 'WordPress Cron', 'tutor' ),
195 'status' => ! empty( _get_cron_array() ) ? 'success' : 'default',
196 'default' => $this->status( 'wordpress_cron' ),
197
198 ),
199 array(
200 'key' => 'external_object_cache',
201 'type' => 'info_col',
202 'label' => __( 'External object cache', 'tutor' ),
203 'status' => 'default',
204 'default' => $this->status( 'external_object_cache' ),
205
206 ),
207 ),
208 ),
209 ),
210 'server_environment' => array(
211 'label' => __( 'Server environment', 'tutor' ),
212 'slug' => 'server_environment',
213 'block_type' => 'column',
214 'fieldset' => array(
215 array(
216 array(
217 'key' => 'server_info',
218 'type' => 'info_col',
219 'label' => __( 'Server info', 'tutor' ),
220 'status' => 'default',
221 'default' => $this->status( 'server_info' ),
222
223 ),
224 array(
225 'key' => 'php_version',
226 'type' => 'info_col',
227 'label' => __( 'PHP version', 'tutor' ),
228 'status' => 'default',
229 'default' => $this->status( 'php_version' ),
230
231 ),
232 array(
233 'key' => 'php_post_max_size',
234 'type' => 'info_col',
235 'label' => __( 'PHP post max size', 'tutor' ),
236 'status' => 'default',
237 'default' => $this->status( 'php_post_max_size' ),
238
239 ),
240 array(
241 'key' => 'php_time_limit',
242 'type' => 'info_col',
243 'label' => __( 'PHP time limit', 'tutor' ),
244 'status' => 'default',
245 'default' => $this->status( 'php_time_limit' ),
246
247 ),
248 array(
249 'key' => 'curl_version',
250 'type' => 'info_col',
251 'label' => __( 'cURL version', 'tutor' ),
252 'status' => 'default',
253 'default' => $this->status( 'curl_version' ),
254
255 ),
256 array(
257 'key' => 'language',
258 'type' => 'info_col',
259 'label' => __( 'Language', 'tutor' ),
260 'status' => 'default',
261 'default' => $this->status( 'language' ),
262
263 ),
264 ),
265 array(
266 array(
267 'key' => 'tutor_version',
268 'type' => 'info_col',
269 'label' => __( 'MySQL version', 'tutor' ),
270 'status' => 'default',
271 'default' => sprintf( 'Server: %s, Client: %s', $wpdb->dbh->server_info, $wpdb->dbh->client_info ),
272 ),
273 array(
274 'key' => 'wordpress_memory_limit',
275 'type' => 'info_col',
276 'label' => __( 'Default timezone is UTC', 'tutor' ),
277 'status' => 'default',
278 'default' => $this->status( 'default_timezone_is_utc' ),
279 ),
280 array(
281 'key' => 'wordpress_cron',
282 'type' => 'info_col',
283 'label' => __( 'fsockopen/cURL', 'tutor' ),
284 'status' => 'default',
285 'default' => $this->status( 'fsockopen_curl' ),
286 ),
287 array(
288 'key' => 'external_object_cache',
289 'type' => 'info_col',
290 'label' => __( 'DOMDocument', 'tutor' ),
291 'status' => 'default',
292 'default' => $this->status( 'dom_document' ),
293 ),
294 array(
295 'key' => 'external_object_cache',
296 'type' => 'info_col',
297 'label' => __( 'GZip', 'tutor' ),
298 'status' => 'default',
299 'default' => $this->status( 'gzip' ),
300 ),
301 array(
302 'key' => 'external_object_cache',
303 'type' => 'info_col',
304 'label' => __( 'Multibyte string', 'tutor' ),
305 'status' => 'default',
306 'default' => $this->status( 'multibyte_string' ),
307 ),
308 ),
309 ),
310 ),
311 ),
312 ),
313 'import_export' => array(
314 'label' => __( 'Import/Export', 'tutor' ),
315 'slug' => 'import_export',
316 'desc' => __( 'Import/Export Settings', 'tutor' ),
317 'template' => 'import_export',
318 'view_path' => tutor()->path . 'views/options/template/',
319 'icon' => 'tutor-icon-import-export',
320 'blocks' => array(),
321 ),
322 'tutor_pages' => array(
323 'label' => __( 'Tutor Pages', 'tutor' ),
324 'slug' => 'tutor_pages',
325
326 'desc' => __( 'Tutor Pages Settings', 'tutor' ),
327 'template' => 'tutor_pages',
328 'view_path' => tutor()->path . 'views/options/template/',
329 'icon' => 'tutor-icon-page-review',
330 'blocks' => array(
331 'block' => array(),
332 ),
333 ),
334 'tutor_rest_api' => array(
335 'label' => __( 'Rest API', 'tutor' ),
336 'slug' => 'tutor_rest_api',
337 'desc' => __( 'Token List', 'tutor' ),
338 'template' => 'manage-tokens',
339 'view_path' => tutor()->path . 'views/pages/tools/',
340 'icon' => 'tutor-icon-api',
341 'blocks' => array(
342 'block' => array(),
343 ),
344 ),
345 'tutor-setup' => array(
346 'label' => __( 'Setup Wizard', 'tutor' ),
347 'slug' => 'tutor-setup',
348 'desc' => __( 'Setup Wizard Settings', 'tutor' ),
349 'icon' => 'tutor-icon-earth',
350 'blocks' => array(
351 'block' => array(),
352 ),
353 ),
354 );
355
356 $attr_tools = apply_filters( 'tutor/tools/extend/attr', apply_filters( 'tutor/tools/attr', apply_filters( 'tutor_tool_pages', $attr_tools ) ) );
357
358 $this->tools_fields = $attr_tools;
359
360 return $this->tools_fields;
361 }
362
363 /**
364 * Get environment info
365 *
366 * @since 2.0.0
367 *
368 * @return array
369 */
370 private function get_environment_info() {
371
372 if ( $this->environment_status ) {
373 // Use runtime cache for repetitive call.
374 return $this->environment_status;
375 }
376
377 // Figure out cURL version, if installed.
378 $curl_version = '';
379 if ( function_exists( 'curl_version' ) ) {
380 $curl_version = curl_version();
381 $curl_version = $curl_version['version'] . ', ' . $curl_version['ssl_version'];
382 }
383
384 // WP memory limit.
385 $wp_memory_limit = tutor_utils()->let_to_num( WP_MEMORY_LIMIT );
386 if ( function_exists( 'memory_get_usage' ) ) {
387 $wp_memory_limit = max( $wp_memory_limit, tutor_utils()->let_to_num( @ini_get( 'memory_limit' ) ) );
388 }
389
390 $database_version = tutor_utils()->get_db_version();
391
392 $this->environment_status = array(
393 'home_url' => get_option( 'home' ),
394 'site_url' => get_option( 'siteurl' ),
395 'version' => TUTOR_VERSION,
396 'wp_version' => get_bloginfo( 'version' ),
397 'wp_multisite' => is_multisite(),
398 'wp_memory_limit' => $wp_memory_limit,
399 'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
400 'wp_cron' => ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
401 'language' => get_locale(),
402 'external_object_cache' => wp_using_ext_object_cache(),
403 'server_info' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
404 'php_version' => phpversion(),
405 'php_post_max_size' => tutor_utils()->let_to_num( ini_get( 'post_max_size' ) ),
406 'php_max_execution_time' => ini_get( 'max_execution_time' ),
407 'php_max_input_vars' => ini_get( 'max_input_vars' ),
408 'curl_version' => $curl_version,
409 'suhosin_installed' => extension_loaded( 'suhosin' ),
410 'max_upload_size' => wp_max_upload_size(),
411 'mysql_version' => $database_version['number'],
412 'mysql_version_string' => $database_version['string'],
413 'default_timezone' => date_default_timezone_get(),
414 'fsockopen_or_curl_enabled' => ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ),
415 'soapclient_enabled' => class_exists( 'SoapClient' ),
416 'domdocument_enabled' => class_exists( 'DOMDocument' ),
417 'gzip_enabled' => is_callable( 'gzopen' ),
418 'mbstring_enabled' => extension_loaded( 'mbstring' ),
419 );
420
421 return $this->environment_status;
422 }
423
424 /**
425 * Status
426 *
427 * @since 2.0.0
428 *
429 * @param string $type type.
430 *
431 * @return mixed
432 */
433 public function status( $type = '' ) {
434
435 $data = array();
436 $data[ null ] = 'null';
437
438 $environment = $this->get_environment_info();
439
440 $data['home_url'] = $environment['home_url'] ?? null;
441 $data['site_url'] = $environment['site_url'] ?? null;
442
443 $latest_version = get_transient( 'tutor_system_status_wp_version_check' );
444
445 // WordPress already has efficient update notification mechanism.
446 // We don't need to slow down the page for no reason.
447 // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
448 $data['wordpress_version'] = esc_html( $environment['wp_version'] );
449
450 $data['tutor_version'] = esc_html( $environment['version'] );
451
452 $data['wordpress_multisite'] = $environment['wp_multisite'] ? '' : '-';
453
454 $data['wordpress_debug_mode'] = $environment['wp_debug_mode'] ? '' : '-';
455
456 $data['language'] = esc_html( $environment['language'] );
457
458 $data['wordpress_memory_limit'] = ( $environment['wp_memory_limit'] < 67108864 )
459 ? sprintf( esc_html__( '%1$s - We recommend setting memory to at least 64MB. See: %2$s', 'tutor' ), esc_html( size_format( $environment['wp_memory_limit'] ) ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . esc_html__( 'Increasing memory allocated to PHP', 'tutor' ) . '</a>' )
460 : esc_html( size_format( $environment['wp_memory_limit'] ) );
461
462 $data['wordpress_cron'] = $environment['wp_cron'] ? '' : '-';
463
464 $data['external_object_cache'] = $environment['external_object_cache'] ? '' : '-';
465
466 $data['server_info'] = $environment['server_info'] ?? null;
467
468 $data['php_version'] = ( version_compare( $environment['php_version'], '7.2', '>=' ) )
469 ? esc_html( $environment['php_version'] )
470 : ( ( version_compare( $environment['php_version'], '5.6', '<' ) )
471 ? __( 'Tutor will run under this version of PHP, however, it has reached end of life. We recommend using PHP version 7.2 or above for greater performance and security.', 'tutor' )
472 : __( 'We recommend using PHP version 7.2 or above for greater performance and security.', 'tutor' ) );
473
474 $data['php_post_max_size'] = esc_html( size_format( $environment['php_post_max_size'] ) ) ?? null;
475
476 $data['php_time_limit'] = esc_html( $environment['php_max_execution_time'] ) ?? null;
477
478 $data['php_max_input_vars'] = esc_html( $environment['php_max_input_vars'] ) ?? null;
479
480 $data['curl_version'] = esc_html( $environment['curl_version'] ) ?? null;
481
482 $data['suhosin_installed'] = $environment['suhosin_installed'] ? '' : '-';
483
484 $data['max_upload_size'] = esc_html( size_format( $environment['max_upload_size'] ) ) ?? null;
485
486 $data['mysql_version'] = ( version_compare( $environment['mysql_version'], '5.6', '<' ) && ! strstr( $environment['mysql_version_string'], 'MariaDB' ) )
487 ? sprintf( esc_html__( '%1$s - We recommend a minimum MySQL version of 5.6. See: %2$s', 'tutor' ), esc_html( $environment['mysql_version_string'] ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . esc_html__( 'WordPress requirements', 'tutor' ) . '</a>' )
488 : esc_html( $environment['mysql_version_string'] );
489
490 $data['default_timezone_is_utc'] = ( 'UTC' !== $environment['default_timezone'] )
491 ? sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'tutor' ), esc_html( $environment['default_timezone'] ) )
492 : '';
493
494 $data['fsockopen_curl'] = $environment['fsockopen_or_curl_enabled']
495 ? ''
496 : esc_html__( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'tutor' );
497
498 $data['dom_document'] = $environment['domdocument_enabled']
499 ? ''
500 : sprintf( esc_html__( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'tutor' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' );
501
502 $data['gzip'] = ( $environment['gzip_enabled'] )
503 ? ''
504 : sprintf( esc_html__( 'Your server does not support the %s function - this is required to use the GeoIP database from MaxMind.', 'tutor' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' );
505
506 $data['multibyte_string'] = ( $environment['mbstring_enabled'] )
507 ? ''
508 : sprintf( esc_html__( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'tutor' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' );
509
510 if ( ! null == $type ) {
511 return $data[ $type ];
512 }
513
514 return $data[ null ];
515 }
516
517 /**
518 * Generate Option Field
519 *
520 * @since 2.0.0
521 *
522 * @param array $field fields.
523 *
524 * @return string
525 */
526 public function generate_field( $field = array() ) {
527 ob_start();
528 include tutor()->path . "views/options/field-types/{$field['type']}.php";
529
530 return ob_get_clean();
531 }
532
533 /**
534 * Get field type template
535 *
536 * @since 2.0.0
537 *
538 * @param array $field field.
539 *
540 * @return string
541 */
542 public function field_type( $field = array() ) {
543 ob_start();
544 include tutor()->path . "views/options/field-types/{$field['type']}.php";
545 return ob_get_clean();
546 }
547
548 /**
549 * Blocks template content
550 *
551 * @since 2.0.0
552 *
553 * @param array $blocks field.
554 *
555 * @return string
556 */
557 public function blocks( $blocks = array() ) {
558 ob_start();
559 include tutor()->path . 'views/options/option_blocks.php';
560 return ob_get_clean();
561 }
562
563 /**
564 * Template content
565 *
566 * @since 2.0.0
567 *
568 * @param array $section field.
569 *
570 * @return string
571 */
572 public function template( $section = array() ) {
573 ob_start();
574 include $section['view_path'] . $section['template'] . '.php';
575 return ob_get_clean();
576 }
577
578 /**
579 * Load template inside template directory
580 *
581 * @since 2.0.0
582 *
583 * @param string $template_slug template slug.
584 * @param array $section sections array.
585 *
586 * @return string
587 */
588 public function view_template( $template_slug, $section = array() ) {
589 ob_start();
590 require tutor()->path . "views/options/template/{$template_slug}";
591 return ob_get_clean();
592 }
593 }
594