Skip to content

Commit

Permalink
Remove use of isset for info.tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 10, 2021
1 parent ae9e89a commit 25f044f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CRM/Core/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ public function setContext() {
*/
public $expectedSmartyVariables = [
'beginHookFormElements',
// required for footer.tpl
'contactId',
// required for info.tpl
'infoMessage',
'infoTitle',
'infoType',
'infoOptions',
];

/**
Expand Down
5 changes: 5 additions & 0 deletions CRM/Core/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class CRM_Core_Page {
'hookContentPlacement',
// required for footer.tpl
'contactId',
// required for info.tpl
'infoMessage',
'infoTitle',
'infoType',
'infoOptions',
];

/**
Expand Down
8 changes: 4 additions & 4 deletions templates/CRM/common/info.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
+--------------------------------------------------------------------+
*}
{* Handles display of passed $infoMessage. *}
{if isset($infoMessage) or isset($infoTitle)}
<div class="messages status {$infoType|default:''}"{if !empty($infoOptions)} data-options='{$infoOptions}'{/if}>
{if $infoMessage || $infoTitle}
<div class="messages status {$infoType}"{if $infoOptions} data-options='{$infoOptions}'{/if}>
{icon icon="fa-info-circle"}{/icon}
<span class="msg-title">{$infoTitle|default:''}</span>
<span class="msg-text">{$infoMessage|default:''}</span>
<span class="msg-title">{$infoTitle}</span>
<span class="msg-text">{$infoMessage}</span>
</div>
{/if}

0 comments on commit 25f044f

Please sign in to comment.