Index: openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/table-display-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 22 Jun 2015 21:03:13 -0000 1.23 +++ openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 7 Aug 2017 23:48:00 -0000 1.24 @@ -4,160 +4,10 @@ @cvs-id $Id$ } -# Dimensional selection bars. -# -ad_proc ad_dimensional { - option_list - {url {}} - {options_set ""} - {optionstype url} -} { - Generate an option bar as in the ticket system; - - -

- option_list structure is -

-    { 
-        {variable "Title" defaultvalue
-            {
-                {value "Text" {key clause}}
-                ...
-            }
-        }
-        ...
-    }
 
-    an example:
 
-    set dimensional_list {
-        {visited "Last Visit" 1w {
-            {never "Never" {where "last_visit is null"}}
-            {1m "Last Month" {where "last_visit + 30 > sysdate"}}
-            {1w "Last Week" {where "last_visit + 7 > sysdate"}}
-            {1d "Today" {where "last_visit > trunc(sysdate)"}}
-        }}
-        ..(more of the same)..
-    }
-    
-} { - set html {} - if {$option_list eq ""} { - return - } - - if {$options_set eq ""} { - set options_set [ns_getform] - } - - if {$url eq ""} { - set url [ad_conn url] - } - - append html "\n\n" - - foreach option $option_list { - append html " \n" - } - append html "\n" - - append html "\n" - - foreach option $option_list { - append html " \n" - } - append html "\n
[lindex $option 1]
\[" - - # find out what the current option value is. - # check if a default is set otherwise the first value is used - set option_key [lindex $option 0] - set option_val {} - if { $options_set ne ""} { - set option_val [ns_set get $options_set $option_key] - } - if { $option_val eq "" } { - set option_val [lindex $option 2] - } - - set first_p 1 - foreach option_value [lindex $option 3] { - set thisoption [lindex $option_value 0] - if { $first_p } { - set first_p 0 - } else { - append html " | " - } - - if {$option_val eq $thisoption } { - append html "[ns_quotehtml [lindex $option_value 1]]" - } else { - set href $url?[export_ns_set_vars url $option_key $options_set]&[ns_urlencode $option_key]=[ns_urlencode $thisoption] - append html [subst {[ns_quotehtml [lindex $option_value 1]]}] - } - } - append html "\]
\n" -} - -ad_proc ad_dimensional_sql { - option_list - {what "where"} - {joiner "and"} - {options_set ""} -} { - see ad_dimensional for the format of option_list -

- Given what clause we are asking for and the joiner this returns - the sql fragment -} { - set out {} - - if {$option_list eq ""} { - return - } - - if {$options_set eq ""} { - set options_set [ns_getform] - } - - foreach option $option_list { - # find out what the current option value is. - # check if a default is set otherwise the first value is used - set option_key [lindex $option 0] - set option_val {} - # get the option from the form - if { $options_set ne ""} { - set option_val [ns_set get $options_set $option_key] - } - #otherwise get from default - if { $option_val eq "" } { - set option_val [lindex $option 2] - } - - foreach option_value [lindex $option 3] { - set thisoption [lindex $option_value 0] - if {$option_val eq $thisoption } { - set code [lindex $option_value 2] - if {$code ne ""} { - if {[lindex $code 0] eq $what } { - append out " $joiner [uplevel [list subst [lindex $code 1]]]" - } - } - } - } - } - - return $out -} - -ad_proc ad_dimensional_set_variables {option_list {options_set ""}} { +ad_proc -deprecated ad_dimensional_set_variables {option_list {options_set ""}} { set the variables defined in option_list from the form provided (form defaults to ad_conn form) or to default value from option_list if not in the form data. @@ -815,7 +665,7 @@ return $html } -ad_proc ad_order_by_from_sort_spec {sort_by tabledef} { +ad_proc -deprecated ad_order_by_from_sort_spec {sort_by tabledef} { Takes a sort_by spec, and translates it into into an "order by" clause with each sort_by key dictated by the sort info in tabledef } { @@ -883,7 +733,7 @@ } } -ad_proc ad_same_page_link {variable value text {form ""}} { +ad_proc -deprecated ad_same_page_link {variable value text {form ""}} { Makes a link to this page, with a new value for "variable". } { if { $form eq "" } { @@ -894,7 +744,7 @@ return [subst {[ns_quotehtml $text]}] } -ad_proc ad_reverse order { +ad_proc -deprecated ad_reverse order { returns the opposite sort order from the one it is given. Mostly for columns whose natural sort order is not the default. @@ -906,7 +756,7 @@ return $order } -ad_proc ad_custom_load {user_id item_group item item_type} { +ad_proc -deprecated ad_custom_load {user_id item_group item item_type} { load a persisted user customization as saved by for example table-custom.tcl. } { @@ -926,7 +776,7 @@ return $value } -ad_proc ad_custom_list {user_id item_group item_set item_type target_url custom_url {new_string "new view"}} { +ad_proc -deprecated ad_custom_list {user_id item_group item_set item_type target_url custom_url {new_string "new view"}} { Generates the html fragment for choosing, editing and creating user customized data } { @@ -953,7 +803,7 @@ } -ad_proc ad_custom_page_defaults {defaults} { +ad_proc -deprecated ad_custom_page_defaults {defaults} { set the page defaults. If the form is empty do a returnredirect with the defaults set } { @@ -981,7 +831,7 @@ } } -ad_proc ad_custom_form {return_url item_group item} { +ad_proc -deprecated ad_custom_form {return_url item_group item} { sets up the head of a form to feed to /tools/form-custom.tcl } { append html "

\n" @@ -996,7 +846,7 @@ append html "" } -ad_proc ad_dimensional_settings {define current} { +ad_proc -deprecated ad_dimensional_settings {define current} { given a dimensional slider definition this routine returns a form to set the defaults for the given slider. @@ -1014,9 +864,9 @@ } foreach val [lindex $opt 3] { if {$picked eq [lindex $val 0] } { - append html "\n" + append html "\n" } else { - append html "\n" + append html "\n" } } append html "\n" @@ -1039,3 +889,9 @@ return $orderclause } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: