Skip to content

Commit

Permalink
[Joomla 4.0] CiviCRM logo not showing in Quick Icon plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed May 24, 2022
1 parent 90ad294 commit b376650
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions admin/plugins/civicrmicon/civicrmicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,38 @@ public function __construct(&$subject, $config) {
* @since 2.5
*/
public function onGetIcons($context) {
// exclude CiviCRM quick icons from notification and system block
if ($context == 'system_quickicon' || $context == 'update_quickicon') {
return [];
}

jimport('joomla.environment.uri');
$icon = array(
array(
'link' => 'index.php?option=com_civicrm',
'image' => JURI::base() . 'components/com_civicrm/civicrm/i/smallLogo.png',
'text' => 'CiviCRM',
'id' => 'plg_quickicon_civicrmicon',
'class' => $context == 'mod_quickicon' ? 'success' : '',
),
);

//image must be handled via css class in J3.0
if (version_compare(JVERSION, '3.0', 'ge')) {
$img = JURI::root() . 'plugins/quickicon/civicrmicon/smallLogo14.png';
$css = '
$img = version_compare(JVERSION, '4.0', 'ge') ? $icon[0]['image'] : JURI::root() . 'plugins/quickicon/civicrmicon/smallLogo14.png';
$additonalAttributes = version_compare(JVERSION, '4.0', 'ge') ? 'height:50px;width:50px;' : '';
$css = "
.icon-civicrm, .icon-civicrm-open {
background-image:url("' . $img . '");
{$additonalAttributes}
background-image:url(\"{$img}\");
}
';
";
$document = JFactory::getDocument();
$document->addStyleDeclaration($css);
$icon[0]['image'] = 'civicrm';
if (version_compare(JVERSION, '4.0', 'ge')) {
$icon[0]['image'] = 'icon-civicrm';
}
}
else {
$icon[0]['image'] = JURI::base() . 'components/com_civicrm/civicrm/i/smallLogo.png';
Expand Down

0 comments on commit b376650

Please sign in to comment.