Skip to content

Commit

Permalink
add GRADE_LCL prop to output
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed May 24, 2024
1 parent 40eace4 commit 3524470
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion LitCalAllFestivities.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$GeneralIndex = file_exists( "nations/index.json" ) ? json_decode( file_get_contents( "nations/index.json" ) ) : null;

$Locale = isset( $_GET["locale"] ) && LitLocale::isValid( $_GET["locale"] ) ? $_GET["locale"] : "la";
$LitGrade = new LitGrade( $Locale );

$NationalCalendar = isset( $_GET["nationalcalendar"] ) && in_array( strtoupper( $_GET["nationalcalendar"] ), $SUPPORTED_NATIONAL_CALENDARS ) ? strtoupper( $_GET["nationalcalendar"] ) : null;
$DiocesanCalendar = isset( $_GET["diocesancalendar"] ) ? strtoupper( $_GET["diocesancalendar"] ) : null;
Expand Down Expand Up @@ -94,6 +95,7 @@
$FestivityCollection[ $key ] = $festivity;
$FestivityCollection[ $key ][ "NAME" ] = $NAME[ $key ];
$FestivityCollection[ $key ][ "MISSAL" ] = $LatinMissal;
$FestivityCollection[ $key ][ "GRADE_LCL" ] = $LitGrade->i18n($festivity["GRADE"]);
}
}
}
Expand Down Expand Up @@ -195,6 +197,7 @@
$FestivityCollection[ $key ][ "TAG" ] = $key;
$FestivityCollection[ $key ][ "NAME" ] = $NAME[ $key ];
$FestivityCollection[ $key ][ "GRADE" ] = $PropriumDeTemporeRanks[ $key ];
$FestivityCollection[ $key ][ "GRADE_LCL" ] = $LitGrade->i18n( $PropriumDeTemporeRanks[ $key ] );
$FestivityCollection[ $key ][ "COMMON" ] = [];
$FestivityCollection[ $key ][ "CALENDAR" ] = "GENERAL ROMAN";
if( in_array( $key, $PropriumDeTemporeRed ) ) {
Expand Down Expand Up @@ -238,6 +241,7 @@
}
else if( $festivity[ "Metadata" ][ "property" ] === 'grade' ) {
$FestivityCollection[ $key ][ "GRADE" ] = $festivity[ "Festivity" ][ "GRADE" ];
$FestivityCollection[ $key ][ "GRADE_LCL" ] = $LitGrade->i18n( $festivity[ "Festivity" ][ "GRADE" ] );
}
}
else if( $festivity[ "Metadata" ][ "action" ] === 'makeDoctor' ) {
Expand All @@ -263,6 +267,7 @@
$key = $row->Festivity->tag;
$temp = (array) $row->Festivity;
$FestivityCollection[ $key ] = array_change_key_case( $temp, CASE_UPPER );
$FestivityCollection[ $key ][ "GRADE_LCL" ] = $LitGrade->i18n( $row->Festivity->grade );
}
}
if( property_exists( $NationalData, "Metadata" ) && property_exists( $NationalData->Metadata, "Missals" ) ) {
Expand All @@ -276,6 +281,7 @@
foreach( $PropriumDeSanctis as $idx => $festivity ) {
$key = $festivity->TAG;
$FestivityCollection[ $key ] = (array) $festivity;
$FestivityCollection[ $key ][ "GRADE_LCL" ] = $LitGrade->i18n( $festivity->GRADE );
$FestivityCollection[ $key ][ "MISSAL" ] = $missal;
}
}
Expand All @@ -287,7 +293,8 @@
foreach( $DiocesanData->LitCal as $key => $festivity ) {
$temp = (array) $festivity->Festivity;
$FestivityCollection[ $DiocesanCalendar . '_' . $key ] = array_change_key_case( $temp, CASE_UPPER );
$FestivityCollection[ $DiocesanCalendar . '_' .$key ][ "TAG" ] = $DiocesanCalendar . '_' .$key;
$FestivityCollection[ $DiocesanCalendar . '_' . $key ][ "TAG" ] = $DiocesanCalendar . '_' .$key;
$FestivityCollection[ $DiocesanCalendar . '_' . $key ][ "GRADE_LCL" ] = $LitGrade->i18n( $festivity->Festivity->grade );
}
}

Expand Down

0 comments on commit 3524470

Please sign in to comment.