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

« back to all changes in this revision

Viewing changes to web/cgi/alpine/1.0/promptsave.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
#!./tclsh
 
2
# $Id: promptsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
 
3
# ========================================================================
 
4
# Copyright 2006 University of Washington
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# ========================================================================
 
13
 
 
14
#  promptsave.tcl
 
15
#
 
16
#  Purpose:  CGI script to generate html form used to gather folder
 
17
#            name and collection for aggregate save
 
18
 
 
19
#  Input:
 
20
#     conftext : 
 
21
#     params : array of key/value pairs to submit with form
 
22
#     oncancel : url to reference should user cancel dialog
 
23
set psave_vars {
 
24
  {uid  ""      0}
 
25
}
 
26
 
 
27
#  Output:
 
28
#
 
29
#       HTML/CSS data representing the form for save folder dialog
 
30
 
 
31
# inherit global config
 
32
source ./alpine.tcl
 
33
source cmdfunc.tcl
 
34
 
 
35
set query_menu {
 
36
  {
 
37
    {}
 
38
    {
 
39
      {
 
40
        # * * * * OK * * * *
 
41
        cgi_image_button save=[WPimg but_save] border=0 alt="Save"
 
42
      }
 
43
    }
 
44
  }
 
45
  {
 
46
    {}
 
47
    {
 
48
      {
 
49
        # * * * * CANCEL * * * *
 
50
        cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
 
51
      }
 
52
    }
 
53
  }
 
54
}
 
55
 
 
56
WPEval $psave_vars {
 
57
  cgi_http_head {
 
58
    WPStdHttpHdrs
 
59
  }
 
60
 
 
61
  cgi_html {
 
62
    cgi_head {
 
63
      WPStdHtmlHdr "Aggregate Save"
 
64
      WPStyleSheets
 
65
    }
 
66
 
 
67
    cgi_body BGCOLOR="$_wp(bordercolor)" {
 
68
 
 
69
      catch {WPCmd PEInfo set help_context promptsave}
 
70
      catch {WPCmd PEInfo set wp_index_script fr_promptsave.tcl}
 
71
 
 
72
      cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
 
73
        cgi_text page=body type=hidden notab
 
74
 
 
75
        cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
 
76
          cgi_table_row {
 
77
            cgi_table_data align=center valign=top class=dialog {
 
78
              cgi_table width="80%" {
 
79
                cgi_table_row {
 
80
                  cgi_table_data colspan=2 {
 
81
                    cgi_center {
 
82
                      cgi_puts "[cgi_nl][cgi_nl]This page provides a way to save messages to a folder"
 
83
                    }
 
84
                  }
 
85
 
 
86
                  cgi_table_row class=dialog {
 
87
                    cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
 
88
                      cgi_puts [cgi_font face=tahoma,verdana,geneva "Save for messages "]
 
89
 
 
90
                      cgi_put "Save "
 
91
 
 
92
                      if {!$uid} {
 
93
                        set n [WPCmd PEMailbox selected]
 
94
                        cgi_put "all [cgi_bold [WPcomma $n]] marked message[WPplural $n] "
 
95
                        if {[catch {WPCmd PEMessage $uid savedefault} savedefault]} {
 
96
                          set savedefault [list 1 saved-messages]
 
97
                        }
 
98
                      } else {
 
99
                        set savedefault [list 1 saved-messages]
 
100
                      }
 
101
 
 
102
                      cgi_put "to "
 
103
                      cgi_br
 
104
 
 
105
                      cgi_text "savename=[lindex $savedefault 1]" type=text size=14 maxlength=256 class=aggop style=vertical-align:middle onFocus=this.select()
 
106
                      if {[catch {WPCmd PEFolder collections} collections] == 0 && [llength $collections] > 1} {
 
107
                        cgi_put "[cgi_nbspace]in "
 
108
                        cgi_select savecolid class=aggop style=vertical-align:middle {
 
109
                          set defcol [lindex $savedefault 0]
 
110
                          set j 0
 
111
                          foreach i $collections {
 
112
                            if {$j == $defcol} {
 
113
                              set selected selected
 
114
                            } else {
 
115
                              set selected {}
 
116
                            }
 
117
                            if {[string length [set f [lindex $i 1]]] > 12} {
 
118
                              set f "[string range $f 0 10]..."
 
119
                            }
 
120
                            
 
121
                            cgi_option $f value=$j $selected
 
122
                            incr j;
 
123
                          }
 
124
                        }
 
125
                      } else {
 
126
                        cgi_text "savecolid=0" type=hidden notab
 
127
                      }
 
128
 
 
129
                      cgi_br
 
130
                      cgi_puts "[cgi_nl]Click [cgi_italic Save] to save the message the folder, or [cgi_italic Cancel] to abort the save."
 
131
                    }
 
132
                  }
 
133
 
 
134
                  cgi_table_row {
 
135
                    cgi_table_data class=dialog align=center colspan=2 {
 
136
                      cgi_br
 
137
                      cgi_submit_button save=Save
 
138
                      cgi_submit_button savecancel=Cancel
 
139
                    }
 
140
                  }
 
141
                }
 
142
              }
 
143
            }
 
144
          }
 
145
        }
 
146
      }
 
147
    }
 
148
  }
 
149
}