Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
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 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
16 | */ |
17 | ||
18 | /** | |
ce064e4f | 19 | * Page for displaying list of location types. |
6a488035 TO |
20 | */ |
21 | class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { | |
22 | ||
96f50de2 CW |
23 | public $useLivePageJS = TRUE; |
24 | ||
6a488035 | 25 | /** |
eceb18cc | 26 | * The action links that we need to display for the browse screen. |
6a488035 TO |
27 | * |
28 | * @var array | |
6a488035 | 29 | */ |
62d3ee27 | 30 | public static $_links = NULL; |
6a488035 TO |
31 | |
32 | /** | |
eceb18cc | 33 | * Get BAO Name. |
6a488035 | 34 | * |
a6c01b45 CW |
35 | * @return string |
36 | * Classname of BAO. | |
6a488035 | 37 | */ |
00be9182 | 38 | public function getBAOName() { |
6a488035 TO |
39 | return 'CRM_Core_BAO_LocationType'; |
40 | } | |
41 | ||
42 | /** | |
eceb18cc | 43 | * Get action Links. |
6a488035 | 44 | * |
a6c01b45 CW |
45 | * @return array |
46 | * (reference) of action links | |
6a488035 | 47 | */ |
00be9182 | 48 | public function &links() { |
6a488035 | 49 | if (!(self::$_links)) { |
be2fb01f CW |
50 | self::$_links = [ |
51 | CRM_Core_Action::UPDATE => [ | |
6a488035 TO |
52 | 'name' => ts('Edit'), |
53 | 'url' => 'civicrm/admin/locationType', | |
54 | 'qs' => 'action=update&id=%%id%%&reset=1', | |
55 | 'title' => ts('Edit Location Type'), | |
be2fb01f CW |
56 | ], |
57 | CRM_Core_Action::DISABLE => [ | |
6a488035 | 58 | 'name' => ts('Disable'), |
4d17a233 | 59 | 'ref' => 'crm-enable-disable', |
6a488035 | 60 | 'title' => ts('Disable Location Type'), |
be2fb01f CW |
61 | ], |
62 | CRM_Core_Action::ENABLE => [ | |
6a488035 | 63 | 'name' => ts('Enable'), |
4d17a233 | 64 | 'ref' => 'crm-enable-disable', |
6a488035 | 65 | 'title' => ts('Enable Location Type'), |
be2fb01f CW |
66 | ], |
67 | CRM_Core_Action::DELETE => [ | |
6a488035 TO |
68 | 'name' => ts('Delete'), |
69 | 'url' => 'civicrm/admin/locationType', | |
70 | 'qs' => 'action=delete&id=%%id%%', | |
71 | 'title' => ts('Delete Location Type'), | |
be2fb01f CW |
72 | ], |
73 | ]; | |
6a488035 TO |
74 | } |
75 | return self::$_links; | |
76 | } | |
77 | ||
78 | /** | |
eceb18cc | 79 | * Get name of edit form. |
6a488035 | 80 | * |
a6c01b45 CW |
81 | * @return string |
82 | * Classname of edit form. | |
6a488035 | 83 | */ |
00be9182 | 84 | public function editForm() { |
6a488035 TO |
85 | return 'CRM_Admin_Form_LocationType'; |
86 | } | |
87 | ||
88 | /** | |
eceb18cc | 89 | * Get edit form name. |
6a488035 | 90 | * |
a6c01b45 CW |
91 | * @return string |
92 | * name of this page. | |
6a488035 | 93 | */ |
00be9182 | 94 | public function editName() { |
6a488035 TO |
95 | return 'Location Types'; |
96 | } | |
97 | ||
98 | /** | |
99 | * Get user context. | |
100 | * | |
fd31fa4c EM |
101 | * @param null $mode |
102 | * | |
a6c01b45 CW |
103 | * @return string |
104 | * user context. | |
6a488035 | 105 | */ |
00be9182 | 106 | public function userContext($mode = NULL) { |
6a488035 TO |
107 | return 'civicrm/admin/locationType'; |
108 | } | |
96025800 | 109 | |
6a488035 | 110 | } |