View.php
[Pman.Ftp] / View.php
index 0e4e5da..a89c2a1 100644 (file)
--- a/View.php
+++ b/View.php
@@ -6,7 +6,7 @@ class Pman_Ftp_View extends Pman_Ftp_List
 {
     //getAuth = covered by list
     
-    function get($v)
+    function get($v = '',  $opts = array())
     {
         
         $ext = pathinfo($_SERVER['PATH_INFO'], PATHINFO_EXTENSION);
@@ -35,18 +35,21 @@ class Pman_Ftp_View extends Pman_Ftp_List
                 $matches = array();
                 if (preg_match('#^\s*<\?xml.*encoding="([^"]+)"#mi', $fc, $matches)) {
                     $fc = iconv($matches[1], "UTF8//IGNORE", $fc);
-                    @dl('tidy');
-                    echo $tidy;
-                    //if (class_exists('Tidy')) {
-                        $tidy = new Tidy();
-                        $tidy->parseString($fc, array('indent'=>true), 'utf8');
-                        $tidy->cleanRepair();
-                        $fc = $tidy->toString();
+                   
                     //}
                 }
-
-            
-            
+                if ($mt == 'application/xml') {
+                     //dl('tidy');
+                        
+                //if (class_exists('Tidy')) {
+                    $tidy = new Tidy();
+                    
+                    
+                    $tidy->parseString($fc, array('indent'=>true,'output-xml' => true,'input-xml' => true), 'utf8');
+                   // $tidy->cleanRepair();
+                    $fc = (string)$tidy;
+                    
+                }    
                 echo '<PRE>'. htmlspecialchars($fc) . '</PRE>';
                 exit;