3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * This class introduces component to the system and provides all the
30 * information about it. It needs to extend CRM_Core_Component_Info
34 * @copyright CiviCRM LLC (c) 2004-2014
38 class CRM_Contribute_Info
extends CRM_Core_Component_Info
{
41 // docs inherited from interface
42 protected $keyword = 'contribute';
44 // docs inherited from interface
46 * Provides base information about the component.
47 * Needs to be implemented in component's information
50 * @return array collection of required component settings
56 public function getInfo() {
58 'name' => 'CiviContribute',
59 'translatedName' => ts('CiviContribute'),
60 'title' => ts('CiviCRM Contribution Engine'),
62 'showActivitiesInCore' => 1,
66 // docs inherited from interface
68 * Provides permissions that are used by component.
69 * Needs to be implemented in component's information
72 * NOTE: if using conditionally permission return,
73 * implementation of $getAllUnconditionally is required.
75 * @param bool $getAllUnconditionally
77 * @return array|null collection of permissions, null if none
80 * @param bool $getAllUnconditionally
84 public function getPermissions($getAllUnconditionally = FALSE) {
86 'access CiviContribute',
88 'make online contributions',
89 'delete in CiviContribute',
94 * Provides permissions that are unwise for Anonymous Roles to have
96 * @return array list of permissions
97 * @see CRM_Component_Info::getPermissions
102 public function getAnonymousPermissionWarnings() {
104 'access CiviContribute',
108 // docs inherited from interface
110 * Provides information about user dashboard element
111 * offered by this component.
113 * @return array|null collection of required dashboard settings,
114 * null if no element offered
120 public function getUserDashboardElement() {
121 return array('name' => ts('Contributions'),
122 'title' => ts('Your Contribution(s)'),
123 'perm' => array('make online contributions'),
128 // docs inherited from interface
130 * Provides information about user dashboard element
131 * offered by this component.
133 * @return array|null collection of required dashboard settings,
134 * null if no element offered
140 public function registerTab() {
141 return array('title' => ts('Contributions'),
142 'url' => 'contribution',
147 // docs inherited from interface
149 * Provides information about advanced search pane
150 * offered by this component.
152 * @return array|null collection of required pane settings,
153 * null if no element offered
159 public function registerAdvancedSearchPane() {
161 'title' => ts('Contributions'),
166 // docs inherited from interface
168 * Provides potential activity types that this
169 * component might want to register in activity history.
170 * Needs to be implemented in component's information
173 * @return array|null collection of activity types
179 public function getActivityTypes() {
183 // add shortcut to Create New
188 public function creatNewShortcut(&$shortCuts, $newCredit) {
189 if (CRM_Core_Permission
::check('access CiviContribute') &&
190 CRM_Core_Permission
::check('edit contributions')
193 'path' => 'civicrm/contribute/add',
194 'query' => "reset=1&action=add&context=standalone",
195 'ref' => 'new-contribution',
196 'title' => ts('Contribution'),
199 $title = ts('Contribution') . '<br /> (' . ts('credit card') . ')';
200 $shortCut[0]['shortCuts'][] = array(
201 'path' => 'civicrm/contribute/add',
202 'query' => "reset=1&action=add&context=standalone&mode=live",
203 'ref' => 'new-contribution-cc',
207 $shortCuts = array_merge($shortCuts, $shortCut);