From: moodler Date: Fri, 15 Sep 2006 08:59:02 +0000 (+0000) Subject: Bringing phpinfo into the fold X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6a12bc4836a2985cc0d6a65b61973a9182ad3177;p=moodle.git Bringing phpinfo into the fold --- diff --git a/admin/phpinfo.php b/admin/phpinfo.php index 8db0fcc805..eed8350553 100644 --- a/admin/phpinfo.php +++ b/admin/phpinfo.php @@ -2,36 +2,31 @@ // phpinfo.php - shows phpinfo for the current server require_once("../config.php"); + require_once($CFG->libdir.'/adminlib.php'); - $topframe = optional_param('topframe', false, PARAM_BOOL); - $bottomframe = optional_param('bottomframe', false, PARAM_BOOL); + $adminroot = admin_get_root(); + admin_externalpage_setup('phpinfo', $adminroot); require_login(); require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID)); - if (!$topframe && !$bottomframe) { - ?> - - - PHP info - - - - - - - - shortname: phpinfo", "$site->fullname", - "framename\" href=\"index.php\">$stradministration -> PHP info"); - exit; - } else if ($bottomframe && confirm_sesskey()) { - phpinfo(); - exit; - } + admin_externalpage_print_header($adminroot); + + echo '
'; + + ob_start(); + phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES); + $html = ob_get_contents(); + ob_end_clean(); + + $html = preg_replace('#(\n?]*?>.*?]*?>)|(\n?]*?/>)#is', '', $html); + $html = preg_replace('#(\n?]*?>.*?]*?>)|(\n?]*?/>)#is', '', $html); + + echo $html; + + echo '
'; + + admin_externalpage_print_footer(); + ?> diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index d12514c71b..0215bc0138 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -763,3 +763,31 @@ body#mod-forum-index .generalbox .cell { font-size:0.8em; } + +/*** + *** Phpinfo display + ***/ +.phpinfo table { + border-collapse: collapse; +} +.phpinfo .center { + text-align: center; +} +.phpinfo .e, .v, .h { + border: 1px solid #000000; + font-size: 0.8em; + vertical-align: baseline; +} +.phpinfo .e { + background-color: #ccccff; + font-weight: bold; + color: #000000; +} +.phpinfo .h { + background-color: #9999cc; + font-weight: bold; color: #000000; +} +.phpinfo .v { + background-color: #cccccc; + color: #000000; +}