| 1 |
<?php |
| 2 |
|
| 3 |
namespace IvyForms\Services\Menu; |
| 4 |
|
| 5 |
// phpcs:disable PSR1.Files.SideEffects |
| 6 |
if (!defined('ABSPATH')) { |
| 7 |
exit; // Exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
use IvyForms\Services\Translations\BackendStrings; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class Menu |
| 14 |
*/ |
| 15 |
class MenuMapper |
| 16 |
{ |
| 17 |
/** |
| 18 |
* @return mixed[] |
| 19 |
*/ |
| 20 |
public function __invoke(): array |
| 21 |
{ |
| 22 |
return |
| 23 |
[ |
| 24 |
// [ |
| 25 |
// 'parentSlug' => 'ivyforms', |
| 26 |
// 'pageTitle' => 'Dashboard', |
| 27 |
// 'menuTitle' => BackendStrings::getDashboardStrings()['dashboard'], |
| 28 |
// // TODO - Add IvyForms capability |
| 29 |
// 'capability' => 'read', |
| 30 |
// 'menuSlug' => 'ivyforms-dashboard', |
| 31 |
// ], |
| 32 |
[ |
| 33 |
'parentSlug' => 'ivyforms', |
| 34 |
'pageTitle' => 'All Forms', |
| 35 |
'menuTitle' => BackendStrings::getCommonStrings()['all_forms'], |
| 36 |
// TODO - Add IvyForms capability |
| 37 |
'capability' => 'read', |
| 38 |
'menuSlug' => 'ivyforms-forms', |
| 39 |
], |
| 40 |
[ |
| 41 |
'parentSlug' => 'ivyforms', |
| 42 |
'pageTitle' => 'New form', |
| 43 |
'menuTitle' => BackendStrings::getCommonStrings()['new_form'], |
| 44 |
// TODO - Add IvyForms capability |
| 45 |
'capability' => 'read', |
| 46 |
'menuSlug' => 'ivyforms-builder', |
| 47 |
], |
| 48 |
[ |
| 49 |
'parentSlug' => 'ivyforms', |
| 50 |
'pageTitle' => 'Entries', |
| 51 |
'menuTitle' => BackendStrings::getEntriesStrings()['entries'], |
| 52 |
// TODO - Add IvyForms capability |
| 53 |
'capability' => 'read', |
| 54 |
'menuSlug' => 'ivyforms-entries', |
| 55 |
], |
| 56 |
// // TODO Add Settings page |
| 57 |
[ |
| 58 |
'parentSlug' => 'ivyforms', |
| 59 |
'pageTitle' => 'Settings', |
| 60 |
'menuTitle' => BackendStrings::getCommonStrings()['settings'], |
| 61 |
// TODO - Add IvyForms capability |
| 62 |
'capability' => 'read', |
| 63 |
'menuSlug' => 'ivyforms-settings', |
| 64 |
], |
| 65 |
// [ |
| 66 |
// 'parentSlug' => 'ivyforms', |
| 67 |
// 'pageTitle' => 'Integrations', |
| 68 |
// 'menuTitle' => BackendStrings::getIntegrationsStrings()['integrations'], |
| 69 |
// // TODO - Add IvyForms capability |
| 70 |
// 'capability' => 'read', |
| 71 |
// 'menuSlug' => 'ivyforms-integrations', |
| 72 |
// ], |
| 73 |
|
| 74 |
// [ |
| 75 |
// 'parentSlug' => 'ivyforms', |
| 76 |
// 'pageTitle' => 'Testing', |
| 77 |
// 'menuTitle' => 'Testing', |
| 78 |
// 'capability' => 'read', |
| 79 |
// 'menuSlug' => 'ivyforms-testing', |
| 80 |
// ], |
| 81 |
]; |
| 82 |
} |
| 83 |
} |
| 84 |
|