- $OUT = ""; $SW = 2; $TSIZE = 0;
- foreach ($THEMES['fname'] as $idx => $name) {
- // Generate download link
- $LINK = SERVER_URL."/themes/theme-".$name.".zip";
-
- // @TODO Move this HTML code to a template "admin_theme_row"
- $OUT .= "<tr>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".($idx + 1).".</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\"><a href=\"".$LINK."\">".$name."</a></td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".MAKE_DATETIME($THEMES['fctime'][$idx], "2")."</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".TRANSLATE_COMMA(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2\">".$THEMES['ver'][$idx]." (".$THEMES['cver'][$idx].")</td>
-</tr>
-<tr>
- <td class=\"switch_sw".$SW." bottom2\"> </td>
- <td colspan=\"4\" class=\"switch_sw".$SW." bottom2\">
- <div class=\"tiny\">".$THEMES['infos'][$idx]."</div>
- </td>
-</tr>\n";
- $TSIZE += $THEMES['fsize'][$idx];
+ $OUT = ''; $SW = 2; $totalSize = 0;
+ foreach ($themes['fname'] as $idx => $name) {
+ // Prepare data
+ $content = array(
+ 'sw' => $SW,
+ 'index' => ($idx + 1),
+ 'name' => $name,
+ 'created' => generateDateTime($themes['fctime'][$idx], '2'),
+ 'size' => translateComma(round($themes['fsize'][$idx] / 1.024) / 1000),
+ 'version' => $themes['ver'][$idx],
+ 'current' => $themes['cver'][$idx],
+ 'infos' => $themes['infos'][$idx],
+ );
+
+ // Load row template
+ $OUT .= loadTemplate('admin_list_theme_row', true, $content);
+
+ // Add total size
+ $totalSize += $themes['fsize'][$idx];
+
+ // Switch color