### Eclipse Workspace Patch 1.0 #P moodle-HEAD Index: lib/environmentlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/environmentlib.php,v retrieving revision 1.23 diff -u -r1.23 environmentlib.php --- lib/environmentlib.php 27 Apr 2007 17:43:03 -0000 1.23 +++ lib/environmentlib.php 19 Jun 2007 06:47:23 -0000 @@ -134,17 +134,27 @@ $strrestricted = get_string('restricted'); $strenvironmenterrortodo = get_string('environmenterrortodo', 'admin'); -/// Here we'll store all the feedback found - $feedbacktext = ''; -/// Table header - $table = new stdClass; - $table->head = array ($strname, $strinfo, $strreport, $strstatus); - $table->align = array ('center', 'center', 'left', 'center'); - $table->wrap = array ('nowrap', '', '', 'nowrap'); - $table->size = array ('10', 10, '100%', '10'); - $table->width = '90%'; - $table->class = 'environmenttable generaltable'; +/// Table headers + $servertable = new stdClass;//table for server checks + $servertable->head = array ($strname, $strinfo, $strreport, $strstatus); + $servertable->align = array ('center', 'center', 'left', 'center'); + $servertable->wrap = array ('nowrap', '', '', 'nowrap'); + $servertable->size = array ('10', 10, '100%', '10'); + $servertable->width = '90%'; + $servertable->class = 'environmenttable generaltable'; + + $serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array()); + + $othertable = new stdClass;//table for custom checks + $othertable->head = array ($strinfo, $strreport, $strstatus); + $othertable->align = array ('center', 'left', 'center'); + $othertable->wrap = array ('', '', 'nowrap'); + $othertable->size = array (10, '100%', '10'); + $othertable->width = '90%'; + $othertable->class = 'environmenttable generaltable'; + + $otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array()); /// Iterate over each environment_result $continue = true; @@ -214,34 +224,54 @@ /// Build the text $report = get_string($stringtouse, 'admin', $rec); + + /// Format error or warning line if ($errorline || $warningline) { - $styletoapply = $errorline? 'error':'warn'; - $type = ''.$type.''; - $info = ''.$info.''; - $report = ''.$report.''; - $status = ''.$status.''; + $messagetype = $errorline? 'error':'warn'; + } else { + $messagetype = 'ok'; } - /// Add the row to the table - $table->data[] = array ($type, $info, $report, $status); - ///Process the feedback if necessary + $status = ''.$status.''; + /// Here we'll store all the feedback found + $feedbacktext = ''; + ///Process the feedback if necessary if ($feedbackstr = $environment_result->getFeedbackStr()) { - $feedbacktext .= '
  • '.get_string($feedbackstr, 'admin').'
  • '; + $feedbacktext .= '

    '.get_string($feedbackstr, 'admin').'

    '; } ///Process the bypass if necessary if ($bypassstr = $environment_result->getBypassStr()) { - $feedbacktext .= '
  • '.get_string($bypassstr, 'admin').'
  • '; + $feedbacktext .= '

    '.get_string($bypassstr, 'admin').'

    '; } ///Process the restrict if necessary if ($restrictstr = $environment_result->getRestrictStr()) { - $feedbacktext .= '
  • '.get_string($restrictstr, 'admin').'
  • '; + $feedbacktext .= '

    '.get_string($restrictstr, 'admin').'

    '; + } + if ($feedbacktext) { + $report = $report .$feedbacktext; + } + /// Add the row to the table + + if ($environment_result->getPart() == 'custom_check'){ + $otherdata[$messagetype][] = array ($info, $report, $status); + + } else { + $serverdata[$messagetype][] = array ($type, $info, $report, $status); } } } + //put errors first in + $servertable->data = array_merge($serverdata['error'], $serverdata['warn'], $serverdata['ok']); + $othertable->data = array_merge($otherdata['error'], $otherdata['warn'], $otherdata['ok']); /// Print table - print_table($table); - + print_heading(get_string('serverchecks', 'admin')); + print_table($servertable); + if (count($othertable->data)){ + print_heading(get_string('customcheck', 'admin')); + print_table($othertable); + } + /// And feedback accumulated text if ($feedbacktext) { print_simple_box('', 'center', '90%', '', '', 'environmentbox generalbox'); Index: theme/standard/styles_color.css =================================================================== RCS file: /cvsroot/moodle/moodle/theme/standard/styles_color.css,v retrieving revision 1.135 diff -u -r1.135 styles_color.css --- theme/standard/styles_color.css 14 Jun 2007 16:08:29 -0000 1.135 +++ theme/standard/styles_color.css 19 Jun 2007 06:47:23 -0000 @@ -361,6 +361,18 @@ background-color: #aaffaa; } +body#admin-environment .error { + background-color : red; + color : inherit; +} + +body#admin-environment .warn { + background-color : yellow; +} + +body#admin-environment .ok { + background-color : lightgreen; +} /*** *** Blocks Index: lang/en_utf8/admin.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/admin.php,v retrieving revision 1.127 diff -u -r1.127 admin.php --- lang/en_utf8/admin.php 18 Jun 2007 19:43:10 -0000 1.127 +++ lang/en_utf8/admin.php 19 Jun 2007 06:47:22 -0000 @@ -1,4 +1,4 @@ -cron.php maintenance script has not been run for at least 24 hours.'; $string['curlrecommended'] = 'Installing the optional Curl library is highly recommended in order to enable Moodle Networking functionality.'; +$string['customcheck'] = 'Other Checks'; $string['datarootsecuritywarning'] = 'Your site configuration might not be secure. Please make sure that your dataroot directory ($a) is not directly accessible via web.'; $string['dbmigrate'] = 'Moodle Database Migration'; $string['dbmigrateconnecerror'] = 'Could not connect to the database specified.'; @@ -524,6 +525,7 @@ $string['secureforms'] = 'Use additional form security'; $string['security'] = 'Security'; $string['server'] = 'Server'; +$string['serverchecks'] = 'Server Checks'; $string['serverlimit'] = 'Server Limit'; $string['sessioncookie'] = 'Cookie prefix'; $string['sessioncookiepath'] = 'Cookie path';