Skip to content

Commit

Permalink
#16 Add translation link & codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderpotjer committed Jul 18, 2020
1 parent d22074e commit 2cde63b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 3 additions & 5 deletions public_html/components/com_jed/helpers/jed.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,18 @@ static public function formatImage($filename, $size = 'small'): string
}

// Filename for small image
if ($size == 'small')
if ($size === 'small')
{
$imageSize = str_replace('.', '_resizeDown400px175px16.', $filename);
}

// Filename for large image
if ($size == 'large')
if ($size === 'large')
{
$imageSize = str_replace('.', '_resizeDown1200px525px16.', $filename);
}

// Use CDN url
$imageUrl = 'https://extensionscdn.joomla.org/cache/fab_image/' . $imageSize;

return $imageUrl;
return 'https://extensionscdn.joomla.org/cache/fab_image/' . $imageSize;
}
}
2 changes: 2 additions & 0 deletions public_html/components/com_jed/models/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function getItem($pk = null)
'extensions.supportLink',
'extensions.documentationLink',
'extensions.licenseLink',
'extensions.translationLink',
'users.name',
'categories.title'
],
Expand All @@ -77,6 +78,7 @@ public function getItem($pk = null)
'supportLink',
'documentationLink',
'licenseLink',
'translationLink',
'developer',
'category',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
<?php if ($this->item->licenseLink): ?>
<a href="<?php echo $this->item->licenseLink; ?>" class="button button--grey">License</a>
<?php endif; ?>
<?php if ($this->item->translationLink): ?>
<a href="<?php echo $this->item->translationLink; ?>" class="button button--grey">Translation</a>
<?php endif; ?>
</p>
</div>
<div class="jed-grid__item">
Expand Down

0 comments on commit 2cde63b

Please sign in to comment.