Changeset 1080 in svn for trunk/htdocs/cacher/index.php


Ignore:
Timestamp:
2012-07-29T09:01:58+02:00 (3 years ago)
Author:
Xuefer
Message:

htdocs: improve phpinfo looking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/cacher/index.php

    r1078 r1080  
    128128    $moduleInfo = array();
    129129    foreach ($m[1] as $i => $dummy) {
    130         $moduleInfo[] = '<h3>' . trim($m[1][$i]) . '</h3>';
    131         $moduleInfo[] = str_replace('<br />', '', trim($m[2][$i]));
     130        $caption = trim($m[1][$i]);
     131        $info = str_replace('<br />', '', trim($m[2][$i]));
     132
     133        $regex = '!<table[^>]*>!';
     134        if (preg_match($regex, $info)) {
     135            $moduleInfo[] = preg_replace($regex, "\\0<caption>$caption</caption>", $info, 1);
     136        }
     137        else {
     138            $moduleInfo[] = "<h3>$caption</h3>";
     139            $moduleInfo[] = $info;
     140        }
    132141    }
    133142    return implode('', $moduleInfo);
Note: See TracChangeset for help on using the changeset viewer.