Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added styles to install.php for colours for environment table

  • Loading branch information...
commit d8e68c5e51b2b086fe8616b1f5067e82aeee251d 1 parent c82a4d6
authored June 20, 2007

Showing 1 changed file with 40 additions and 29 deletions. Show diff stats Hide diff stats

  1. 69  install.php
69  install.php
@@ -3,7 +3,7 @@
3 3
 
4 4
 /// If config.php exists already then we are not needed.
5 5
 
6  
-if (file_exists('./config.php')) { 
  6
+if (file_exists('./config.php')) {
7 7
     header('Location: index.php');
8 8
     die;
9 9
 } else {
@@ -97,18 +97,18 @@
97 97
 
98 98
 
99 99
     if ($nextstage < 0) $nextstage = WELCOME;
100  
-    
  100
+
101 101
 
102 102
     /// Store any posted data
103 103
     foreach ($_POST as $setting=>$value) {
104 104
         $INSTALL[$setting] = $value;
105 105
     }
106  
-    
  106
+
107 107
 } else {
108 108
 
109 109
     $goforward = true;
110 110
     $nextstage = WELCOME;
111  
-    
  111
+
112 112
 }
113 113
 
114 114
 //==========================================================================//
@@ -131,7 +131,6 @@
131 131
 require_once('./lib/weblib.php');
132 132
 require_once('./lib/adodb/adodb.inc.php');
133 133
 require_once('./lib/environmentlib.php');
134  
-require_once('./lib/xmlize.php');
135 134
 require_once('./lib/componentlib.class.php');
136 135
 require_once('./version.php');
137 136
 
@@ -199,7 +198,7 @@
199 198
 /// Are we in config download mode?
200 199
 
201 200
 if (isset($_GET['download'])) {
202  
-    header("Content-Type: application/download\n"); 
  201
+    header("Content-Type: application/download\n");
203 202
     header("Content-Disposition: attachment; filename=\"config.php\"");
204 203
     echo $INSTALL['config'];
205 204
     exit;
@@ -216,7 +215,7 @@
216 215
 if ($INSTALL['stage'] == DIRECTORY) {
217 216
 
218 217
     error_reporting(0);
219  
-    
  218
+
220 219
     /// check wwwroot
221 220
     if (ini_get('allow_url_fopen')) {
222 221
         if (($fh = @fopen($INSTALL['wwwrootform'].'/install.php', 'r')) === false) {
@@ -225,12 +224,12 @@
225 224
         }
226 225
     }
227 226
     if ($fh) fclose($fh);
228  
-            
  227
+
229 228
     /// check dirroot
230 229
     if (($fh = @fopen($INSTALL['dirrootform'].'/install.php', 'r')) === false ) {
231 230
         $errormsg .= get_string('dirrooterror', 'install').'<br />';
232 231
         $INSTALL['dirrootform'] = $INSTALL['dirroot'];
233  
-    } 
  232
+    }
234 233
     if ($fh) fclose($fh);
235 234
 
236 235
     /// check dataroot
@@ -238,7 +237,7 @@
238 237
     if (make_upload_directory('sessions', false) === false ) {
239 238
         $errormsg .= get_string('datarooterror', 'install').'<br />';
240 239
     }
241  
-    if ($fh) fclose($fh); 
  240
+    if ($fh) fclose($fh);
242 241
 
243 242
     if (!empty($errormsg)) $nextstage = DIRECTORY;
244 243
 
@@ -260,7 +259,7 @@
260 259
      } else {
261 260
          $INSTALL['skipdbencodingtest'] = false;
262 261
      }
263  
-    
  262
+
264 263
     /// different format for postgres7 by socket
265 264
     if ($INSTALL['dbtype'] == 'postgres7' and ($INSTALL['dbhost'] == 'localhost' || $INSTALL['dbhost'] == '127.0.0.1')) {
266 265
         $INSTALL['dbhost'] = "user='{$INSTALL['dbuser']}' password='{$INSTALL['dbpass']}' dbname='{$INSTALL['dbname']}'";
@@ -282,11 +281,11 @@
282 281
 
283 282
     if (empty($errormsg)) {
284 283
 
285  
-        error_reporting(0);  // Hide errors 
  284
+        error_reporting(0);  // Hide errors
286 285
 
287 286
         if (! $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname'])) {
288 287
             /// The following doesn't seem to work but we're working on it
289  
-            /// If you come up with a solution for creating a database in MySQL 
  288
+            /// If you come up with a solution for creating a database in MySQL
290 289
             /// feel free to put it in and let us know
291 290
             if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) {
292 291
                 switch ($INSTALL['dbtype']) {   /// Try to create a database
@@ -331,7 +330,7 @@
331 330
                                         $nextstage = DATABASE;
332 331
                                         $INSTALL['showskipdbencodingtest'] = true;
333 332
                                         $INSTALL['dbencodingtestresults'] = false;
334  
-                                    } 
  333
+                                    }
335 334
                                 } else {
336 335
                                     $INSTALL['showskipdbencodingtest'] = true;
337 336
                                     $INSTALL['dbencodingtestresults'] = false;
@@ -464,7 +463,7 @@
464 463
         $INSTALL['showdownloadlangpack']   = false;
465 464
         $INSTALL['downloadlangpackerror']  = $downloaderror;
466 465
     }
467  
-}    
  466
+}
468 467
 
469 468
 
470 469
 
@@ -518,7 +517,7 @@
518 517
         fwrite($fh, $str);
519 518
         fclose($fh);
520 519
     }
521  
-        
  520
+
522 521
 
523 522
     $INSTALL['config'] = $str;
524 523
 }
@@ -569,7 +568,7 @@
569 568
 
570 569
     <tr>
571 570
         <td class="td_main" colspan="2">
572  
-    
  571
+
573 572
 <?php
574 573
 
575 574
 if (!empty($errormsg)) echo "<p class=\"errormsg\" align=\"center\">$errormsg</p>\n";
@@ -586,7 +585,7 @@
586 585
         echo "<tr>\n";
587 586
         echo "<td width=\"33.3%\">&nbsp;</td>\n";
588 587
         echo "<td width=\"33.3%\">&nbsp;</td>\n";
589  
-        echo "<td width=\"33.3%\" align=\"right\">\n";        
  588
+        echo "<td width=\"33.3%\" align=\"right\">\n";
590 589
         print_single_button("index.php", $options, get_string('continue')."  &raquo;");
591 590
         echo "</td>\n";
592 591
         echo "</tr>\n";
@@ -594,16 +593,16 @@
594 593
 
595 594
     } else {
596 595
         echo "<p class=\"errormsg\">".get_string('configfilenotwritten', 'install')."</p>";
597  
-        
  596
+
598 597
         echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n";
599 598
         echo "<tr>\n";
600 599
         echo "<td width=\"33.3%\">&nbsp;</td>\n";
601  
-        echo "<td width=\"33.3%\" align=\"center\">\n";        
  600
+        echo "<td width=\"33.3%\" align=\"center\">\n";
602 601
         $installoptions = array();
603  
-        $installoptions['download'] = 1; 
  602
+        $installoptions['download'] = 1;
604 603
         print_single_button("install.php", $installoptions, get_string('download', 'install'));
605 604
         echo "</td>\n";
606  
-        echo "<td width=\"33.3%\" align=\"right\">\n";        
  605
+        echo "<td width=\"33.3%\" align=\"right\">\n";
607 606
         print_single_button("index.php", $options, get_string('continue')."  &raquo;");
608 607
         echo "</td>\n";
609 608
         echo "</tr>\n";
@@ -641,7 +640,7 @@
641 640
 
642 641
 
643 642
 
644  
-<?php 
  643
+<?php
645 644
 
646 645
 //==========================================================================//
647 646
 
@@ -690,7 +689,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
690 689
             break;
691 690
         case COMPATIBILITY: /// Compatibilty check
692 691
             $compatsuccess = true;
693  
-            
  692
+
694 693
             /// Check that PHP is of a sufficient version
695 694
             print_compatibility_row(inst_check_php_version(), get_string('phpversion', 'install'), get_string('phpversionerror', 'install'), 'phpversionhelp');
696 695
             /// Check session auto start
@@ -699,7 +698,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
699 698
             print_compatibility_row(!ini_get_bool('magic_quotes_runtime'), get_string('magicquotesruntime', 'install'), get_string('magicquotesruntimeerror', 'install'), 'magicquotesruntimehelp');
700 699
             /// Check unsupported PHP configuration
701 700
             print_compatibility_row(ini_get_bool('magic_quotes_gpc') || (!ini_get_bool('register_globals')), get_string('globalsquotes', 'install'), get_string('globalsquoteserror', 'install'), 'globalsquoteshelp');
702  
-            /// Check safe mode 
  701
+            /// Check safe mode
703 702
             print_compatibility_row(!ini_get_bool('safe_mode'), get_string('safemode', 'install'), get_string('safemodeerror', 'install'), 'safemodehelp', true);
704 703
             /// Check file uploads
705 704
             print_compatibility_row(ini_get_bool('file_uploads'), get_string('fileuploads', 'install'), get_string('fileuploadserror', 'install'), 'fileuploadshelp', true);
@@ -838,7 +837,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
838 837
                         print_single_button('install.php', $options, get_string('downloadlanguagebutton','install', $languages[$INSTALL['language']]), 'POST');
839 838
                         print_simple_box_end();
840 839
                     } else {
841  
-                /// Show result info 
  840
+                /// Show result info
842 841
                     /// English lang packs aren't downloaded
843 842
                         if (substr($INSTALL['language'],0,2) == 'en') {
844 843
                             print_simple_box(get_string('downloadlanguagenotneeded', 'install', $languages[$INSTALL['language']]), 'center', '80%');
@@ -888,7 +887,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
888 887
         </td>
889 888
 
890 889
     </tr>
891  
-    
  890
+
892 891
     </table>
893 892
 <?php
894 893
     if (!$needtoopenform) {
@@ -937,7 +936,7 @@ function install_helpbutton($url, $title='') {
937 936
     echo "onClick=\"return window.open('$url', 'Help', 'menubar=0,location=0,scrollbars,resizable,width=500,height=400')\">";
938 937
     echo "</a>\n";
939 938
 }
940  
-    
  939
+
941 940
 
942 941
 
943 942
 //==========================================================================//
@@ -1036,7 +1035,7 @@ function css_styles() {
1036 1035
 <style type="text/css">
1037 1036
 
1038 1037
     body { background-color: #ffeece; }
1039  
-    p, li, td { 
  1038
+    p, li, td {
1040 1039
         font-family: helvetica, arial, sans-serif;
1041 1040
         font-size: 10pt;
1042 1041
     }
@@ -1113,6 +1112,18 @@ function css_styles() {
1113 1112
         font-size: 10pt;
1114 1113
         border-color: #ffc85f;
1115 1114
     }
  1115
+    table.environmenttable .error {
  1116
+        background-color : red;
  1117
+        color : inherit;
  1118
+    }
  1119
+
  1120
+    table.environmenttable .warn {
  1121
+        background-color : yellow;
  1122
+    }
  1123
+
  1124
+    table.environmenttable .ok {
  1125
+        background-color : lightgreen;
  1126
+    }
1116 1127
     .header {
1117 1128
         background-color: #fee6b9;
1118 1129
         font-size: 10pt;

0 notes on commit d8e68c5

Please sign in to comment.
Something went wrong with that request. Please try again.