~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to web/cgi/alpine/querydelfldr.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: querydelfldr.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
#  querydelfldr.tcl
 
15
#
 
16
#  Purpose:  CGI script to generate html form used to confirm 
 
17
#            folder deletion
 
18
 
 
19
#  Input:
 
20
set fldr_vars {
 
21
  {fid  "No Folder Specified"}
 
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
source cmdfunc.tcl
 
32
 
 
33
set query_menu {
 
34
  {
 
35
    {}
 
36
    {
 
37
      {
 
38
        # * * * * HELP * * * *
 
39
        cgi_put "Get Help"
 
40
      }
 
41
    }
 
42
  }
 
43
}
 
44
 
 
45
WPEval $fldr_vars {
 
46
  if {[catch {WPCmd PEFolder collections} collections]} {
 
47
    error [list _action "Collection list" $collections]
 
48
  }
 
49
 
 
50
  cgi_http_head {
 
51
    WPStdHttpHdrs
 
52
  }
 
53
 
 
54
  cgi_html {
 
55
    cgi_head {
 
56
      WPStdHtmlHdr "Confirm Delete"
 
57
      WPStyleSheets
 
58
    }
 
59
 
 
60
    cgi_body BGCOLOR="$_wp(bordercolor)" {
 
61
      cgi_form $_wp(appdir)/wp method=get name=confirm target=_top {
 
62
        cgi_text "page=folders" type=hidden notab
 
63
        cgi_text "fid=$fid" type=hidden
 
64
        cgi_text "cid=[WPCmd PEInfo key]" type=hidden
 
65
        cgi_text "frestore=1" type=hidden
 
66
 
 
67
        cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
 
68
          cgi_table_row {
 
69
            eval {
 
70
              cgi_table_data $_wp(menuargs) {
 
71
                WPTFCommandMenu query_menu {}
 
72
              }
 
73
            }
 
74
            
 
75
            cgi_table_data valign=top align=center class=dialog {
 
76
              cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
 
77
                cgi_table_row {
 
78
                  cgi_table_data align=center {
 
79
                    cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
 
80
 
 
81
                    regsub -all { } [lindex $fid end] {\ } dfn
 
82
 
 
83
                    cgi_puts "Please confirm that you would like to permanently remove [cgi_bold $dfn]"
 
84
 
 
85
                    if {[llength $fid] > 2} {
 
86
                      if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} delim]} {
 
87
                        set delim /
 
88
                      }
 
89
 
 
90
                      set dirname ""
 
91
                      for {set i 1} {$i < ([llength $fid] - 1)} {incr i} {
 
92
                        append dirname "[lindex $fid $i]$delim"
 
93
                      }
 
94
 
 
95
                      if {[string length $dirname]} {
 
96
                        cgi_put " from the directory [cgi_bold $dirname] "
 
97
                      }
 
98
                    }
 
99
                    if {[llength $collections] > 1} {
 
100
                      cgi_put "in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
 
101
                    } else {
 
102
                      cgi_put "."
 
103
                    }
 
104
 
 
105
                    cgi_br
 
106
                    cgi_br
 
107
                    cgi_puts "Click [cgi_italic Delete] to remove the folder permanently, or [cgi_italic Cancel] to return to the Folder List."
 
108
                    cgi_br
 
109
                    cgi_br
 
110
                    cgi_submit_button delete=Delete
 
111
                    cgi_submit_button delete=Cancel
 
112
                  }
 
113
                }
 
114
              }
 
115
            }
 
116
          }
 
117
        }
 
118
      }
 
119
    }
 
120
  }
 
121
}