// now sort the tabs based on weight
usort($allTabs, ['CRM_Utils_Sort', 'cmpFunc']);
+ $expectedKeys = ['count', 'class', 'template', 'hideCount', 'icon'];
+ foreach ($allTabs as $index => $tab) {
+ foreach ($expectedKeys as $key) {
+ if (!array_key_exists($key, $tab)) {
+ $allTabs[$index][$key] = NULL;
+ }
+ }
+ }
return $allTabs;
}
<div id="mainTabContainer">
<ul class="crm-contact-tabs-list">
{foreach from=$allTabs item=tabValue}
- <li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all{if isset($tabValue.count)} crm-count-{$tabValue.count}{/if}{if isset($tabValue.class)} {$tabValue.class}{/if}">
- <a href="{if !empty($tabValue.template)}#contact-{$tabValue.id}{else}{$tabValue.url}{/if}" title="{$tabValue.title|escape}">
+ <li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all{if is_numeric($tabValue.count)} crm-count-{$tabValue.count}{/if}{if $tabValue.class} {$tabValue.class}{/if}">
+ <a href="{if $tabValue.template}#contact-{$tabValue.id}{else}{$tabValue.url}{/if}" title="{$tabValue.title|escape}">
<i class="{if !empty($tabValue.icon)}{$tabValue.icon}{else}crm-i fa-puzzle-piece{/if}" aria-hidden="true"></i>
<span>{$tabValue.title}</span>
- {if empty($tabValue.hideCount)}<em>{if isset($tabValue.count)}{$tabValue.count}{/if}</em>{/if}
+ {if empty($tabValue.hideCount)}<em>{if is_numeric($tabValue.count)}{$tabValue.count}{/if}</em>{/if}
</a>
</li>
{/foreach}