Skip to content

Commit

Permalink
Replace "Unsupported version" text with icon at the modification list
Browse files Browse the repository at this point in the history
  • Loading branch information
daris committed Feb 15, 2012
1 parent b0542c6 commit 068ead5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Binary file added img/patcher/bullet_green.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/patcher/bullet_red.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 8 additions & 16 deletions plugins/AP_Patcher.php
Expand Up @@ -18,6 +18,9 @@
if (!defined('PATCHER_ROOT')) if (!defined('PATCHER_ROOT'))
define('PATCHER_ROOT', PUN_ROOT.'plugins/patcher/'); define('PATCHER_ROOT', PUN_ROOT.'plugins/patcher/');


if (!defined('PATCHER_ROOT_URL'))
define('PATCHER_ROOT_URL', $pun_config['o_base_url'].'/'.substr(realpath(PATCHER_ROOT.'../../'), strlen(PUN_ROOT)));

// Enable debug mode for now (remove when releasing stable version) // Enable debug mode for now (remove when releasing stable version)
if (!defined('PUN_DEBUG')) if (!defined('PUN_DEBUG'))
define('PUN_DEBUG', 1); define('PUN_DEBUG', 1);
Expand Down Expand Up @@ -931,20 +934,12 @@
<?php endif; ?> <?php endif; ?>
<legend><?php echo $langPatcher[$section] ?></legend> <legend><?php echo $langPatcher[$section] ?></legend>
<div class="infldset"> <div class="infldset">
<?php <?php if (empty($mods)) : ?> <p><?php echo $langPatcher['No '.strtolower($section)] ?></p>
if (empty($mods)) <?php else : ?>
{
?>
<p><?php echo $langPatcher['No '.strtolower($section)] ?></p>
<?php
}
else
{
?>
<table> <table>
<thead> <thead>
<tr> <tr>
<th class="tcl"><?php echo $langPatcher['Mod title'] ?></th> <th class="tcl" colspan="2"><?php echo $langPatcher['Mod title'] ?></th>
<th class="tcr" style="width: 25%"><?php echo $langPatcher['Action'] ?></th> <th class="tcr" style="width: 25%"><?php echo $langPatcher['Action'] ?></th>
<?php if ($section != 'Mods to download') : ?> <th style="width: 10px"><?php echo $langPatcher['Select'] ?></th> <?php if ($section != 'Mods to download') : ?> <th style="width: 10px"><?php echo $langPatcher['Select'] ?></th>
<?php endif; ?> </tr> <?php endif; ?> </tr>
Expand Down Expand Up @@ -978,10 +973,6 @@
$info[] = '<br />'.pun_htmlspecialchars($curMod->description); $info[] = '<br />'.pun_htmlspecialchars($curMod->description);
} }


// Is the mod compatible with FluxBB version
if (!$curMod->isCompatible())
$info[] = '<br /><span style="color: #a00; display: inline">'.$langPatcher['Unsupported version info'].'</span>';

if (isset($curMod->important)) if (isset($curMod->important))
$info[] = '<br /><span style="color: #a00"><strong>'.$langPatcher['Important'].'</strong>: '.pun_htmlspecialchars($curMod->important).'</span>'; $info[] = '<br /><span style="color: #a00"><strong>'.$langPatcher['Important'].'</strong>: '.pun_htmlspecialchars($curMod->important).'</span>';


Expand Down Expand Up @@ -1053,6 +1044,7 @@


?> ?>
<tr class="mod-info <?php echo ($i % 2 == 0) ? 'roweven' : 'rowodd' ?>"> <tr class="mod-info <?php echo ($i % 2 == 0) ? 'roweven' : 'rowodd' ?>">
<td style="width: 20px; background-repeat: no-repeat; background-position: center center; background-image: url(<?php echo PATCHER_ROOT_URL ?>/img/patcher/bullet_<?php echo $curMod->isCompatible() ? 'green' : 'red' ?>.png)"<?php echo $curMod->isCompatible() ? '' : ' title="'.$langPatcher['Unsupported version info'].'"' ?>>&nbsp;</td>
<td><?php echo implode("\n", $info) ?></td> <td><?php echo implode("\n", $info) ?></td>
<td class="tcr"> <td class="tcr">
<?php echo ($status != '') ? $status.'<br />' : '' ?> <?php echo ($status != '') ? $status.'<br />' : '' ?>
Expand All @@ -1063,7 +1055,7 @@
<?php <?php
$i++; $i++;
} }
} endif;


?> ?>
</tbody> </tbody>
Expand Down

0 comments on commit 068ead5

Please sign in to comment.