Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
39de6fd5 | 4 | | CiviCRM version 4.6 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
06b69b18 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * | |
30 | * @package CRM | |
06b69b18 | 31 | * @copyright CiviCRM LLC (c) 2004-2014 |
6a488035 TO |
32 | * $Id$ |
33 | * | |
34 | */ | |
35 | ||
36 | /** | |
37 | * Page for displaying list of categories | |
38 | */ | |
39 | class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { | |
40 | ||
e2046b33 CW |
41 | public $useLivePageJS = TRUE; |
42 | ||
6a488035 TO |
43 | /** |
44 | * The action links that we need to display for the browse screen | |
45 | * | |
46 | * @var array | |
47 | * @static | |
48 | */ | |
49 | static $_links = NULL; | |
50 | ||
51 | /** | |
52 | * Get BAO | |
53 | * | |
a6c01b45 CW |
54 | * @return string |
55 | * Classname of BAO. | |
6a488035 | 56 | */ |
00be9182 | 57 | public function getBAOName() { |
6a488035 TO |
58 | return 'CRM_Core_BAO_Mapping'; |
59 | } | |
60 | ||
61 | /** | |
62 | * Get action Links | |
63 | * | |
a6c01b45 CW |
64 | * @return array |
65 | * (reference) of action links | |
6a488035 | 66 | */ |
00be9182 | 67 | public function &links() { |
6a488035 TO |
68 | if (!(self::$_links)) { |
69 | // helper variable for nicer formatting | |
70 | $deleteExtra = ts('Are you sure you want to delete this mapping?') . ' ' . ts('This operation cannot be undone.'); | |
71 | self::$_links = array( | |
72 | CRM_Core_Action::UPDATE => array( | |
73 | 'name' => ts('Edit'), | |
74 | 'url' => 'civicrm/admin/mapping', | |
75 | 'qs' => 'action=update&id=%%id%%&reset=1', | |
76 | 'title' => ts('Edit Mapping'), | |
77 | ), | |
78 | CRM_Core_Action::DELETE => array( | |
79 | 'name' => ts('Delete'), | |
80 | 'url' => 'civicrm/admin/mapping', | |
81 | 'qs' => 'action=delete&id=%%id%%', | |
82 | 'title' => ts('Delete Mapping'), | |
83 | ), | |
84 | ); | |
85 | } | |
86 | return self::$_links; | |
87 | } | |
88 | ||
89 | /** | |
90 | * Get name of edit form | |
91 | * | |
a6c01b45 CW |
92 | * @return string |
93 | * Classname of edit form. | |
6a488035 | 94 | */ |
00be9182 | 95 | public function editForm() { |
6a488035 TO |
96 | return 'CRM_Admin_Form_Mapping'; |
97 | } | |
98 | ||
99 | /** | |
100 | * Get form name for edit form | |
101 | * | |
a6c01b45 CW |
102 | * @return string |
103 | * name of this page. | |
6a488035 | 104 | */ |
00be9182 | 105 | public function editName() { |
6a488035 TO |
106 | return 'Mapping'; |
107 | } | |
108 | ||
109 | /** | |
110 | * Get form name for delete form | |
111 | * | |
a6c01b45 CW |
112 | * @return string |
113 | * name of this page. | |
6a488035 | 114 | */ |
00be9182 | 115 | public function deleteName() { |
6a488035 TO |
116 | return 'Mapping'; |
117 | } | |
118 | ||
119 | /** | |
120 | * Get user context. | |
121 | * | |
dd244018 EM |
122 | * @param null $mode |
123 | * | |
a6c01b45 CW |
124 | * @return string |
125 | * user context. | |
6a488035 | 126 | */ |
00be9182 | 127 | public function userContext($mode = NULL) { |
6a488035 TO |
128 | return 'civicrm/admin/mapping'; |
129 | } | |
130 | ||
131 | /** | |
132 | * Get name of delete form | |
133 | * | |
a6c01b45 CW |
134 | * @return string |
135 | * Classname of delete form. | |
6a488035 | 136 | */ |
00be9182 | 137 | public function deleteForm() { |
6a488035 TO |
138 | return 'CRM_Admin_Form_Mapping'; |
139 | } | |
140 | ||
141 | /** | |
142 | * Run the basic page | |
143 | * | |
144 | * @return void | |
145 | */ | |
00be9182 | 146 | public function run() { |
6a488035 TO |
147 | $sort = 'mapping_type asc'; |
148 | return parent::run($sort); | |
149 | } | |
150 | } |