Merge pull request #15850 from civicrm/5.20
[civicrm-core.git] / CRM / Contribute / Info.php
index b72317b5fe1480d1fff9aa2068e1365aba47f2ee..43a70a08c3fe6119b2b8dc059ea26ae12193f2bf 100644 (file)
@@ -1,27 +1,11 @@
 <?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';
@@ -50,17 +35,18 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @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,
-    );
+    ];
   }
 
   /**
@@ -80,23 +66,23 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   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) {
@@ -114,13 +100,14 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   list of permissions
    * @see CRM_Component_Info::getPermissions
    */
+
   /**
    * @return array
    */
   public function getAnonymousPermissionWarnings() {
-    return array(
+    return [
       'access CiviContribute',
-    );
+    ];
   }
 
   /**
@@ -132,16 +119,17 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   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,
-    );
+    ];
   }
 
   /**
@@ -153,15 +141,16 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   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,
-    );
+    ];
   }
 
   /**
@@ -181,14 +170,15 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    *   collection of required pane settings,
    *                    null if no element offered
    */
+
   /**
    * @return array|null
    */
   public function registerAdvancedSearchPane() {
-    return array(
+    return [
       'title' => ts('Contributions'),
       'weight' => 20,
-    );
+    ];
   }
 
   /**
@@ -201,6 +191,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @return array|null
    *   collection of activity types
    */
+
   /**
    * @return array|null
    */
@@ -217,20 +208,20 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
     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 />&nbsp;&nbsp;(' . 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);
     }