1: <?php
2:
3: 4: 5:
6: class Quform_Admin_Page_Tools_ImportForm extends Quform_Admin_Page_Tools
7: {
8: 9: 10:
11: protected function enqueueScripts()
12: {
13: parent::enqueueScripts();
14:
15: wp_enqueue_script('quform-tools-import-form', Quform::adminUrl('js/tools.import-form.min.js'), array('jquery'), QUFORM_VERSION, true);
16: wp_localize_script('quform-tools-import-form', 'quformToolsImportFormL10n', $this->getScriptL10n());
17: }
18:
19: 20: 21: 22: 23:
24: protected function getScriptL10n()
25: {
26: return array(
27: 'importFormNonce' => wp_create_nonce('quform_import_form'),
28: 'errorImportingForm' => __('An error occurred importing the form', 'quform')
29: );
30: }
31:
32: public function init()
33: {
34: $this->template = QUFORM_TEMPLATE_PATH . '/admin/tools/import-form.php';
35: }
36:
37: 38: 39: 40: 41:
42: protected function getAdminTitle()
43: {
44: return __('Import Form', 'quform');
45: }
46:
47: 48: 49: 50: 51: 52: 53:
54: public function getNavHtml(array $currentForm = null, array $extra = array())
55: {
56: $extra[40] = sprintf(
57: '<div class="qfb-nav-item qfb-nav-page-info"><i class="qfb-nav-page-icon qfb-mdi qfb-mdi-playlist_add"></i><span class="qfb-nav-page-title">%s</span></div>',
58: esc_html__('Import form', 'quform')
59: );
60:
61: return parent::getNavHtml($currentForm, $extra);
62: }
63:
64: 65: 66:
67: public function process()
68: {
69: if ( ! current_user_can('quform_import_forms')) {
70: wp_die(__( 'You do not have sufficient permissions to access this page.', 'quform'), 403);
71: }
72: }
73: }
74: