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_Pledge_Info
extends CRM_Core_Component_Info
{
40 // docs inherited from interface
41 protected $keyword = 'pledge';
44 * Provides base information about the component.
45 * Needs to be implemented in component's information
49 * collection of required component settings
51 public function getInfo() {
53 'name' => 'CiviPledge',
54 'translatedName' => ts('CiviPledge'),
55 'title' => ts('CiviCRM Pledge Engine'),
57 'showActivitiesInCore' => 1,
62 // docs inherited from interface
64 * Provides permissions that are used by component.
65 * Needs to be implemented in component's information
68 * NOTE: if using conditionally permission return,
69 * implementation of $getAllUnconditionally is required.
71 * @param bool $getAllUnconditionally
73 * @return array|null collection of permissions, null if none
76 * @param bool $getAllUnconditionally
80 public function getPermissions($getAllUnconditionally = FALSE) {
84 'delete in CiviPledge',
88 // docs inherited from interface
90 * Provides information about user dashboard element
91 * offered by this component.
93 * @return array|null collection of required dashboard settings,
94 * null if no element offered
99 public function getUserDashboardElement() {
101 'name' => ts('Pledges'),
102 'title' => ts('Your Pledge(s)'),
103 // we need to check this permission since you can click on contribution page link for making payment
104 'perm' => array('make online contributions'),
109 // docs inherited from interface
111 * Provides information about user dashboard element
112 * offered by this component.
114 * @return array|null collection of required dashboard settings,
115 * null if no element offered
120 public function registerTab() {
122 'title' => ts('Pledges'),
128 // docs inherited from interface
130 * Provides information about advanced search pane
131 * offered by this component.
133 * @return array|null collection of required pane settings,
134 * null if no element offered
139 public function registerAdvancedSearchPane() {
141 'title' => ts('Pledges'),
146 // docs inherited from interface
148 * Provides potential activity types that this
149 * component might want to register in activity history.
150 * Needs to be implemented in component's information
153 * @return array|null collection of activity types
158 public function getActivityTypes() {
162 // add shortcut to Create New
166 public function creatNewShortcut(&$shortCuts) {
167 if (CRM_Core_Permission
::check('access CiviPledge') &&
168 CRM_Core_Permission
::check('edit pledges')
170 $shortCuts = array_merge($shortCuts, array(
172 'path' => 'civicrm/pledge/add',
173 'query' => 'reset=1&action=add&context=standalone',
174 'ref' => 'new-pledge',
175 'title' => ts('Pledge'),