2007年12月28日 星期五

function ooo_mpfile($oo_path,$outfile,$func,$sn_arr,$ext_arr,$paging=true)
// $oo_path : source ooofile path
// $outfile : output file name without extension
// func : function for calculte $temp_arr
// $sn_arr : the paraments of func
// $ext_arr : external $temp_arr already exists
// $paging : per data send a page-break or not
  1. loading and copying files in $oo_path with content.xml
  2. split content.xml into $head, $body, $foot
  3. insert page-break style into $head if $paging is true
  4. foreach $sn in $sn_arr do {
  5. $temp = & call_user_func($func,$sn)
  6. temp_arr=arr_merge($temp,$ext_arr) if exists $ext_arr otherwize $temp_arr=$temp
  7. replace tags with $temp_arr into $new_body
  8. clear no values tags
  9. add page-break if $paging is true }
  10. output $head.$new_body.$foot as content.xml
  11. output ooofile.