\n"; //echo "\n"; // Get the noderange $noderange = @$_REQUEST['noderange']; //echo "
noderange=$noderange.
\n"; if (empty($noderange)) { echo "Select one or more groups or nodes.
\n"; exit; } // Get the attributes $xml = docmd('lsdef',NULL,array($noderange,'-t','node','-l')); //echo ""; print_r($xml); echo "
\n"; $errors = array(); if (getXmlErrors($xml,$errors)) { echo "lsdef failed: ", implode(' ',$errors), "
\n"; exit; } // Process the lsdef output to get column headers and attributes for each node $headers = array(); $attrs = array(); //echo "";
foreach ($xml->children() as $response) foreach ($response->children() as $k => $v) {
$line = (string)$v; // we assume $k is info
//echo "$line
";
if (preg_match('/^\s$/', $line)) { continue; } // ignore blank line
$matches = array();
if (preg_match('/^Object name:\s*(.*)$/', $line, $matches)) {
$nodename = $matches[1]; // all the attributes following will be for this node until we hit another line like this
$attrs[$nodename] = array();
//echo "
New node: $nodename.
\n"; continue; } // If we get here, the line is just attr=val list($key, $value) = preg_split('/\s*=\s*/', $line, 2); //echo "$key = $value.
\n"; $attrs[$nodename][$key] = $value; $headers[$key] = 1; } //echo "\n"; // Now display the table with the data we gathered echo "\n"; echo "\n"; //insertNotDoneYet(); ?>