Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | +--------------------------------------------------------------------+ | |
06b69b18 | 5 | | CiviCRM version 4.5 | |
6a488035 | 6 | +--------------------------------------------------------------------+ |
06b69b18 | 7 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | | This file is a part of CiviCRM. | | |
10 | | | | |
11 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
12 | | under the terms of the GNU Affero General Public License | | |
13 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
14 | | | | |
15 | | CiviCRM is distributed in the hope that it will be useful, but | | |
16 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
17 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
18 | | See the GNU Affero General Public License for more details. | | |
19 | | | | |
20 | | You should have received a copy of the GNU Affero General Public | | |
21 | | License and the CiviCRM Licensing Exception along | | |
22 | | with this program; if not, contact CiviCRM LLC | | |
23 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
24 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
25 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
26 | +--------------------------------------------------------------------+ | |
27 | */ | |
28 | ||
29 | /** | |
30 | * This file hard-codes the path entries for the queueing UI, which | |
31 | * allows us to use these paths during upgrades. | |
32 | * | |
33 | * @package CRM | |
06b69b18 | 34 | * @copyright CiviCRM LLC (c) 2004-2014 |
6a488035 TO |
35 | * $Id$ |
36 | * | |
37 | */ | |
38 | ||
39 | require_once 'CRM/Core/I18n.php'; | |
28518c90 EM |
40 | |
41 | /** | |
42 | * Class CRM_Queue_Menu | |
43 | */ | |
6a488035 TO |
44 | class CRM_Queue_Menu { |
45 | ||
e0ef6999 EM |
46 | /** |
47 | * @param $path | |
48 | * @param $menuPath | |
49 | */ | |
6a488035 TO |
50 | static function alter($path, &$menuPath) { |
51 | switch ($path) { | |
52 | case 'civicrm/queue/runner': | |
53 | case 'civicrm/upgrade/queue/runner': | |
54 | $menuPath['path'] = $path; | |
55 | $menuPath['title'] = 'Queue Runner'; | |
56 | $menuPath['page_callback'] = 'CRM_Queue_Page_Runner'; | |
57 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
58 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
59 | break; | |
60 | ||
61 | case 'civicrm/queue/ajax/runNext': | |
62 | case 'civicrm/upgrade/queue/ajax/runNext': | |
63 | $menuPath['path'] = $path; | |
64 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'runNext'); | |
65 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
66 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
67 | break; | |
68 | ||
69 | case 'civicrm/queue/ajax/skipNext': | |
70 | case 'civicrm/upgrade/queue/ajax/skipNext': | |
71 | $menuPath['path'] = $path; | |
72 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'skipNext'); | |
73 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
74 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
75 | break; | |
76 | ||
77 | case 'civicrm/queue/ajax/onEnd': | |
78 | case 'civicrm/upgrade/queue/ajax/onEnd': | |
79 | $menuPath['path'] = $path; | |
80 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'onEnd'); | |
81 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
82 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
83 | break; | |
84 | ||
85 | default: | |
86 | // unrecognized | |
87 | } | |
88 | } | |
89 | } | |
90 |