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

« back to all changes in this revision

Viewing changes to web/cgi/alpine/querynick.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./tclsh
 
2
# $Id: querynick.tcl 391 2007-01-25 03:53:59Z mikes@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
#  querynick.tcl
 
15
#
 
16
#  Purpose:  CGI script to generate html form used to deal
 
17
#            with existing/taken nickname collision
 
18
#
 
19
 
 
20
#  Input:
 
21
set nick_vars {
 
22
  {book "Missing address book"}
 
23
  {nick       {} ""}
 
24
  {add        {} 0}
 
25
  {fn         {} ""}
 
26
  {addrs      {} ""}
 
27
  {fcc        {} ""}
 
28
  {comment    {} ""}
 
29
  {take       {} 0}
 
30
  {newnick    {} ""}
 
31
  {ai         {} -1}
 
32
}
 
33
 
 
34
#  Output:
 
35
#
 
36
 
 
37
# Command Menu
 
38
set nick_menu {
 
39
}
 
40
 
 
41
set common_menu {
 
42
  {
 
43
    {}
 
44
    {
 
45
      {
 
46
        cgi_puts "Get Help"
 
47
      }
 
48
    }
 
49
  }
 
50
}
 
51
 
 
52
 
 
53
#  Output:
 
54
#     Query prompt to deal with existing/taken nickname collision
 
55
#
 
56
#
 
57
 
 
58
# inherit global config
 
59
source ./alpine.tcl
 
60
source cmdfunc.tcl
 
61
 
 
62
WPEval $nick_vars {
 
63
 
 
64
  cgi_http_head {
 
65
    WPStdHttpHdrs
 
66
  }
 
67
 
 
68
  cgi_html {
 
69
    cgi_head {
 
70
      WPStdHtmlHdr "Take to New Entry or List"
 
71
      WPStyleSheets
 
72
    }
 
73
 
 
74
    cgi_body BGCOLOR="$_wp(bordercolor)" {
 
75
 
 
76
      #catch {WPCmd PEInfo set help_context samenick}
 
77
 
 
78
      cgi_form $_wp(appdir)/wp method=get name=samenick target=_top {
 
79
 
 
80
        cgi_table border=0 cellspacing=0 cellpadding=2 height="100%" {
 
81
          cgi_table_row {
 
82
            cgi_table_data valign=top class=navbar {
 
83
              cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
 
84
                # next comes the menu down the left side, with suitable
 
85
                cgi_table_row {
 
86
                  eval {
 
87
                    cgi_table_data $_wp(menuargs) class=navbar {
 
88
                      WPTFCommandMenu nick_menu common_menu
 
89
                    }
 
90
                  }
 
91
                }
 
92
              }
 
93
            }
 
94
 
 
95
            cgi_table_data valign=top class=navbar {
 
96
 
 
97
              cgi_text "page=addrsave" type=hidden notab
 
98
              cgi_text "oncancel=main" type=hidden notab
 
99
              cgi_text "take=1" type=hidden notab
 
100
              cgi_text "ai=${ai}" type=hidden notab
 
101
              cgi_text "book=${book}" type=hidden notab
 
102
              cgi_text "nick=${nick}" type=hidden notab
 
103
              cgi_text "fn=${fn}" type=hidden notab
 
104
              cgi_text "addrs=${addrs}" type=hidden notab
 
105
              cgi_text "fcc=${fcc}" type=hidden notab
 
106
              cgi_text "comment=${comment}" type=hidden notab
 
107
              cgi_text "newnick=${newnick}" type=hidden notab
 
108
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
109
 
 
110
              cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
 
111
                cgi_table_row {
 
112
                  cgi_table_data valign=top align=center class=dialog {
 
113
                    cgi_table border=0 cellspacing=0 cellpadding=15 width="75%" {
 
114
                      cgi_table_row {
 
115
                        cgi_table_data align=center colspan=2 "xstyle=padding-top:20;padding-bottom:20" {
 
116
                          cgi_puts "An address book entry with the nickname \"[cgi_bold $newnick]\" already exists.  At this point you may click either:"
 
117
                        }
 
118
                      }
 
119
 
 
120
                      cgi_table_row {
 
121
                        cgi_table_data align=right {
 
122
                          cgi_submit_button "replace=Replace Entry"
 
123
                        }
 
124
                        cgi_table_data "xstyle=padding:15" {
 
125
                          cgi_puts "Replace the \"[cgi_bold $newnick]\" address book entry with your [cgi_italic Take] selection."
 
126
                        }
 
127
                      }
 
128
 
 
129
                      cgi_table_row {
 
130
                        cgi_table_data align=right {
 
131
                          cgi_submit_button "replace=Add to Entry"
 
132
                        }
 
133
                        cgi_table_data "xstyle=padding:15" {
 
134
                          if {[string first "," $addrs] >= 0} {
 
135
                            set plur "es"
 
136
                          } else {
 
137
                            set plur ""
 
138
                          }
 
139
 
 
140
                          cgi_puts "Add the address${plur} from your [cgi_italic Take] selection to the existing entry's addresses to create a list."
 
141
                        }
 
142
                      }
 
143
 
 
144
                      cgi_table_row {
 
145
                        cgi_table_data align=right {
 
146
                          cgi_submit_button "replace=Edit"
 
147
                        }
 
148
                        cgi_table_data "xstyle=padding:15" {
 
149
                          cgi_puts "Go back to editing your [cgi_italic Take] selection."
 
150
                        }
 
151
                      }
 
152
 
 
153
                      cgi_table_row {
 
154
                        cgi_table_data align=right {
 
155
                          cgi_submit_button "cancel=Cancel"
 
156
                        }
 
157
                        cgi_table_data "xstyle=padding:15" {
 
158
                          cgi_puts "Or, Cancel your [cgi_italic Take] selection altogether."
 
159
                        }
 
160
                      }
 
161
                    }
 
162
                  }
 
163
                }
 
164
              }
 
165
            }
 
166
          }
 
167
        }
 
168
      }
 
169
    }      
 
170
  }
 
171
}