LLMS_Admin_Reporting_Tab_Students::output()

Output HTML for the current view within the students tab


Return Return

(void)


Top ↑

Source Source

File: includes/admin/reporting/tabs/class.llms.admin.reporting.tab.students.php

	public function output() {

		// Single student.
		if ( isset( $_GET['student_id'] ) ) {

			$student_id = llms_filter_input( INPUT_GET, 'student_id', FILTER_SANITIZE_NUMBER_INT );
			if ( ! llms_current_user_can( 'view_lifterlms_reports', $student_id ) ) {
				wp_die( __( "You do not have permission to access this student's reports", 'lifterlms' ) );
			}
			$student = llms_get_student( $student_id );
			if ( ! $student ) {
				wp_die( __( "This student doesn't exist.", 'lifterlms' ) );
			}

			$tabs = apply_filters(
				'llms_reporting_tab_student_tabs',
				array(
					'information'  => __( 'Information', 'lifterlms' ),
					'courses'      => __( 'Courses', 'lifterlms' ),
					'memberships'  => __( 'Memberships', 'lifterlms' ),
					'achievements' => __( 'Achievements', 'lifterlms' ),
					'certificates' => __( 'Certificates', 'lifterlms' ),
				)
			);

			llms_get_template(
				'admin/reporting/tabs/students/student.php',
				array(
					'current_tab' => isset( $_GET['stab'] ) ? esc_attr( llms_filter_input_sanitize_string( INPUT_GET, 'stab' ) ) : 'information',
					'tabs'        => $tabs,
					'student'     => $student,
				)
			);

		} else {

			llms_get_template( 'admin/reporting/tabs/students/students.php' );

		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Stop using deprecated FILTER_SANITIZE_STRING.
4.20.0 Added a report permission check and a user existence check.
3.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.