Updated version for 2.3beta
[fa-stable.git] / admin / system_diagnostics.php
index 44cd37ce5506dcef34a2fe73832018386f11bb8e..e1d8961863077e6b74df8a78e7025b11485d0216 100644 (file)
@@ -114,7 +114,7 @@ function tst_debug()
        $test['type'] = 0;
        $test['test'] = $go_debug ? _("Yes") : _("No");
        $test['result'] = $go_debug != 0;
-       $test['comments'] = _('To switch debugging on set $go_debug=1 in config.php file');
+       $test['comments'] = _('To switch debugging on set $go_debug>1 in config.php file');
 
        return $test;
 }
@@ -190,6 +190,16 @@ function tst_subdirs()
                        if (!is_dir($spath) || !is_writable($spath) ) {
                                $test['result'] = false;
                                $test['comments'][] = sprintf(_("'%s' is not writeable"), $spath);
+                       } else {
+                               $dir = opendir($spath);
+                               while (false !== ($fname = readdir($dir))) {
+                                       // check only *.js files. Manually installed package can contain other
+                                       // non-writable files which are non-crucial for normal operations
+                                       if (preg_match('/.*(\.js)/', $fname) && !is_writable("$spath/$fname")) {
+                                               $test['result'] = false;
+                                               $test['comments'][] = sprintf(_("'%s' is not writeable"), "$spath/$fname");
+                                       }
+                               }
                        }
                }
        }
@@ -297,7 +307,7 @@ function tst_extconfig()
 }
 //-------------------------------------------------------------------------------------------------
 
-start_table("$table_style width=80%");
+start_table(TABLESTYLE, "width=80%");
 $th = array(_("Test"), _('Test type'), _("Value"), _("Comments"));
 table_header($th);
 
@@ -316,7 +326,11 @@ foreach ($system_tests as $test)
 
     $comm = is_array(@$result['comments']) ? implode('<br>', $result['comments']) 
                : @$result['comments'];
-    label_cell($result['result'] ? _('Ok') : '<b>'.$comm.'</b>');
+       $color = ($result['result'] ? 'green': 
+       ($result['type']==3 ? 'red' :
+        ($result['type']==2 ? 'orange' : 'green')));
+    label_cell("<span style='color:$color'>".
+       ($result['result'] ? _('Ok') : '<b>'.$comm.'</b>').'</span>');
     end_row();
 }