Patch title: Release 94 bulk changes
Abstract:
File: /pliant/graphic/browser/naive/sample/filemanager.pli
Key:
    Removed line
    Added line
module "/pliant/language/unsafe.pli"
module "/pliant/graphic/browser/naive/server.pli"
module "/pliant/graphic/browser/naive/lib/all.pli"
module "/pliant/admin/file.pli"
module "/pliant/language/stream.pli"
module "editor.pli"

browser_page "/file/"
  ovar Str path := "file:/"+url_subpath
  if not allowed:"supervisor"
    window main
      text "Only the supervisor can browse or edit files." ; eol
    window left
      button "exit" key "alt x"
        url_return
    return
  if (path path:len-1 1)<>"/"
    text_editor path
    return
  ovar Array:FileInfo files
  ovar (Dictionary Str Void) selected
  ovar Str action := "enter"
  section "all" dynamic
    window top
      center
        bold
          text path
        eol
      section "parameters"
        void
    window left
      section "menu" dynamic
        para
          button "enter" key "alt e" selected action="enter"
            action := "enter"
            section_replay "menu"
            section_overwrite "parameters"
              void
            section_overwrite "help"
              text "Clic on the subdirectory you want to enter."
          eol
          button "exit" key "alt x"
            url_return
        para
          button "new" key "alt n" selected action="new"
            action := "new"
            section_replay "menu"
            section_overwrite "parameters"
              input "Name: " (ovar Str new_name) focus true
              button "create new file" key "alt f"
                (var Stream stream) open path+new_name out+safe ; stream close
                action := "enter"
                section_replay "all"
              button "create new directory" key "alt d"
                file_tree_create path+new_name+"/"
                action := "enter"
                section_replay "all"
              button "cancel" key "escape"
                action := "enter"
                section_overwrite "parameters"
                  void
                section_overwrite "help"
                  void
                section_replay "menu"
            section_overwrite "help"
              text "Please type in the name of the new file or directory."
          eol
          button "delete" key "alt d" selected action="delete"
            action := "delete"
            if selected:size<>0
              section_replay "all"
            section_replay "menu"
            section_overwrite "parameters"
              button "delete now" key "alt n"
                var Pointer:Void k :> selected first
                while exists:k
                  file_delete (selected key k)
                  k :> selected next k
                # each k selected
                #   file_delete (selected key k)
                action := "enter"
                section_replay "all"
              button "cancel" key "escape"
                action := "enter"
                section_overwrite "parameters"
                  void
                section_overwrite "help"
                  void
                section_replay "menu"
            section_overwrite "help"
              text "Select files and directories you want to delete, then clic on 'delete now'"
    window bottom
      section "help"
        void
    selected := var (Dictionary Str Void) empty_selection
    window main
      node "hook"
        hook
          table
            files := file_list path extended+directories+relative+sorted
            for (var Int i) 0 files:size-1
              node "file "+string:i
                row
                  if files:i:is_directory
                    cell
                      font color (color rgb 0 0 255)
                        node "name "+string:i
                          text files:i:name
                    cell
                      text "     "
                    cell
                      void
                    cell
                      text "     "
                    cell
                      void
                  else
                    cell
                      node "name "+string:i
                        text files:i:name
                    cell
                      text "     "
                    cell
                      text (string files:i:datetime)
                    cell
                      text "     "
                    cell
                      text (string files:i:size)
        event
          # console "event " event " key " key " at " focus_id eol
          var Str name
          if event="press" and key="button1" and (target_id parse word:"name" (var Int i)) and i>=0 and i<files:size
            name := path+files:i:name
          eif (event="press" or event="character") and (focus_id parse word:"name" (var Int i)) and i>=0 and i<files:size
            name := path+files:i:name
          else
            return
          if event="press" and (key="button1" or key="enter") and action="enter"
            url_call url_path+files:i:name
          if (event="press" and key="button1" or event="character" and key=" ") and action="delete"
            if not exists:(selected first name)
              selected insert name void
              node_attribute "file "+string:i "cell:color" string:(color rgb 255 192 192)
              node_draw "file "+string:i
            else
              selected remove (selected first name)
              node_attribute "file "+string:i "cell:color" ""
              node_draw "file "+string:i
            window bottom
              var Int count := selected size
              text string:count+" file"+(shunt count>1 "s" "")+" selected"
          if event="press"
            if key="down" and i+1<files:size
              focus_set "hook" "name "+(string i+1) 0 ""
            eif key="up" and i>0
              focus_set "hook" "name "+(string i-1) 0 ""
            eif key="escape"
              url_return
          eif event="character"
            part scan
              for (var Int i) 0 files:size-1
                if (files:i:name 0 1)=key
                  focus_set "hook" "name "+string:i 0 ""
                  leave scan
    focus_set "hook" "name 0" 0 ""