<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
* abstract class.
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
class CRM_Contribute_Info extends CRM_Core_Component_Info {
/**
+ * @var string
* @inheritDoc
*/
protected $keyword = 'contribute';
* @return array
* collection of required component settings
*/
+
/**
* @return array
*/
public function getInfo() {
- return array(
+ return [
'name' => 'CiviContribute',
'translatedName' => ts('CiviContribute'),
'title' => ts('CiviCRM Contribution Engine'),
'search' => 1,
'showActivitiesInCore' => 1,
- );
+ ];
}
/**
* collection of permissions, null if none
*/
public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
- $permissions = array(
- 'access CiviContribute' => array(
+ $permissions = [
+ 'access CiviContribute' => [
ts('access CiviContribute'),
ts('Record backend contributions (with edit contributions) and view all contributions (for visible contacts)'),
- ),
- 'edit contributions' => array(
+ ],
+ 'edit contributions' => [
ts('edit contributions'),
ts('Record and update contributions'),
- ),
- 'make online contributions' => array(
+ ],
+ 'make online contributions' => [
ts('make online contributions'),
- ),
- 'delete in CiviContribute' => array(
+ ],
+ 'delete in CiviContribute' => [
ts('delete in CiviContribute'),
ts('Delete contributions'),
- ),
- );
+ ],
+ ];
if (!$descriptions) {
foreach ($permissions as $name => $attr) {
* list of permissions
* @see CRM_Component_Info::getPermissions
*/
+
/**
* @return array
*/
public function getAnonymousPermissionWarnings() {
- return array(
+ return [
'access CiviContribute',
- );
+ ];
}
/**
* collection of required dashboard settings,
* null if no element offered
*/
+
/**
* @return array|null
*/
public function getUserDashboardElement() {
- return array(
+ return [
'name' => ts('Contributions'),
'title' => ts('Your Contribution(s)'),
- 'perm' => array('make online contributions'),
+ 'perm' => ['make online contributions'],
'weight' => 10,
- );
+ ];
}
/**
* collection of required dashboard settings,
* null if no element offered
*/
+
/**
* @return array|null
*/
public function registerTab() {
- return array(
+ return [
'title' => ts('Contributions'),
'url' => 'contribution',
'weight' => 20,
- );
+ ];
}
/**
* collection of required pane settings,
* null if no element offered
*/
+
/**
* @return array|null
*/
public function registerAdvancedSearchPane() {
- return array(
+ return [
'title' => ts('Contributions'),
'weight' => 20,
- );
+ ];
}
/**
* @return array|null
* collection of activity types
*/
+
/**
* @return array|null
*/
if (CRM_Core_Permission::check('access CiviContribute') &&
CRM_Core_Permission::check('edit contributions')
) {
- $shortCut[] = array(
+ $shortCut[] = [
'path' => 'civicrm/contribute/add',
'query' => "reset=1&action=add&context=standalone",
'ref' => 'new-contribution',
'title' => ts('Contribution'),
- );
+ ];
if ($newCredit) {
$title = ts('Contribution') . '<br /> (' . ts('credit card') . ')';
- $shortCut[0]['shortCuts'][] = array(
+ $shortCut[0]['shortCuts'][] = [
'path' => 'civicrm/contribute/add',
'query' => "reset=1&action=add&context=standalone&mode=live",
'ref' => 'new-contribution-cc',
'title' => $title,
- );
+ ];
}
$shortCuts = array_merge($shortCuts, $shortCut);
}