Created
May 26, 2012 11:47
-
-
Save mbabker/2793664 to your computer and use it in GitHub Desktop.
Display compatibility badges on Akeeba Release System "Latest Releases" view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Create an HTML Layout Override for components/com_ars/views/latest/tmpl/category.php | |
* and insert the below snippet just below the $released = new JDate... line | |
* A live example of this can be found on http://www.babdev.com/extensions/latest | |
*/ | |
// Additons to get all supported versions per release (for when multiple items support different versions) | |
$i = 0; | |
$versions = array(); | |
foreach ($cat->release->files as $environment) | |
{ | |
$supported = json_decode($environment->environments); | |
foreach ($supported as $version) | |
{ | |
$versions[$i] = $version; | |
$i++; | |
} | |
} | |
$environments = ArsHelperHtml::getEnvironments(json_encode(array_unique($versions))); | |
/* | |
* The below snippet can be inserted into the HTML to display the badges | |
* (I did it just below the released date) | |
*/ | |
<?php if(!empty($environments)): ?> | |
<span class="ars-release-property"> | |
<span class="ars-label"><?php echo JText::_('LBL_ITEMS_ENVIRONMENTS') ?>:</span> | |
<span class="ars-value"><?php echo $environments; ?></span> | |
</span> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment