<?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 |
+--------------------------------------------------------------------+
*/
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
$session = CRM_Core_Session::singleton();
self::$_recent = $session->get(self::STORE_NAME);
if (!self::$_recent) {
- self::$_recent = array();
+ self::$_recent = [];
}
}
}
$type,
$contactId,
$contactName,
- $others = array()
+ $others = []
) {
self::initialize();
}
if (!is_array($others)) {
- $others = array();
+ $others = [];
}
array_unshift(self::$_recent,
- array(
+ [
'title' => $title,
'url' => $url,
'id' => $id,
'type' => $type,
'contact_id' => $contactId,
'contactName' => $contactName,
- 'subtype' => CRM_Utils_Array::value('subtype', $others),
- 'isDeleted' => CRM_Utils_Array::value('isDeleted', $others, FALSE),
- 'image_url' => CRM_Utils_Array::value('imageUrl', $others),
- 'edit_url' => CRM_Utils_Array::value('editUrl', $others),
- 'delete_url' => CRM_Utils_Array::value('deleteUrl', $others),
- )
+ 'subtype' => $others['subtype'] ?? NULL,
+ 'isDeleted' => $others['isDeleted'] ?? FALSE,
+ 'image_url' => $others['imageUrl'] ?? NULL,
+ 'edit_url' => $others['editUrl'] ?? NULL,
+ 'delete_url' => $others['deleteUrl'] ?? NULL,
+ ]
);
if (count(self::$_recent) > self::$_maxItems) {
self::initialize();
$tempRecent = self::$_recent;
- self::$_recent = array();
+ self::$_recent = [];
// make sure item is not already present in list
for ($i = 0; $i < count($tempRecent); $i++) {
$tempRecent = self::$_recent;
- self::$_recent = array();
+ self::$_recent = [];
// rebuild recent.
for ($i = 0; $i < count($tempRecent); $i++) {
* @return array
*/
public static function getProviders() {
- $providers = array(
+ $providers = [
'Contact' => ts('Contacts'),
'Relationship' => ts('Relationships'),
'Activity' => ts('Activities'),
'Pledge' => ts('Pledges'),
'Event' => ts('Events'),
'Campaign' => ts('Campaigns'),
- );
+ ];
return $providers;
}