* so the display routine needs to not do any work. (The
* parent object takes care of the display)
*
- * @var boolean
+ * @var bool
*/
protected $_embedded = FALSE;
* Are we in print mode? if so we need to modify the display
* functionality to do a minimal display :)
*
- * @var boolean
+ * @var bool
*/
protected $_print = FALSE;
*
* @var array
*/
- public $ajaxResponse = array();
+ public $ajaxResponse = [];
/**
* Url path used to reach this page
*
* @var array
*/
- public $urlPath = array();
+ public $urlPath = [];
/**
* Should crm.livePage.js be added to the page?
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
}
// Support 'json' as well as legacy value '6'
- elseif (in_array($_REQUEST['snippet'], array(CRM_Core_Smarty::PRINT_JSON, 6))) {
+ elseif (in_array($_REQUEST['snippet'], [CRM_Core_Smarty::PRINT_JSON, 6])) {
$this->_print = CRM_Core_Smarty::PRINT_JSON;
}
else {
CRM_Utils_Hook::pageRun($this);
if ($this->_print) {
- if (in_array($this->_print, array(
+ if (in_array($this->_print, [
CRM_Core_Smarty::PRINT_SNIPPET,
CRM_Core_Smarty::PRINT_PDF,
CRM_Core_Smarty::PRINT_NOFORM,
CRM_Core_Smarty::PRINT_JSON,
- ))) {
+ ])) {
$content = self::$_template->fetch('CRM/common/snippet.tpl');
}
else {
if ($this->_print == CRM_Core_Smarty::PRINT_PDF) {
CRM_Utils_PDF_Utils::html2pdf($content, "{$this->_name}.pdf", FALSE,
- array('paper_size' => 'a3', 'orientation' => 'landscape')
+ ['paper_size' => 'a3', 'orientation' => 'landscape']
);
}
elseif ($this->_print == CRM_Core_Smarty::PRINT_JSON) {
$config = CRM_Core_Config::singleton();
+ // @fixme this is probably the wrong place for this. It is required by jsortable.tpl which is inherited from many page templates.
+ // So we have to add it here to deprecate $config->defaultCurrencySymbol
+ $this->assign('defaultCurrencySymbol', CRM_Core_BAO_Country::defaultCurrencySymbol());
+
// Intermittent alert to admins
CRM_Utils_Check::singleton()->showPeriodicAlerts();
public function getTemplateFileName() {
return strtr(
CRM_Utils_System::getClassName($this),
- array(
+ [
'_' => DIRECTORY_SEPARATOR,
'\\' => DIRECTORY_SEPARATOR,
- )
+ ]
) . '.tpl';
}
* @throws \CiviCRM_API3_Exception
*/
protected function assignFieldMetadataToTemplate($entity) {
- $fields = civicrm_api3($entity, 'getfields', array('action' => 'get'));
- $dateFields = array();
+ $fields = civicrm_api3($entity, 'getfields', ['action' => 'get']);
+ $dateFields = [];
foreach ($fields['values'] as $fieldName => $fieldMetaData) {
if (isset($fieldMetaData['html']) && CRM_Utils_Array::value('type', $fieldMetaData['html']) == 'Select Date') {
$dateFields[$fieldName] = CRM_Utils_Date::addDateMetadataToField($fieldMetaData, $fieldMetaData);