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

« back to all changes in this revision

Viewing changes to web/cgi/alpine/1.0/flags.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: flags.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
#  queryexpunge.tcl
 
15
#
 
16
#  Purpose:  CGI script to generate html form used to confirm 
 
17
#            deleted message expunge
 
18
#
 
19
#  Input:
 
20
set flag_vars {
 
21
  {uid  "Missing UID"}
 
22
}
 
23
 
 
24
#  Output:
 
25
#
 
26
#       HTML/CSS data representing the message specified
 
27
#       by the 'uid' argument
 
28
 
 
29
# inherit global config
 
30
source ./alpine.tcl
 
31
 
 
32
WPEval $flag_vars {
 
33
 
 
34
  cgi_http_head {
 
35
    WPStdHttpHdrs
 
36
  }
 
37
 
 
38
  cgi_html {
 
39
    cgi_head {
 
40
      WPStdHtmlHdr "Set Flags"
 
41
      WPStyleSheets
 
42
    }
 
43
 
 
44
    cgi_body BGCOLOR="$_wp(bordercolor)" {
 
45
      cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=body {
 
46
        cgi_text "page=index" type=hidden notab
 
47
        cgi_text "sessid=$sessid" type=hidden notab
 
48
        cgi_text "uid=$uid" type=hidden notab
 
49
 
 
50
        cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
 
51
          cgi_table_row {
 
52
            cgi_table_data valign=top align=center class=dialog {
 
53
              cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
 
54
                cgi_table_row {
 
55
                  cgi_table_data align=center {
 
56
                    cgi_puts [cgi_nl][cgi_nl]
 
57
                    cgi_puts "Status flags are attributes you can assign to messages that help you associate certain meanings (for example, [cgi_bold Important]) or indicate to Web Alpine"
 
58
                    cgi_puts "how you would like to operate on the message (for example, the [cgi_bold Deleted] flag tells WebPine to permanently remove the"
 
59
                    cgi_puts "message from the folder when you [cgi_bold Expunge])."
 
60
                    cgi_puts [cgi_nl][cgi_nl]
 
61
                    cgi_puts "Set or unset desired flags for message [WPCmd PEMessage $uid number] below then"
 
62
                    cgi_puts "click [cgi_italic "Set Flags"],  or [cgi_italic Cancel] to return to the list of messages"
 
63
                    cgi_puts "in [WPCmd PEMailbox mailboxname]."
 
64
                    cgi_br
 
65
                    cgi_br
 
66
 
 
67
                    set flaglist [WPCmd PEInfo flaglist]
 
68
                    set setflags [WPCmd PEMessage $uid status]
 
69
 
 
70
                    cgi_table class=dialog {
 
71
                      foreach item $flaglist {
 
72
                        cgi_table_row {
 
73
                          cgi_table_data valign=top align=right width="30%" {
 
74
                            if {[lsearch $setflags $item] >= 0} {
 
75
                              set checked checked
 
76
                            } else {
 
77
                              set checked ""
 
78
                            }
 
79
 
 
80
                            cgi_checkbox $item style="background-color:$_wp(dialogcolor)" $checked
 
81
                          }
 
82
 
 
83
                          cgi_table_data valign=top align=left {
 
84
                            switch -- $item {
 
85
                              New       { set text "New" }
 
86
                              Answered { set text "Answered" }
 
87
                              Deleted { set text "Deleted" }
 
88
                              default { set text $item }
 
89
                            }
 
90
                            cgi_puts $text
 
91
                          }
 
92
                        }
 
93
                      }
 
94
 
 
95
                      cgi_table_row {
 
96
                        cgi_table_data colspan=2 height=50 {
 
97
                          cgi_br
 
98
                          cgi_submit_button "op=Set Flags"
 
99
                          cgi_submit_button cancel=Cancel
 
100
                        }
 
101
                      }
 
102
                    }
 
103
                  }
 
104
                }
 
105
              }
 
106
            }
 
107
          }
 
108
        }
 
109
      }
 
110
    }
 
111
  }
 
112
}