Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
6a488035 TO |
2 | /* |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * This file hard-codes the path entries for the queueing UI, which | |
14 | * allows us to use these paths during upgrades. | |
15 | * | |
16 | * @package CRM | |
ca5cec67 | 17 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
18 | */ |
19 | ||
20 | require_once 'CRM/Core/I18n.php'; | |
28518c90 EM |
21 | |
22 | /** | |
23 | * Class CRM_Queue_Menu | |
24 | */ | |
6a488035 TO |
25 | class CRM_Queue_Menu { |
26 | ||
e0ef6999 | 27 | /** |
4523a2f5 TO |
28 | * @param string $path |
29 | * The path for which we are trying to locate the route. | |
30 | * @param array $menuPath | |
31 | * The route. | |
e0ef6999 | 32 | */ |
4523a2f5 | 33 | public static function alter($path, &$menuPath) { |
6a488035 TO |
34 | switch ($path) { |
35 | case 'civicrm/queue/runner': | |
36 | case 'civicrm/upgrade/queue/runner': | |
37 | $menuPath['path'] = $path; | |
38 | $menuPath['title'] = 'Queue Runner'; | |
39 | $menuPath['page_callback'] = 'CRM_Queue_Page_Runner'; | |
40 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
be2fb01f | 41 | $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu']; |
6a488035 TO |
42 | break; |
43 | ||
44 | case 'civicrm/queue/ajax/runNext': | |
45 | case 'civicrm/upgrade/queue/ajax/runNext': | |
46 | $menuPath['path'] = $path; | |
be2fb01f | 47 | $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'runNext']; |
6a488035 | 48 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; |
be2fb01f | 49 | $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu']; |
6a488035 TO |
50 | break; |
51 | ||
52 | case 'civicrm/queue/ajax/skipNext': | |
53 | case 'civicrm/upgrade/queue/ajax/skipNext': | |
54 | $menuPath['path'] = $path; | |
be2fb01f | 55 | $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'skipNext']; |
6a488035 | 56 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; |
be2fb01f | 57 | $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu']; |
6a488035 TO |
58 | break; |
59 | ||
60 | case 'civicrm/queue/ajax/onEnd': | |
61 | case 'civicrm/upgrade/queue/ajax/onEnd': | |
62 | $menuPath['path'] = $path; | |
be2fb01f | 63 | $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'onEnd']; |
6a488035 | 64 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; |
be2fb01f | 65 | $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu']; |
6a488035 TO |
66 | break; |
67 | ||
68 | default: | |
69 | // unrecognized | |
70 | } | |
71 | } | |
96025800 | 72 | |
6a488035 | 73 | } |