Commit 5dcceb4e6edc49f7f01bb3366af9c44577d1fa03

Authored by nbm
1 parent 86866e11

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,6 +68,8 @@ function showResult($res) {
68 return $res; 68 return $res;
69 } 69 }
70 70
  71 +$GLOBALS['row'] = 1;
  72 +
71 function performAllUpgrades () { 73 function performAllUpgrades () {
72 global $default; 74 global $default;
73 $query = sprintf('SELECT value FROM %s WHERE name = "knowledgeTreeVersion"', $default->system_settings_table); 75 $query = sprintf('SELECT value FROM %s WHERE name = "knowledgeTreeVersion"', $default->system_settings_table);
@@ -77,14 +79,21 @@ function performAllUpgrades () { @@ -77,14 +79,21 @@ function performAllUpgrades () {
77 $upgrades = describeUpgrade($lastVersion, $currentVersion); 79 $upgrades = describeUpgrade($lastVersion, $currentVersion);
78 80
79 foreach ($upgrades as $upgrade) { 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 ob_flush(); 89 ob_flush();
82 flush(); 90 flush();
83 $res = $upgrade->performUpgrade(); 91 $res = $upgrade->performUpgrade();
84 - printf('<div style="float: left">%s</div>', showResult($res)); 92 + printf('<div class="bar">%s</div>', showResult($res));
85 print '<br style="clear: both">' . "\n"; 93 print '<br style="clear: both">' . "\n";
86 ob_flush(); 94 ob_flush();
87 flush(); 95 flush();
  96 + print "</div>\n";
88 if (PEAR::isError($res)) { 97 if (PEAR::isError($res)) {
89 if (!is_a($res, 'Upgrade_Already_Applied')) { 98 if (!is_a($res, 'Upgrade_Already_Applied')) {
90 break; 99 break;
@@ -106,10 +115,15 @@ if ($_REQUEST[&quot;go&quot;] === &quot;Upgrade&quot;) { @@ -106,10 +115,15 @@ if ($_REQUEST[&quot;go&quot;] === &quot;Upgrade&quot;) {
106 ?> 115 ?>
107 <html> 116 <html>
108 <head> 117 <head>
109 - <title>KnowledgeTree Checkup</title> 118 + <title>KnowledgeTree Upgrade</title>
110 <style> 119 <style>
111 th { text-align: left; } 120 th { text-align: left; }
112 td { vertical-align: top; } 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 </style> 127 </style>
114 </head> 128 </head>
115 129