antoniop
committed
on 14 Feb 24
Harden page contracts
/www/calendar-full-portlet.tcl (+2 -1)
26 26     {date ""}
27 27     {period_days:naturalnum,optional}
28 28     {julian_date ""}
29 29 } -properties {
30 30
31 31 } -validate {
32 32     valid_date -requires { date } {
33 33         if {$date ne "" } {
34 34             if {[catch {set date [clock format [clock scan $date] -format "%Y-%m-%d"]} err]} {
35 35                 ad_complain "Your input ($date) was not valid. It has to be in the form YYYY-MM-DD."
36 36             }
37 37         }
38 38     }
39 39 }
40 40
41 41 # get stuff out of the config array
42 42 array set config $cf
43 43 if {$view eq ""} {
44 44     set view $config(default_view)
45 45 }
  46 set list_of_calendar_ids $config(calendar_id)
46 47
47 48 set ad_conn_url [ad_conn url]
48 49 set calendar_url [ad_conn package_url]calendar/
49 50
50 51 set scoped_p $config(scoped_p)
51 52 if {$scoped_p == "t"} {
52 53     set show_calendar_name_p 1
53 54 } else {
54 55     set show_calendar_name_p 0
55 56 }
56 57
57 58 # Styles for calendar
58 59 template::head::add_css -href "/resources/calendar/calendar.css"
59 60 template::head::add_css -alternate -href "/resources/calendar/calendar-hc.css" -title "highContrast"
60 61
61 62 # set the period_days for calendar's list view, therefore, we need
62 63 # to check which instance of calendar is currently displayed
63 64 if { [namespace which ::dotlrn_community::get_community_id] ne "" } {
64 65     set community_id [dotlrn_community::get_community_id -url [ad_conn url]]
65 66 } else {