<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* abstract class.
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
class CRM_Pledge_Info extends CRM_Core_Component_Info {
* implementation of $getAllUnconditionally is required.
*
* @param bool $getAllUnconditionally
+ * @param bool $descriptions
+ * Whether to return permission descriptions
*
* @return array|null
* collection of permissions, null if none
*/
- /**
- * @param bool $getAllUnconditionally
- *
- * @return array|null
- */
- public function getPermissions($getAllUnconditionally = FALSE) {
- return array(
- 'access CiviPledge',
- 'edit pledges',
- 'delete in CiviPledge',
+ public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
+ $permissions = array(
+ 'access CiviPledge' => array(
+ ts('access CiviPledge'),
+ ts('View pledges'),
+ ),
+ 'edit pledges' => array(
+ ts('edit pledges'),
+ ts('Create and update pledges'),
+ ),
+ 'delete in CiviPledge' => array(
+ ts('delete in CiviPledge'),
+ ts('Delete pledges'),
+ ),
);
+
+ if (!$descriptions) {
+ foreach ($permissions as $name => $attr) {
+ $permissions[$name] = array_shift($attr);
+ }
+ }
+
+ return $permissions;
}
/**
* collection of required dashboard settings,
* null if no element offered
*/
- /**
- * @return array|null
- */
public function getUserDashboardElement() {
return array(
'name' => ts('Pledges'),
* collection of required dashboard settings,
* null if no element offered
*/
- /**
- * @return array|null
- */
public function registerTab() {
return array(
'title' => ts('Pledges'),
* collection of required pane settings,
* null if no element offered
*/
- /**
- * @return array|null
- */
public function registerAdvancedSearchPane() {
return array(
'title' => ts('Pledges'),
* @return array|null
* collection of activity types
*/
- /**
- * @return array|null
- */
public function getActivityTypes() {
return NULL;
}