Patch title: Release 86 bulk changes
Abstract:
File: /pliant/appli/forum.pli
Key:
    Removed line
    Added line
   
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/protocol/common/mime.pli"
module "/pliant/language/unsafe.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/fullpliant/user.pli"


method page browse_file f d patch path options
  arg_rw HtmlPage page ; arg_rw Data:Forum f ; arg CBool pat
  var CBool patched := (file_query (forum_path f d "/patch"+
  if patched
    file_header (forum_path f d "/patch"+path) (var FileInfo
  implicit page
    if (options option "view") or (options option "review") 
      var Str section := (shunt (options option "rejected") 
      patched := (file_query (forum_path f d section+path) s
      table columns 1 border 0
        cell color (color hsl 0 0 90)
          table columns 2 border 0
            cell [Patch title:]
            cell
              text d:title
            cell [Abstract:]
            cell
              table columns 1
                cell color (color hsl 60 10 80)
                  text d:abstract
            cell [File:]
            cell
              bold
                fixed text:path
            cell [Key:]
            cell
              table columns 2 border 0
                cell color (color hsl 0 25 80)
                  fixed [   ]
                cell
                  [Removed line]
                cell color (color hsl 120 25 80)
                  fixed [   ]
                cell
                  [Added line]
      if patched
        display_difference (forum_path f d section+path) (sh
      else
        head "<meta name=[dq]robots[dq] content=[dq]noindex,
        fixed
          (var Stream s0) open f:reference_path+(path 1 path
          while not s0:atend
            text s0:readline+"[lf]"
    eif options="edit" and patch
      if (patched and not binary) or file_is_ascii:path
        small
          bold text:path
          fixed [     ]
          if not patched
            new_info := file_query path standard
            text (string new_info:size)+" bytes last modifye
          eol
        var Stream s1
        if patched
          var Str temp := file_temporary
          file_extract_new (forum_path f d "/patch"+path) te
          s1 open temp in+safe
        else
          s1 open f:reference_path+(path 1 path:len) in+safe
        var Str all := ""
        while not s1:atend
          all += s1:readline+"[lf]"
        if patched
          file_delete temp
        text_input "" all columns 80 rows 35
        button "Update "+(path (path search_last "/" -1)+1 p
          var Str final := file_temporary
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/protocol/common/mime.pli"
module "/pliant/language/unsafe.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/fullpliant/user.pli"


method page browse_file f d patch path options
  arg_rw HtmlPage page ; arg_rw Data:Forum f ; arg CBool pat
  var CBool patched := (file_query (forum_path f d "/patch"+
  if patched
    file_header (forum_path f d "/patch"+path) (var FileInfo
  implicit page
    if (options option "view") or (options option "review") 
      var Str section := (shunt (options option "rejected") 
      patched := (file_query (forum_path f d section+path) s
      table columns 1 border 0
        cell color (color hsl 0 0 90)
          table columns 2 border 0
            cell [Patch title:]
            cell
              text d:title
            cell [Abstract:]
            cell
              table columns 1
                cell color (color hsl 60 10 80)
                  text d:abstract
            cell [File:]
            cell
              bold
                fixed text:path
            cell [Key:]
            cell
              table columns 2 border 0
                cell color (color hsl 0 25 80)
                  fixed [   ]
                cell
                  [Removed line]
                cell color (color hsl 120 25 80)
                  fixed [   ]
                cell
                  [Added line]
      if patched
        display_difference (forum_path f d section+path) (sh
      else
        head "<meta name=[dq]robots[dq] content=[dq]noindex,
        fixed
          (var Stream s0) open f:reference_path+(path 1 path
          while not s0:atend
            text s0:readline+"[lf]"
    eif options="edit" and patch
      if (patched and not binary) or file_is_ascii:path
        small
          bold text:path
          fixed [     ]
          if not patched
            new_info := file_query path standard
            text (string new_info:size)+" bytes last modifye
          eol
        var Stream s1
        if patched
          var Str temp := file_temporary
          file_extract_new (forum_path f d "/patch"+path) te
          s1 open temp in+safe
        else
          s1 open f:reference_path+(path 1 path:len) in+safe
        var Str all := ""
        while not s1:atend
          all += s1:readline+"[lf]"
        if patched
          file_delete temp
        text_input "" all columns 80 rows 35
        button "Update "+(path (path search_last "/" -1)+1 p
          var Str final := file_temporary
          (var Stream s2) open temp out+safe+mkdir
          (var Stream s2) open final out+safe+mkdir
          s2 writechars all
          s2 close
          if (file_query (forum_path f d "/patch"+path) stan
            var Str temp := file_temporary
            file_extract_old (forum_path f d "/patch"+path) 
            file_difference temp final (forum_path f d "/pat
            file_delete temp
          else
            file_difference f:reference_path+(path 1 path:le
          file_hook (forum_path f d "/patch"+path) 
          file_delete final
          d status := " "
          d update (forum_path f d "/")
          goto_backward
      else
        [This is a binary file !]
    eif options="download"
      if patched
        var Str temp := file_temporary
        file_extract_new (forum_path f d "/patch"+path) temp
      reset_http_answer
      http_request send_static_file (shunt patched temp f:re
      if patched
        file_delete temp
    eif options="delete" and patch
      [Are you sure that you want to delete file] ; fixed:(t
      button "yes" noeol
        file_delete (forum_path f d "/patch"+path)
        file_hook (forum_path f d "/patch"+path)
        goto_backward
      button "no"
        goto_backward
    else
      if patched
        var Str temp := file_temporary
        file_extract_new (forum_path f d "/patch"+path) temp
      var Str ext := forum_path f d "/patch"+path
      ext := ext (ext search_last "." ext:len) ext:len
      var Str mime := query_mime_type ext
      reset_http_answer
      http_request send_static_file (shunt patched temp f:re
      if patched
        file_delete temp





          s2 writechars all
          s2 close
          if (file_query (forum_path f d "/patch"+path) stan
            var Str temp := file_temporary
            file_extract_old (forum_path f d "/patch"+path) 
            file_difference temp final (forum_path f d "/pat
            file_delete temp
          else
            file_difference f:reference_path+(path 1 path:le
          file_hook (forum_path f d "/patch"+path) 
          file_delete final
          d status := " "
          d update (forum_path f d "/")
          goto_backward
      else
        [This is a binary file !]
    eif options="download"
      if patched
        var Str temp := file_temporary
        file_extract_new (forum_path f d "/patch"+path) temp
      reset_http_answer
      http_request send_static_file (shunt patched temp f:re
      if patched
        file_delete temp
    eif options="delete" and patch
      [Are you sure that you want to delete file] ; fixed:(t
      button "yes" noeol
        file_delete (forum_path f d "/patch"+path)
        file_hook (forum_path f d "/patch"+path)
        goto_backward
      button "no"
        goto_backward
    else
      if patched
        var Str temp := file_temporary
        file_extract_new (forum_path f d "/patch"+path) temp
      var Str ext := forum_path f d "/patch"+path
      ext := ext (ext search_last "." ext:len) ext:len
      var Str mime := query_mime_type ext
      reset_http_answer
      http_request send_static_file (shunt patched temp f:re
      if patched
        file_delete temp