momo            Tue Jul 29 06:07:47 2003 EDT

  Modified files:              
    /phpdoc/scripts/rtlpatch    HtmlExtParser.class.php 
  Log:
  1. better varnames
  2. warnnings
  
Index: phpdoc/scripts/rtlpatch/HtmlExtParser.class.php
diff -u phpdoc/scripts/rtlpatch/HtmlExtParser.class.php:1.11 
phpdoc/scripts/rtlpatch/HtmlExtParser.class.php:1.12
--- phpdoc/scripts/rtlpatch/HtmlExtParser.class.php:1.11        Mon Jul 28 06:39:19 
2003
+++ phpdoc/scripts/rtlpatch/HtmlExtParser.class.php     Tue Jul 29 06:07:47 2003
@@ -16,7 +16,7 @@
   | Authors:    Moshe Doron <[EMAIL PROTECTED]>                                 |
   +----------------------------------------------------------------------+
   
- $Id: HtmlExtParser.class.php,v 1.11 2003/07/28 10:39:19 momo Exp $
+ $Id: HtmlExtParser.class.php,v 1.12 2003/07/29 10:07:47 momo Exp $
 */
 
 class CHtmlExtParse extends CHtmlParse{
@@ -97,9 +97,23 @@
                do{
                        if($tmp = 
$this->get_element_id_by_rule(array("tag"=>"tt","properties"=>array("class","varname"),"offset"=>($tmp+1)))){
                                $this->ATE[$tmp]["dir"] = "ltr";
+                               //if varname not before punctuation marks, add &nbsp; 
to eliminate the align issue came with dir=rtl:
+                               if(isset($this->ATE[$tmp+3]["data"]{0})){
+                                       $ord = ord($this->ATE[$tmp+3]["data"]{0});
+                                       
if($ord>65||$ord==32||$ord==40||$ord==41){//without (all the punctuation marks whitout 
space, and brackets).
+                                               $this->ATE[$tmp]["chaintoclose"] = 
"&nbsp;";
+                                       }
+                               }
                        }
                } while($tmp);
                
+               //fix warnning boxes:
+               if($tmp = 
$this->get_element_id_by_rule(array("tag"=>"div","properties"=>array("class","warning"),"offset"=>(0)))){
+                       $cond = 
array("tag"=>"td","properties"=>array("align","LEFT"),"offset"=>($tmp+1));
+                       if (($td = $this->get_element_id_by_rule($cond)) && 
($td<$tocend = $this->ECE[$tmp])){
+                               $this->ATE[$td]["align"] = "right";
+                       }
+               }
                
                //fix for TOC
                if($tmp = 
$this->get_element_id_by_rule(array("tag"=>"div","properties"=>array("class","TOC"),"offset"=>(0)))){
@@ -151,14 +165,15 @@
                        if($tg>9)  {
                                $tag = $EHType[$tg];
                                $ret[$a] .= "<$tag";
-                               $chaintoend="";
+                               $chaintoend = $chaintoclose = "";
                                foreach ($this->ATE[$a] as $key=>$value){
                                        if($key == "chaintoend") $chaintoend = $value;
+                                       else if ($key == "chaintoclose") $chaintoclose 
= $value;
                                        else $ret[$a].=" $key=\"$value\"";
                                }
                                $ret[$a].=">$chaintoend";
                                
-                               if($this->ECE[$a]!=$a) $ret[$this->ECE[$a]] .= " 
</$tag>";
+                               if($this->ECE[$a]!=$a) $ret[$this->ECE[$a]] .= " 
</$tag>$chaintoclose";
                        } else if($tg == __HTML_PROCESS__){
                                        $ret[$a].="<".$this->ATE[$a]["data"]. "\n?>";
                        } else if($tg < __HTML_UNKNOWN__){



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to