Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | +--------------------------------------------------------------------+ | |
5 | | CiviCRM version 4.3 | | |
6 | +--------------------------------------------------------------------+ | |
7 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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 | |
34 | * @copyright CiviCRM LLC (c) 2004-2013 | |
35 | * $Id$ | |
36 | * | |
37 | */ | |
38 | ||
39 | require_once 'CRM/Core/I18n.php'; | |
40 | class CRM_Queue_Menu { | |
41 | ||
42 | static function alter($path, &$menuPath) { | |
43 | switch ($path) { | |
44 | case 'civicrm/queue/runner': | |
45 | case 'civicrm/upgrade/queue/runner': | |
46 | $menuPath['path'] = $path; | |
47 | $menuPath['title'] = 'Queue Runner'; | |
48 | $menuPath['page_callback'] = 'CRM_Queue_Page_Runner'; | |
49 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
50 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
51 | break; | |
52 | ||
53 | case 'civicrm/queue/ajax/runNext': | |
54 | case 'civicrm/upgrade/queue/ajax/runNext': | |
55 | $menuPath['path'] = $path; | |
56 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'runNext'); | |
57 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
58 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
59 | break; | |
60 | ||
61 | case 'civicrm/queue/ajax/skipNext': | |
62 | case 'civicrm/upgrade/queue/ajax/skipNext': | |
63 | $menuPath['path'] = $path; | |
64 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'skipNext'); | |
65 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
66 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
67 | break; | |
68 | ||
69 | case 'civicrm/queue/ajax/onEnd': | |
70 | case 'civicrm/upgrade/queue/ajax/onEnd': | |
71 | $menuPath['path'] = $path; | |
72 | $menuPath['page_callback'] = array('CRM_Queue_Page_AJAX', 'onEnd'); | |
73 | $menuPath['access_arguments'][0][] = 'access CiviCRM'; | |
74 | $menuPath['access_callback'] = array('CRM_Core_Permission', 'checkMenu'); | |
75 | break; | |
76 | ||
77 | default: | |
78 | // unrecognized | |
79 | } | |
80 | } | |
81 | } | |
82 |