Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Metabox_Course_Builder::output_section( obj $section, string $which )

HTML helper to output info for a section


Parameters Parameters

$section

(obj) (Required) LLMS_Section object

$which

(string) (Required) positioning [current|previous|next]


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.course.builder.php

	private function output_section( $section, $which ) {

		$url = false;

		if ( 'previous' === $which ) {
			$section = $section->get_previous();
		} elseif ( 'next' === $which ) {
			$section = $section->get_next();
		}

		if ( ! $section ) {
			return;
		}

		if ( 'previous' === $which || 'next' === $which ) {
			$lessons = $section->get_lessons( 'ids' );
			if ( $lessons ) {
				$url = get_edit_post_link( $lessons[0] );
			}
		}
		?>

		<p><strong><?php printf( __( 'Section %1$d: %2$s', 'lifterlms' ), $section->get( 'order' ), $this->get_title_html( $section->get( 'title' ), $url ) ); ?></strong></p>

		<?php if ( 'current' === $which ) : ?>
			<ol>
			<?php
			foreach ( $section->get_lessons() as $lesson ) :
				$hash = 'lesson:' . $lesson->get( 'id' );
				?>
				<li>
					<?php if ( $this->post->ID !== $lesson->get( 'id' ) ) : ?>
						<?php echo $this->get_title_html( $lesson->get( 'title' ), get_edit_post_link( $lesson->get( 'id' ) ) ); ?>
					<?php else : ?>
						<?php echo $lesson->get( 'title' ); ?>
					<?php endif; ?>
					<a class="tip--top-left" href="<?php echo esc_url( $this->get_builder_url( $lesson->get( 'parent_course' ), $hash ) ); ?>" data-tip="<?php esc_attr_e( 'Edit lesson in builder', 'lifterlms' ); ?>"><i class="fa fa-cog"></i></a>
					<?php
					if ( $lesson->has_quiz() ) :
						$quiz = $lesson->get_quiz();
						?>
						<br>
						<?php printf( '<span class="tip--top-right" data-tip="%1$s"><i class="fa fa-question-circle"></i></span> %2$s', __( 'Quiz', 'lifterlms' ), $this->get_title_html( $quiz->get( 'title' ), $this->get_builder_url( $lesson->get( 'parent_course' ), $hash . ':quiz' ) ) ); ?>
					<?php endif; ?>
					<?php do_action( 'llms_builder_mb_after_lesson', $lesson, $this ); ?>
				</li>
			<?php endforeach; ?>
			</ol>
			<?php
		endif;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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