[PHP-DOC] cvs: phpdoc /chm make_chm_fancy.php

2003-07-11 Thread Hadar Porat
hadar_p Fri Jul 11 06:19:35 2003 EDT

  Modified files:  
/phpdoc/chm make_chm_fancy.php 
  Log:
  Another hebrew change
  
Index: phpdoc/chm/make_chm_fancy.php
diff -u phpdoc/chm/make_chm_fancy.php:1.8 phpdoc/chm/make_chm_fancy.php:1.9
--- phpdoc/chm/make_chm_fancy.php:1.8   Mon Jun 23 05:29:34 2003
+++ phpdoc/chm/make_chm_fancy.php   Fri Jul 11 06:19:35 2003
@@ -85,12 +85,21 @@
 // HR dropout
 $content = preg_replace(/HR\\s+ALIGN=\LEFT\\\s+WIDTH=\100%\/, '', 
$content);
 
+   if($LANGUAGE == he) {
+// Whole page table and backgrounds
+$wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0 DIR=RTLTRTD COLSPAN=3';
+$bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100% DIR=RTL';
+$lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
+$space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
+   }
+   else {
 // Whole page table and backgrounds
 $wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0TRTD COLSPAN=3';
 $bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100%';
 $lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
 $space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
-
+   }
+   
 // Navheader backgound
 $content = 
preg_replace(/DIV\\s+CLASS=\NAVHEADER\\\s*TABLE(.*)CELLPADDING=\0\(.*)\\/TABLE\\s*\\/DIV\\s*/Us,
 $wpbegin . 'DIV CLASS=NAVHEADER' . $bnavt . 
'TRTDTABLE\\1CELLPADDING=3\\2/TABLE/TD/TR' . $lnavt . 
'/TABLE/DIV/TD/TRTRTD' . $space . '/TDTD HEIGHT=100% VALIGN=TOP 
WIDTH=100%BR', $content);
@@ -186,12 +195,20 @@
}
} while($tmp);

+   if($LANGUAGE == he) {
+   // Whole page table and backgrounds
+$wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0 DIR=RTLTRTD COLSPAN=3';
+$bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100% DIR=RTL';
+$lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
+$space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
+   }
+   else {
 // Whole page table and backgrounds
 $wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0TRTD COLSPAN=3';
 $bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100%';
 $lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
 $space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
-
+   }
 // Navheader backgound
 if($tmp = 
$tree-get_element_id_by_rule(array(tag=div,properties=array(class,NAVHEADER{
$tree-ATE[$tmp][data] = $wpbeginDIV 
CLASS=\NAVHEADER\$bnavtTRTD;



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



[PHP-DOC] cvs: phpdoc /chm make_chm_fancy.php

2003-07-11 Thread Moshe Doron
momoFri Jul 11 10:50:26 2003 EDT

  Modified files:  
/phpdoc/chm make_chm_fancy.php 
  Log:
   proper revert Hadar patch
  
Index: phpdoc/chm/make_chm_fancy.php
diff -u phpdoc/chm/make_chm_fancy.php:1.10 phpdoc/chm/make_chm_fancy.php:1.11
--- phpdoc/chm/make_chm_fancy.php:1.10  Fri Jul 11 10:47:16 2003
+++ phpdoc/chm/make_chm_fancy.php   Fri Jul 11 10:50:26 2003
@@ -1,15 +1,21 @@
 ?php
 
 /* 
- PLEASE DO NOT MAKE ANY MAJOR MODIFICATIONS TO THIS CODE!
- There is a new script collection on the way to replace
- these scripts. Please be patient while it will be ready
- to put here in CVS.
+PLEASE DO NOT MAKE ANY MAJOR MODIFICATIONS TO THIS CODE!
+There is a new script collection on the way to replace
+these scripts. Please be patient while it will be ready
+to put here in CVS.
 */
 
 include_once('common.php');
 include_once('chm_settings.php');
 
+if($LANGUAGE == he) {
+include_once(./scripts/rtlpatch/HtmlParser.class.php);
+include_once(./scripts/rtlpatch/HtmlExtParser.class.php);
+
+}
+
 // This script takes much time to run
 set_time_limit(0);
 
@@ -23,7 +29,11 @@
 $handle = opendir($HTML_PATH);
 while (false !== ($filename = readdir($handle))) {
 if (strpos($filename, .html)  ($filename != fancy-index.html)) {
-fancy_design($filename);
+if($LANGUAGE == he) {
+fancy_parser_design($filename);
+} else {
+fancy_design($filename);
+}
 }
 }
 closedir($handle);
@@ -131,5 +141,119 @@
 $counter++;
 
 } // fancy_design() function end
+
+
+// Convert one file from HTML = fancy HTML using CHtmlParser
+function fancy_parser_design($fname)
+{
+global $HTML_PATH, $FANCY_PATH, $LANGUAGE, $LANGUAGES, $counter, $original_index, 
$publication_date;
+
+global $EHType,$HEType;
+
+// Get the contents of the file from $HTML_PATH
+//TODO: iconv stuff, for when charset element  byte
+$content = file_get_contents($HTML_PATH/$fname);
+$tree = new CHtmlExtParse($content);
+
+// CSS file linking
+$head = $HEType[head];
+if(isset($tree-EBT[$head][0]))
+$tree-ATE[$tree-EBT[$head][0]][chaintoend] = 'LINK REL=stylesheet 
HREF=style.css';
+
+// Charset:
+$meta = $HEType[meta];
+if(isset($tree-EBT[$meta])){
+for($a=0;$acount($tree-EBT[$meta]);$a++){
+$elem = $tree-ATE[$tree-EBT[$meta][$a]];
+if(isset($elem[http-equiv])  $elem[http-equiv]==Content-type)
+$elem[content] = text/html; 
{$LANGUAGES[$LANGUAGE]['mime_charset_name']};
+}
+}
+
+// No margins around
+$body = $HEType[body];
+if(isset($tree-EBT[$body][0])){
+$tree-ATE[$tree-EBT[$body][0]][TOPMARGIN] =0;
+$tree-ATE[$tree-EBT[$body][0]][LEFTMARGIN] =0;
+}
+
+
+// HR dropout
+$tmp=0;
+do{
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=hr,properties=array(align,LEFT,width,100%),offset=($tmp+1{
+$tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+}
+} while($tmp);
+
+// Whole page table and backgrounds
+$wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0TRTD COLSPAN=3';
+$bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100%';
+$lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
+$space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
+
+// Navheader backgound
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=div,properties=array(class,NAVHEADER{
+$tree-ATE[$tmp][data] = $wpbeginDIV CLASS=\NAVHEADER\$bnavtTRTD;
+$tree-ATE[$tree-ECE[$tmp]][data] = 
/TD/TR$lnavt/TABLE/DIV/TD/TRTRTD$space/TDTD HEIGHT=\100%\ 
VALIGN=\TOP\ WIDTH=\100%\BR;
+$tree-ATE[$tmp+1][cellpadding] = 3;
+$tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+}
+
+// Navfooter backgound
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=div,properties=array(class,NAVFOOTER{
+$tree-ATE[$tmp][data] = BR/TDTD$space/TD/TRTRTD 
COLSPAN=\3\DIV CLASS=\NAVFOOTER\{$bnavt}{$lnavt}TRTD;
+$tree-ATE[$tree-ECE[$tmp]][data] = 
/TD/TR/TABLE/DIV/TD/TR/TABLE;
+$tree-ATE[$tmp+1][cellpadding] = 3;
+$tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+}
+
+// Fix copyright page fault...
+if ($fname == copyright.html) {
+// it just looks that no more need to fix the copyright.
+}
+
+// Fix the original manual index to look far better...
+elseif ($fname == $original_index) {
+// Find out manual generation date
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=p,properties=array(class,pubdate{
+$publication_date = $tree-ATE[$tmp+1][data];
+} else {
+$publication_date = 'n/a';
+}
+
+
+ // Modify the index file to meet our needs
+$tmp = 

[PHP-DOC] cvs: phpdoc /chm make_chm_fancy.php

2003-06-23 Thread Moshe Doron
momoMon Jun 23 05:29:34 2003 EDT

  Modified files:  
/phpdoc/chm make_chm_fancy.php 
  Log:
  fancy the hebrew
  
Index: phpdoc/chm/make_chm_fancy.php
diff -u phpdoc/chm/make_chm_fancy.php:1.7 phpdoc/chm/make_chm_fancy.php:1.8
--- phpdoc/chm/make_chm_fancy.php:1.7   Sun May 11 22:46:12 2003
+++ phpdoc/chm/make_chm_fancy.php   Mon Jun 23 05:29:34 2003
@@ -10,6 +10,12 @@
 include_once('common.php');
 include_once('chm_settings.php');
 
+if($LANGUAGE == he) {
+   include_once(./scripts/rtlpatch/HtmlParser.class.php);
+   include_once(./scripts/rtlpatch/HtmlExtParser.class.php);
+   
+}
+
 // This script takes much time to run
 set_time_limit(0);
 
@@ -23,7 +29,11 @@
 $handle = opendir($HTML_PATH);
 while (false !== ($filename = readdir($handle))) {
 if (strpos($filename, .html)  ($filename != fancy-index.html)) {
-fancy_design($filename);
+if($LANGUAGE == he) {
+   fancy_parser_design($filename);
+} else {
+   fancy_design($filename);
+}
 }
 }
 closedir($handle);
@@ -131,5 +141,119 @@
 $counter++;
 
 } // fancy_design() function end
+
+
+// Convert one file from HTML = fancy HTML using CHtmlParser
+function fancy_parser_design($fname)
+{
+global $HTML_PATH, $FANCY_PATH, $LANGUAGE, $LANGUAGES, $counter, $original_index, 
$publication_date;
+   
+global $EHType,$HEType;
+
+// Get the contents of the file from $HTML_PATH
+//TODO: iconv stuff, for when charset element  byte
+$content = file_get_contents($HTML_PATH/$fname);
+   $tree = new CHtmlExtParse($content);
+   
+   // CSS file linking
+   $head = $HEType[head];
+   if(isset($tree-EBT[$head][0]))
+   $tree-ATE[$tree-EBT[$head][0]][chaintoend] = 'LINK 
REL=stylesheet HREF=style.css';
+   
+   // Charset:
+   $meta = $HEType[meta];
+   if(isset($tree-EBT[$meta])){
+   for($a=0;$acount($tree-EBT[$meta]);$a++){
+   $elem = $tree-ATE[$tree-EBT[$meta][$a]];
+   if(isset($elem[http-equiv])  
$elem[http-equiv]==Content-type)
+   $elem[content] = text/html; 
{$LANGUAGES[$LANGUAGE]['mime_charset_name']};
+   }
+   }
+   
+// No margins around
+$body = $HEType[body];
+   if(isset($tree-EBT[$body][0])){
+   $tree-ATE[$tree-EBT[$body][0]][TOPMARGIN] =0;
+   $tree-ATE[$tree-EBT[$body][0]][LEFTMARGIN] =0;
+   }
+   
+   
+// HR dropout
+$tmp=0;
+   do{
+   if($tmp = 
$tree-get_element_id_by_rule(array(tag=hr,properties=array(align,LEFT,width,100%),offset=($tmp+1{
+   $tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+   }
+   } while($tmp);
+   
+// Whole page table and backgrounds
+$wpbegin = 'TABLE BORDER=0 WIDTH=100% HEIGHT=100% CELLSPACING=0 
CELLPADDING=0TRTD COLSPAN=3';
+$bnavt = 'TABLE BGCOLOR=#FF BORDER=0 CELLPADDING=0 CELLSPACING=0 
WIDTH=100%';
+$lnavt = 'TR BGCOLOR=#66TDIMG SRC=spacer.gif BORDER=0 WIDTH=1 
HEIGHT=1BR/TD/TR';
+$space = 'IMG SRC=spacer.gif WIDTH=10 HEIGHT=1';
+
+// Navheader backgound
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=div,properties=array(class,NAVHEADER{
+   $tree-ATE[$tmp][data] = $wpbeginDIV 
CLASS=\NAVHEADER\$bnavtTRTD;
+   $tree-ATE[$tree-ECE[$tmp]][data] = 
/TD/TR$lnavt/TABLE/DIV/TD/TRTRTD$space/TDTD HEIGHT=\100%\ 
VALIGN=\TOP\ WIDTH=\100%\BR;
+   $tree-ATE[$tmp+1][cellpadding] = 3;
+   $tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+   }
+
+   // Navfooter backgound
+if($tmp = 
$tree-get_element_id_by_rule(array(tag=div,properties=array(class,NAVFOOTER{
+   $tree-ATE[$tmp][data] = BR/TDTD$space/TD/TRTRTD 
COLSPAN=\3\DIV CLASS=\NAVFOOTER\{$bnavt}{$lnavt}TRTD;
+   $tree-ATE[$tree-ECE[$tmp]][data] = 
/TD/TR/TABLE/DIV/TD/TR/TABLE;
+   $tree-ATE[$tmp+1][cellpadding] = 3;
+   $tree-change_tag_type($tmp,__HTML_FREE_ENGLISH__);
+   }
+   
+// Fix copyright page fault...
+if ($fname == copyright.html) {
+   // it just looks that no more need to fix the copyright.
+}
+
+// Fix the original manual index to look far better...
+elseif ($fname == $original_index) {
+   // Find out manual generation date
+   if($tmp = 
$tree-get_element_id_by_rule(array(tag=p,properties=array(class,pubdate{
+   $publication_date = $tree-ATE[$tmp+1][data];
+   } else {
+$publication_date = 'n/a';
+}
+   
+
+ // Modify the index file to meet our needs
+$tmp = 
$tree-get_element_id_by_rule(array(tag=h1,properties=array(class,title)));
+   $tit = isset($tree-ATE[$tmp+2][data])?$tree-ATE[$tmp+2][data]:;
+   $tit2 =;
+   
+$tmp 

[PHP-DOC] cvs: phpdoc /chm make_chm_fancy.php

2002-03-17 Thread Derick Rethans

derick  Sun Mar 17 11:37:50 2002 EDT

  Modified files:  
/phpdoc/chm make_chm_fancy.php 
  Log:
  - Fix index pages for CHM
  
  
Index: phpdoc/chm/make_chm_fancy.php
diff -u phpdoc/chm/make_chm_fancy.php:1.1 phpdoc/chm/make_chm_fancy.php:1.2
--- phpdoc/chm/make_chm_fancy.php:1.1   Mon Jan  7 18:20:34 2002
+++ phpdoc/chm/make_chm_fancy.php   Sun Mar 17 11:37:49 2002
 -31,7 +31,9 
 // Look for CHM index file (snap-downloader, cvs-usr with/without lang-support) 
 if (false == ($content = join(, file(make_chm_index_$language.html {
 if (false == ($content = join(, 
file($language/make_chm_index_$language.html {
-$content = join(, file(en/make_chm_index_en.html));
+   if (false == ($content = join(, 
+@file($htmldir/../$language/make_chm_index_$language.html {
+   $content = join(, file(en/make_chm_index_en.html));
+   }
 }
 }