diff --git a/generate_calendar_dates.php b/generate_calendar_dates.php index 0907461..a43bba6 100755 --- a/generate_calendar_dates.php +++ b/generate_calendar_dates.php @@ -92,29 +92,29 @@ // The period and week variables are defined identically in both templates, so // let's define them just once here to ensure consistency. -$shared_variables = << - - - - - - +$shared_parameters = << + + + + + + + + Attribute "period" must be one of the values {$period_list}. + + + + + + + + - Attribute "period" must be one of the values {$period_list}. + The "week" attribute is required. - - - - - - - - - The "week" attribute is required. - - - + + EOT; @@ -126,7 +126,7 @@ @@ -151,40 +151,40 @@ --> @@ -206,32 +206,32 @@ --> @@ -239,10 +239,10 @@ EOT; -// Generate the XSLT functions that do all the work. These essentially end up being huge parameterised lookup tables. -generate_function( $first_monday, $periods, 'format-teaching-date' ); +// Generate the XSLT templates that do all the work. These essentially end up being huge parameterised lookup tables. +generate_template( $first_monday, $periods, 'format-teaching-date' ); -generate_function( $first_monday, $periods, 'format-teaching-date-range' ); +generate_template( $first_monday, $periods, 'format-teaching-date-range' ); // Footer boilerplate. @@ -254,7 +254,7 @@ //////////////////////////////////////////////////////////////////////////////// -function generate_function( $first_monday, $periods, $function_name ) +function generate_template( $first_monday, $periods, $template_name ) { // A couple of handy date intervals: four days to the end of the current week, // and seven days to the start of next week. @@ -262,17 +262,17 @@ $plus_seven_days = new DateInterval( 'P7D' ); - // Initial boilerplate for the function. - switch ( $function_name ) + // Initial boilerplate for the template. + switch ( $template_name ) { case 'format-teaching-date': print<< - +