'template' => 'LangSwitch.tpl',
'info' => ts('CiviCRM Language Switcher'),
'subject' => '',
- 'templateValues' => array(),
+ 'templateValues' => [],
'active' => TRUE,
'cache' => BLOCK_NO_CACHE,
'visibility' => 1,
'template' => 'Event.tpl',
'info' => ts('CiviCRM Upcoming Events'),
'subject' => ts('Upcoming Events'),
- 'templateValues' => array(),
+ 'templateValues' => [],
'active' => TRUE,
'cache' => BLOCK_NO_CACHE,
'visibility' => 1,
if (!(self::$_properties)) {
self::initProperties();
}
- return isset(self::$_properties[$id][$property]) ? self::$_properties[$id][$property] : NULL;
+ return self::$_properties[$id][$property] ?? NULL;
}
/**
*/
public static function getInfo() {
- $block = array();
+ $block = [];
foreach (self::properties() as $id => $value) {
if ($value['active']) {
if (in_array($id, array(
private static function setTemplateShortcutValues() {
$config = CRM_Core_Config::singleton();
- static $shortCuts = array();
+ static $shortCuts = [];
if (!($shortCuts)) {
if (CRM_Core_Permission::check('add contacts')) {
}
}
- $values = array();
+ $values = [];
foreach ($shortCuts as $key => $short) {
$values[$key] = self::setShortCutValues($short);
}
* @return array
*/
private static function setShortcutValues($short) {
- $value = array();
+ $value = [];
if (isset($short['url'])) {
$value['url'] = $short['url'];
}
$value['url'] = CRM_Utils_System::url($short['path'], $short['query'], FALSE);
}
$value['title'] = $short['title'];
- $value['ref'] = isset($short['ref']) ? $short['ref'] : '';
+ $value['ref'] = $short['ref'] ?? '';
if (!empty($short['shortCuts'])) {
foreach ($short['shortCuts'] as $shortCut) {
$value['shortCuts'][] = self::setShortcutValues($shortCut);
* Create the list of dashboard links.
*/
private static function setTemplateDashboardValues() {
- static $dashboardLinks = array();
+ static $dashboardLinks = [];
if (CRM_Core_Permission::check('access Contact Dashboard')) {
$dashboardLinks = array(
array(
return NULL;
}
- $values = array();
+ $values = [];
foreach ($dashboardLinks as $dash) {
- $value = array();
+ $value = [];
if (isset($dash['url'])) {
$value['url'] = $dash['url'];
}
$value['url'] = CRM_Utils_System::url($dash['path'], $dash['query'], FALSE);
}
$value['title'] = $dash['title'];
- $value['key'] = CRM_Utils_Array::value('key', $dash);
+ $value['key'] = $dash['key'] ?? NULL;
$values[] = $value;
}
self::setProperty(self::DASHBOARD, 'templateValues', array('dashboardLinks' => $values));
);
}
- $values = array();
+ $values = [];
foreach ($shortCuts as $short) {
- $value = array();
+ $value = [];
$value['url'] = CRM_Utils_System::url($short['path'], $short['query']);
$value['title'] = $short['title'];
$values[] = $value;
return NULL;
}
- $block = array();
+ $block = [];
$block['name'] = 'block-civicrm';
$block['id'] = $block['name'] . '_' . $id;
$block['subject'] = self::fetch($id, 'Subject.tpl',