3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
38 class CRM_Pledge_Info
extends CRM_Core_Component_Info
{
43 protected $keyword = 'pledge';
46 * Provides base information about the component.
47 * Needs to be implemented in component's information
51 * collection of required component settings
53 public function getInfo() {
55 'name' => 'CiviPledge',
56 'translatedName' => ts('CiviPledge'),
57 'title' => ts('CiviCRM Pledge Engine'),
59 'showActivitiesInCore' => 1,
66 * Provides permissions that are used by component.
67 * Needs to be implemented in component's information
70 * NOTE: if using conditionally permission return,
71 * implementation of $getAllUnconditionally is required.
73 * @param bool $getAllUnconditionally
74 * @param bool $descriptions
75 * Whether to return permission descriptions
78 * collection of permissions, null if none
80 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
82 'access CiviPledge' => array(
83 ts('access CiviPledge'),
86 'edit pledges' => array(
88 ts('Create and update pledges'),
90 'delete in CiviPledge' => array(
91 ts('delete in CiviPledge'),
97 foreach ($permissions as $name => $attr) {
98 $permissions[$name] = array_shift($attr);
107 * Provides information about user dashboard element
108 * offered by this component.
111 * collection of required dashboard settings,
112 * null if no element offered
117 public function getUserDashboardElement() {
119 'name' => ts('Pledges'),
120 'title' => ts('Your Pledge(s)'),
121 // we need to check this permission since you can click on contribution page link for making payment
122 'perm' => array('make online contributions'),
129 * Provides information about user dashboard element
130 * offered by this component.
133 * collection of required dashboard settings,
134 * null if no element offered
139 public function registerTab() {
141 'title' => ts('Pledges'),
149 * Provides information about advanced search pane
150 * offered by this component.
153 * collection of required pane settings,
154 * null if no element offered
159 public function registerAdvancedSearchPane() {
161 'title' => ts('Pledges'),
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
174 * collection of activity types
179 public function getActivityTypes() {
184 * add shortcut to Create New.
187 public function creatNewShortcut(&$shortCuts) {
188 if (CRM_Core_Permission
::check('access CiviPledge') &&
189 CRM_Core_Permission
::check('edit pledges')
191 $shortCuts = array_merge($shortCuts, array(
193 'path' => 'civicrm/pledge/add',
194 'query' => 'reset=1&action=add&context=standalone',
195 'ref' => 'new-pledge',
196 'title' => ts('Pledge'),