Commit 86f1ef30d6efd688aad03992a2e99835487d408b

Authored by Neil Blakey-Milner
1 parent 85b7210e

Move to CSS classes for styling, and make it easier to see which item

succeeded or failed.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5447 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 17 additions and 3 deletions
setup/upgrade.php
... ... @@ -68,6 +68,8 @@ function showResult($res) {
68 68 return $res;
69 69 }
70 70  
  71 +$GLOBALS['row'] = 1;
  72 +
71 73 function performAllUpgrades () {
72 74 global $default;
73 75 $query = sprintf('SELECT value FROM %s WHERE name = "knowledgeTreeVersion"', $default->system_settings_table);
... ... @@ -77,14 +79,21 @@ function performAllUpgrades () {
77 79 $upgrades = describeUpgrade($lastVersion, $currentVersion);
78 80  
79 81 foreach ($upgrades as $upgrade) {
80   - printf('<div style="float: right">%s</div>' . "\n", htmlspecialchars($upgrade->getDescription()));
  82 + if (($GLOBALS['row'] % 2) == 1) {
  83 + $class = "odd";
  84 + } else {
  85 + $class = "even";
  86 + }
  87 + printf('<div class="row %s"><div class="foo">%s</div>' . "\n", $class, htmlspecialchars($upgrade->getDescription()));
  88 + $GLOBALS['row']++;
81 89 ob_flush();
82 90 flush();
83 91 $res = $upgrade->performUpgrade();
84   - printf('<div style="float: left">%s</div>', showResult($res));
  92 + printf('<div class="bar">%s</div>', showResult($res));
85 93 print '<br style="clear: both">' . "\n";
86 94 ob_flush();
87 95 flush();
  96 + print "</div>\n";
88 97 if (PEAR::isError($res)) {
89 98 if (!is_a($res, 'Upgrade_Already_Applied')) {
90 99 break;
... ... @@ -106,10 +115,15 @@ if ($_REQUEST[&quot;go&quot;] === &quot;Upgrade&quot;) {
106 115 ?>
107 116 <html>
108 117 <head>
109   - <title>KnowledgeTree Checkup</title>
  118 + <title>KnowledgeTree Upgrade</title>
110 119 <style>
111 120 th { text-align: left; }
112 121 td { vertical-align: top; }
  122 +.foo { float: left; }
  123 +.bar { padding-left: 2em; float: right; }
  124 +.odd { background-color: #eeeeee; }
  125 +.even { background-color: #dddddd; }
  126 +.row { padding: 0.5em 1em; }
113 127 </style>
114 128 </head>
115 129  
... ...