InvitationService::used(), self::render( ... ), null, 'megaphone' ); return $sections; } public static function render( AccountViewer $viewer ): string { $rows = InvitationRepository::for_user( $viewer->id() ); $interest = self::interest( $viewer->id() ); if ( array() === $rows ) { return Markup::notice( __( 'You have no invitations.', 'rooster-lms' ) ) . $interest; } $lang = Switcher::current(); $units = array_values( array_unique( array_filter( array_map( static fn( array $r ): int => (int) $r['unit_id'], $rows ) ) ) ); $courses = array_values( array_unique( array_map( static fn( array $r ): int => (int) $r['course_id'], $rows ) ) ); $utitles = array() === $units ? array() : Services::posts()->titles( ObjectType::UNIT, $units, $lang ); $ctitles = Services::posts()->titles( ObjectType::COURSE, $courses, $lang ); $now = Clock::now(); $html = '
' . esc_html( Format::date( (string) $row['starts_at'], (string) get_option( 'date_format', 'j F Y' ) . ' ' . (string) get_option( 'time_format', 'H:i' ) ) ) . '
'; } /* translators: %s: the answer (Yes, No, Maybe, No answer). */ $body .= '' . esc_html( sprintf( __( 'Your answer: %s', 'rooster-lms' ), $answer->label() ) ) . '
'; if ( $open ) { $options = ''; foreach ( $offered as $choice ) { $options .= ''; } $body .= ''; } $head = '' !== $url ? '' . esc_html( $title ) . '' : esc_html( $title ); $html .= '' . esc_html__( 'We e-mail you when these courses send their next invitation.', 'rooster-lms' ) . '