X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FInfo.php;h=6fd1c9c51c394e4f4116ef68502b9583797fdcee;hb=1330f57ae81c4ddb379f7f121de054427f6636bb;hp=41f03e46b42c74517a3b2858339d40d9f00f8cfd;hpb=8b58a98f17b65d4e5c67f973b66ebb1b4df3615a;p=civicrm-core.git diff --git a/CRM/Contribute/Info.php b/CRM/Contribute/Info.php index 41f03e46b4..6fd1c9c51c 100644 --- a/CRM/Contribute/Info.php +++ b/CRM/Contribute/Info.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -31,12 +31,13 @@ * abstract class. * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Contribute_Info extends CRM_Core_Component_Info { /** + * @var string * @inheritDoc */ protected $keyword = 'contribute'; @@ -50,17 +51,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 +82,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 +116,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 +135,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 +157,24 @@ 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, - ); + ]; + } + + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-credit-card'; } /** @@ -173,14 +186,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, - ); + ]; } /** @@ -193,6 +207,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { * @return array|null * collection of activity types */ + /** * @return array|null */ @@ -209,20 +224,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') . '
  (' . 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); }