1: <?php
2:
3: 4: 5:
6: class Quform_Admin_Page_Tools_Home extends Quform_Admin_Page_Tools
7: {
8: public function init()
9: {
10: $this->template = QUFORM_TEMPLATE_PATH . '/admin/tools/home.php';
11: }
12:
13: 14: 15: 16: 17: 18: 19:
20: public function getNavHtml(array $currentForm = null, array $extra = array())
21: {
22: $extra[40] = sprintf(
23: '<div class="qfb-nav-item qfb-nav-page-info"><i class="qfb-nav-page-icon qfb-mdi qfb-mdi-build"></i><span class="qfb-nav-page-title">%s</span></div>',
24: esc_html__('Tools', 'quform')
25: );
26:
27: return parent::getNavHtml($currentForm, $extra);
28: }
29:
30: 31: 32:
33: public function process()
34: {
35: $tools = array(
36: 'export.entries' => array(
37: 'title' => __('Export Entries', 'quform'),
38: 'cap' => 'quform_export_entries',
39: 'url' => admin_url('admin.php?page=quform.tools&sp=export.entries'),
40: 'icon' => '<i class="qfb-icon qfb-icon-file-excel-o"></i>'
41: ),
42: 'export.form' => array(
43: 'title' => __('Export Form', 'quform'),
44: 'cap' => 'quform_export_forms',
45: 'url' => admin_url('admin.php?page=quform.tools&sp=export.form'),
46: 'icon' => '<i class="qfb-icon qfb-icon-file-code-o"></i>'
47: ),
48: 'import.form' => array(
49: 'title' => __('Import Form', 'quform'),
50: 'cap' => 'quform_import_forms',
51: 'url' => admin_url('admin.php?page=quform.tools&sp=import.form'),
52: 'icon' => '<i class="qfb-mdi qfb-mdi-playlist_add"></i>'
53: ),
54: 'migrate' => array(
55: 'title' => __('Migrate', 'quform'),
56: 'cap' => 'quform_full_access',
57: 'url' => admin_url('admin.php?page=quform.tools&sp=migrate'),
58: 'icon' => '<i class="qfb-icon qfb-icon-suitcase"></i>'
59: ),
60: 'uninstall' => array(
61: 'title' => __('Uninstall', 'quform'),
62: 'cap' => 'activate_plugins',
63: 'url' => admin_url('admin.php?page=quform.tools&sp=uninstall'),
64: 'icon' => '<i class="qfb-icon qfb-icon-trash-o"></i>'
65: )
66: );
67:
68: foreach ($tools as $key => $tool) {
69: if ( ! current_user_can($tool['cap'])) {
70: unset($tools[$key]);
71: }
72: }
73:
74: $this->view->with(compact('tools'));
75: }
76: }
77: