<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
*/
public function buildQuickForm() {
// add select for groups
- $group = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::nestedGroup();
- $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE, array('class' => 'crm-select2 huge'));
+ $group = ['' => ts('- select group -')] + CRM_Core_PseudoConstant::nestedGroup();
+ $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE, ['class' => 'crm-select2 huge']);
CRM_Utils_System::setTitle(ts('Remove Contacts from Group'));
$this->addDefaultButtons(ts('Remove from Group'));
* the default array reference
*/
public function setDefaultValues() {
- $defaults = array();
+ $defaults = [];
if ($this->get('context') === 'smog') {
$defaults['group_id'] = $this->get('gid');
list($total, $removed, $notRemoved) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($this->_contactIds, $groupId);
- $status = array(
- ts("%count contact removed from '%2'", array(
+ $status = [
+ ts("%count contact removed from '%2'", [
'count' => $removed,
'plural' => "%count contacts removed from '%2'",
2 => $group[$groupId],
- )),
- );
+ ]),
+ ];
if ($notRemoved) {
- $status[] = ts('1 contact was already not in this group', array(
- 'count' => $notRemoved,
- 'plural' => '%count contacts were already not in this group',
- ));
+ $status[] = ts('1 contact was already not in this group', [
+ 'count' => $notRemoved,
+ 'plural' => '%count contacts were already not in this group',
+ ]);
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
- CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
- 'plural' => "Removed Contacts From Group",
- 'count' => $removed,
- )), 'success', array('expires' => 0));
+ CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", [
+ 'plural' => "Removed Contacts From Group",
+ 'count' => $removed,
+ ]), 'success', ['expires' => 0]);
}
}