Merge pull request #13809 from sushantpaste/auto-complete-search
[civicrm-core.git] / CRM / Queue / Menu.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
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
17 * @copyright CiviCRM LLC https://civicrm.org/licensing
18 * $Id$
19 *
20 */
21
22 require_once 'CRM/Core/I18n.php';
23
24 /**
25 * Class CRM_Queue_Menu
26 */
27 class CRM_Queue_Menu {
28
29 /**
30 * @param string $path
31 * The path for which we are trying to locate the route.
32 * @param array $menuPath
33 * The route.
34 */
35 public static function alter($path, &$menuPath) {
36 switch ($path) {
37 case 'civicrm/queue/runner':
38 case 'civicrm/upgrade/queue/runner':
39 $menuPath['path'] = $path;
40 $menuPath['title'] = 'Queue Runner';
41 $menuPath['page_callback'] = 'CRM_Queue_Page_Runner';
42 $menuPath['access_arguments'][0][] = 'access CiviCRM';
43 $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu'];
44 break;
45
46 case 'civicrm/queue/ajax/runNext':
47 case 'civicrm/upgrade/queue/ajax/runNext':
48 $menuPath['path'] = $path;
49 $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'runNext'];
50 $menuPath['access_arguments'][0][] = 'access CiviCRM';
51 $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu'];
52 break;
53
54 case 'civicrm/queue/ajax/skipNext':
55 case 'civicrm/upgrade/queue/ajax/skipNext':
56 $menuPath['path'] = $path;
57 $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'skipNext'];
58 $menuPath['access_arguments'][0][] = 'access CiviCRM';
59 $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu'];
60 break;
61
62 case 'civicrm/queue/ajax/onEnd':
63 case 'civicrm/upgrade/queue/ajax/onEnd':
64 $menuPath['path'] = $path;
65 $menuPath['page_callback'] = ['CRM_Queue_Page_AJAX', 'onEnd'];
66 $menuPath['access_arguments'][0][] = 'access CiviCRM';
67 $menuPath['access_callback'] = ['CRM_Core_Permission', 'checkMenu'];
68 break;
69
70 default:
71 // unrecognized
72 }
73 }
74
75 }