*
* @var string
*/
- var $_name;
+ public $_name;
/**
* List of snippets to inject within region
*
* @var array; e.g. $this->_snippets[3]['type'] = 'template';
*/
- var $_snippets;
+ public $_snippets;
/**
* Whether the snippets array has been sorted
*
* @var boolean
*/
- var $_isSorted;
+ public $_isSorted;
/**
* @param string $name
civicrm_smarty_register_string_resource();
$this->_name = $name;
- $this->_snippets = array();
+ $this->_snippets = [];
// Placeholder which represents any of the default content generated by the main Smarty template
- $this->add(array(
+ $this->add([
'name' => 'default',
'type' => 'markup',
'markup' => '',
'weight' => 0,
- ));
+ ]);
$this->_isSorted = TRUE;
}
* @return array
*/
public function add($snippet) {
- static $types = array('markup', 'template', 'callback', 'scriptUrl', 'script', 'jquery', 'style', 'styleUrl');
- $defaults = array(
+ static $types = ['markup', 'template', 'callback', 'scriptUrl', 'script', 'jquery', 'style', 'styleUrl'];
+ $defaults = [
'region' => $this->_name,
'weight' => 1,
'disabled' => FALSE,
- );
+ ];
$snippet += $defaults;
if (!isset($snippet['type'])) {
foreach ($types as $type) {
$cms = CRM_Core_Config::singleton()->userSystem;
if (!$this->_isSorted) {
- uasort($this->_snippets, array('CRM_Core_Region', '_cmpSnippet'));
+ uasort($this->_snippets, ['CRM_Core_Region', '_cmpSnippet']);
$this->_isSorted = TRUE;
}
default:
require_once 'CRM/Core/Error.php';
CRM_Core_Error::fatal(ts('Snippet type %1 is unrecognized',
- array(1 => $snippet['type'])));
+ [1 => $snippet['type']]));
}
}
return $html;