~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to web/cgi/alpine/1.0/fr_resume.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2010-10-03 15:31:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101003153155-2exypc96j1e8tw0p
Tags: 2.02-1
* New upstream release, based on re-alpine project
* Updated debian/copyright to reflect this fact
* re-alpine removed the non-free from the tarball, so now
  we do not repack the upstream tarball. (Yay!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: fr_resume.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
 
2
# ========================================================================
 
3
# Copyright 2006 University of Washington
 
4
#
 
5
# Licensed under the Apache License, Version 2.0 (the "License");
 
6
# you may not use this file except in compliance with the License.
 
7
# You may obtain a copy of the License at
 
8
#
 
9
#     http://www.apache.org/licenses/LICENSE-2.0
 
10
#
 
11
# ========================================================================
 
12
 
 
13
#  fr_resume.tcl
 
14
#
 
15
#  Purpose:  CGI script to generate frame set for resume composition form
 
16
#            in webpine-lite pages.  the idea is that this
 
17
#            page specifies a frameset that loads a "header" page 
 
18
#            used to keep the servlet alive via
 
19
#            periodic reloads and a "body" page containing static/form
 
20
#            elements that can't/needn't be periodically reloaded or
 
21
#            is blocked on user input.
 
22
 
 
23
#  Input:
 
24
set frame_vars {
 
25
  {oncancel     ""      main}
 
26
}
 
27
 
 
28
#  Output:
 
29
#
 
30
 
 
31
## read vars
 
32
foreach item $frame_vars {
 
33
  if {[catch {cgi_import [lindex $item 0].x}]} {
 
34
    if {[catch {eval WPImport $item} errstr]} {
 
35
      error [list _action "Impart Variable" $errstr]
 
36
    }
 
37
  } else {
 
38
    set [lindex $item 0] 1
 
39
  }
 
40
}
 
41
 
 
42
 
 
43
proc ppnd_uid {ppnd} {
 
44
  foreach i $ppnd {
 
45
    switch -- [lindex $i 0] {
 
46
      uid {
 
47
        return [lindex $i 1]
 
48
      }
 
49
    }
 
50
  }
 
51
 
 
52
  error "No Valid UID for Postponed message"
 
53
}
 
54
 
 
55
 
 
56
if {[catch {WPLoadCGIVar cid} result]} {
 
57
  catch {WPCmd PEInfo statmsg "Missing Command ID: $result"}
 
58
  source [WPTFScript $oncancel]
 
59
} elseif {$cid != [WPCmd PEInfo key]} {
 
60
  catch {WPCmd PEInfo statmsg "Invalid Command ID"}
 
61
  source [WPTFScript $oncancel]
 
62
} elseif {[catch {WPCmd PEPostpone count} postponed]} {
 
63
  catch {WPCmd PEInfo statmsg "Resume Error: $postponed"}
 
64
  source [WPTFScript $oncancel]
 
65
} else {
 
66
  switch -- $postponed {
 
67
    -1 -
 
68
    0 {
 
69
      catch {WPCmd PEInfo statmsg "No Postponed Messages"}
 
70
      source [WPTFScript $oncancel]
 
71
    }
 
72
    default {
 
73
      cgi_http_head {
 
74
        WPStdHttpHdrs
 
75
      }
 
76
 
 
77
      cgi_html {
 
78
        cgi_head {
 
79
        }
 
80
 
 
81
        cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
 
82
          set parms ""
 
83
 
 
84
          if {[info exists frame_vars]} {
 
85
            foreach v $frame_vars {
 
86
              if {[string length [subst $[lindex $v 0]]]} {
 
87
                if {[string length $parms]} {
 
88
                  append parms "&"
 
89
                } else {
 
90
                  append parms "?"
 
91
                }
 
92
 
 
93
                append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
 
94
              }
 
95
            }
 
96
          }
 
97
 
 
98
          cgi_frame hdr=header.tcl?title=80 title="Status Frame"
 
99
          cgi_frame body=resume.tcl${parms} title="Resumable Message List"
 
100
        }
 
101
      }
 
102
    }
 
103
  }
 
104
}