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
{
44 protected $keyword = 'contribute';
48 * Provides base information about the component.
49 * Needs to be implemented in component's information
53 * collection of required component settings
58 public function getInfo() {
60 'name' => 'CiviContribute',
61 'translatedName' => ts('CiviContribute'),
62 'title' => ts('CiviCRM Contribution Engine'),
64 'showActivitiesInCore' => 1,
70 * Provides permissions that are used by component.
71 * Needs to be implemented in component's information
74 * NOTE: if using conditionally permission return,
75 * implementation of $getAllUnconditionally is required.
77 * @param bool $getAllUnconditionally
80 * collection of permissions, null if none
83 * @param bool $getAllUnconditionally
87 public function getPermissions($getAllUnconditionally = FALSE) {
89 'access CiviContribute',
91 'make online contributions',
92 'delete in CiviContribute',
97 * Provides permissions that are unwise for Anonymous Roles to have.
100 * list of permissions
101 * @see CRM_Component_Info::getPermissions
106 public function getAnonymousPermissionWarnings() {
108 'access CiviContribute',
114 * Provides information about user dashboard element
115 * offered by this component.
118 * collection of required dashboard settings,
119 * null if no element offered
124 public function getUserDashboardElement() {
126 'name' => ts('Contributions'),
127 'title' => ts('Your Contribution(s)'),
128 'perm' => array('make online contributions'),
135 * Provides information about user dashboard element
136 * offered by this component.
139 * collection of required dashboard settings,
140 * null if no element offered
145 public function registerTab() {
147 'title' => ts('Contributions'),
148 'url' => 'contribution',
155 * Provides information about advanced search pane
156 * offered by this component.
159 * collection of required pane settings,
160 * null if no element offered
165 public function registerAdvancedSearchPane() {
167 'title' => ts('Contributions'),
174 * Provides potential activity types that this
175 * component might want to register in activity history.
176 * Needs to be implemented in component's information
180 * collection of activity types
185 public function getActivityTypes() {
190 * add shortcut to Create New.
194 public function creatNewShortcut(&$shortCuts, $newCredit) {
195 if (CRM_Core_Permission
::check('access CiviContribute') &&
196 CRM_Core_Permission
::check('edit contributions')
199 'path' => 'civicrm/contribute/add',
200 'query' => "reset=1&action=add&context=standalone",
201 'ref' => 'new-contribution',
202 'title' => ts('Contribution'),
205 $title = ts('Contribution') . '<br /> (' . ts('credit card') . ')';
206 $shortCut[0]['shortCuts'][] = array(
207 'path' => 'civicrm/contribute/add',
208 'query' => "reset=1&action=add&context=standalone&mode=live",
209 'ref' => 'new-contribution-cc',
213 $shortCuts = array_merge($shortCuts, $shortCut);