phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.xmltool.inc.php,1.3,1.4


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.xmltool.inc.php,1.3,1.4
Date: Tue, 01 Oct 2002 19:13:33 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv21089

Modified Files:
        class.xmltool.inc.php 
Log Message:
update to avoid linebreaks in output where they shouldnt be

Index: class.xmltool.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.xmltool.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.xmltool.inc.php       21 Sep 2002 06:55:50 -0000      1.3
--- class.xmltool.inc.php       1 Oct 2002 23:13:31 -0000       1.4
***************
*** 3,6 ****
--- 3,7 ----
        {
                $doc = new xmltool();
+               $doc->indentstring = '';
                return $doc->import_var($name,$data,True,True);
        }
***************
*** 19,23 ****
                var $attributes = Array();
                var $comments = Array();
!               var $indentstring = "  ";
                
                /* start the class as either a root or a node */
--- 20,24 ----
                var $attributes = Array();
                var $comments = Array();
!               var $indentstring = "\t";
                
                /* start the class as either a root or a node */
***************
*** 98,102 ****
                }
  
!               function get_node ($name = '')
                {
                        switch  ($this->data_type)
--- 99,103 ----
                }
  
!               function get_node ($name = '')  // what is that function doing: 
NOTHING !!!
                {
                        switch  ($this->data_type)
***************
*** 479,483 ****
                                        while(list($key,$val) = each 
($this->attributes))
                                        {
!                                               $result .= ' 
'.$key.'="'.$val.'"';
                                        }
                                }
--- 480,484 ----
                                        while(list($key,$val) = each 
($this->attributes))
                                        {
!                                               $result .= ' 
'.$key.'="'.htmlspecialchars($val).'"';
                                        }
                                }
***************
*** 501,517 ****
                                                        }
                                                        
!                                                       if(preg_match("(&|<)", 
$this->data))
                                                        {
                                                                $result .= 
'<![CDATA['.$this->data.']]>';
                                                                $endtag_indent 
= '';            
                                                        }
!                                                       
elseif(strlen($this->data) > 30)
                                                        {
!                                                               $result .= 
"\n".$indentstring.$this->indentstring.$this->data."\n";
                                                                $endtag_indent 
= $indentstring;
                                                        }
                                                        else
                                                        {
!                                                               $result .= 
$this->data;
                                                                $endtag_indent 
= '';
                                                        }
--- 502,518 ----
                                                        }
                                                        
!                                                       
/*if(preg_match("(&|<)", $this->data))  // this is unnecessary with 
htmlspecialchars($this->data)
                                                        {
                                                                $result .= 
'<![CDATA['.$this->data.']]>';
                                                                $endtag_indent 
= '';            
                                                        }
!                                                       
else*/if(strlen($this->data) > 30 && !empty($this->indentstring))
                                                        {
!                                                               $result .= 
"\n".$indentstring.$this->indentstring.htmlspecialchars($this->data)."\n";
                                                                $endtag_indent 
= $indentstring;
                                                        }
                                                        else
                                                        {
!                                                               $result .= 
htmlspecialchars($this->data);
                                                                $endtag_indent 
= '';
                                                        }
***************
*** 563,566 ****
--- 564,589 ----
                                return $result;
                        }
+               }
+       }
+ 
+       class xmlnode extends xmltool
+       {
+               function xmlnode($name)
+               {
+                       $this->xmltool('node',$name);
+               }
+       }
+ 
+       class xmldoc extends xmltool
+       {
+               function xmldoc($version = '1.0')
+               {
+                       $this->xmltool('root');
+                       $this->set_version($version);
+               }
+ 
+               function add_root($root_node)
+               {
+                       return $this->add_node($root_node);
                }
        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]