public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Creates a box to show that a unit has been completed.
		 *
		 * @return String The HTML for the navigation box.
		 */
Creates a box to show that a unit has been completed.
@return String The HTML for the navigation box.
Creates a box to show that a unit has been completed . @return String The HTML for the navigation box .
public function render_navigation_getNavigationBox() {
			$disableNextButton = false;
			if ( $this->parentData->course_opt_completion_wall != 'all_visible' ) {
				if ( ! $this->check_unit_isCompleted() ) {
					$disableNextButton = true;
				}
			}
			if ( ! $this->check_user_canUserAccessUnit() && $this->check_is_unit_teaser() ) {
				return false;
			}
			if ( $this->check_is_admin_or_teacher() ) {
				$disableNextButton = false;
			}
			$nextAndPrev = $this->userProgress->getNextAndPreviousUnit( $this->unitPost->ID );
			$html        = false;
			ob_start();
			do_action( 'wpcw_unit_before_previous_next_unit_buttons', $nextAndPrev, $this->unitPost->ID );
			if ( $nextAndPrev['prev'] > 0 ) {
				do_action( 'wpcw_unit_before_previous_unit_button', $nextAndPrev['prev'], $this->unitPost->ID );
				printf( '<a href="%s" class="fe_btn fe_btn_navigation fe_btn_navigation_prev">', get_permalink( $nextAndPrev['prev'] ) );
				printf( __( '&laquo; %1$s %2$s', 'wp-courseware' ), __( 'Previous', 'wp-courseware' ), wpcw_get_unit_label() );
				printf( '</a>' );
				do_action( 'wpcw_unit_after_previous_unit_button', $nextAndPrev['prev'], $this->unitPost->ID );
			}
			if ( ! $disableNextButton && $nextAndPrev['next'] > 0 ) {
				do_action( 'wpcw_unit_before_next_unit_button', $nextAndPrev['next'], $this->unitPost->ID );
				printf( '<a href="%s" class="fe_btn fe_btn_navigation fe_btn_navigation_next">', get_permalink( $nextAndPrev['next'] ) );
				printf( __( '%1$s %2$s &raquo;', 'wp-courseware' ), __( 'Next', 'wp-courseware' ), wpcw_get_unit_label() );
				printf( '</a>' );
				do_action( 'wpcw_unit_after_next_unit_button', $nextAndPrev['next'], $this->unitPost->ID );
			}
			do_action( 'wpcw_unit_after_previous_next_unit_buttons', $nextAndPrev, $this->unitPost->ID );
			$html = ob_get_clean();
			if ( $html ) {
				return sprintf( '<div class="wpcw_fe_progress_box_wrap">
				<div class="wpcw_fe_navigation_box">
					%s
				</div>
			</div>', $html );
			}
			return false;
		}
public function render_navigation_getNavigationBox ( ) { $ disableNextButton = false ; if ( $ this -> parentData -> course_opt_completion_wall != 'all_visible' ) { if ( ! $ this -> check_unit_isCompleted ( ) ) { $ disableNextButton = true ; } } if ( ! $ this -> check_user_canUserAccessUnit ( ) && $ this -> check_is_unit_teaser ( ) ) { return false ; } if ( $ this -> check_is_admin_or_teacher ( ) ) { $ disableNextButton = false ; } $ nextAndPrev = $ this -> userProgress -> getNextAndPreviousUnit ( $ this -> unitPost -> ID ) ; $ html = false ; ob_start ( ) ; do_action ( 'wpcw_unit_before_previous_next_unit_buttons' , $ nextAndPrev , $ this -> unitPost -> ID ) ; if ( $ nextAndPrev [ 'prev' ] > 0 ) { do_action ( 'wpcw_unit_before_previous_unit_button' , $ nextAndPrev [ 'prev' ] , $ this -> unitPost -> ID ) ; printf ( '<a href="%s" class="fe_btn fe_btn_navigation fe_btn_navigation_prev">' , get_permalink ( $ nextAndPrev [ 'prev' ] ) ) ; printf ( __ ( '&laquo; %1$s %2$s' , 'wp-courseware' ) , __ ( 'Previous' , 'wp-courseware' ) , wpcw_get_unit_label ( ) ) ; printf ( '</a>' ) ; do_action ( 'wpcw_unit_after_previous_unit_button' , $ nextAndPrev [ 'prev' ] , $ this -> unitPost -> ID ) ; } if ( ! $ disableNextButton && $ nextAndPrev [ 'next' ] > 0 ) { do_action ( 'wpcw_unit_before_next_unit_button' , $ nextAndPrev [ 'next' ] , $ this -> unitPost -> ID ) ; printf ( '<a href="%s" class="fe_btn fe_btn_navigation fe_btn_navigation_next">' , get_permalink ( $ nextAndPrev [ 'next' ] ) ) ; printf ( __ ( '%1$s %2$s &raquo;' , 'wp-courseware' ) , __ ( 'Next' , 'wp-courseware' ) , wpcw_get_unit_label ( ) ) ; printf ( '</a>' ) ; do_action ( 'wpcw_unit_after_next_unit_button' , $ nextAndPrev [ 'next' ] , $ this -> unitPost -> ID ) ; } do_action ( 'wpcw_unit_after_previous_next_unit_buttons' , $ nextAndPrev , $ this -> unitPost -> ID ) ; $ html = ob_get_clean ( ) ; if ( $ html ) { return sprintf ( '<div class="wpcw_fe_progress_box_wrap">
				<div class="wpcw_fe_navigation_box">
					%s
				</div>
			</div>' , $ html ) ; } return false ; }
Creates a box to show that a unit has been completed.
Creates a box to show that a unit has been completed .
// Determine if we show the next button or not. // DJH 2015-10-15 - Change how next buttons are shown internally, rather than as a function parameter. // We always show the next button if the completion wall is set to all visible. // If we're not always showing next units, then need to check if next unit is complete // or not. // If this unit isn't completed, then do not show the next button /* translators: %1$s - "Previous" text, %2$s - Unit/Lesson/Lecture/custom label */ // We might manually override the next button here.. /* translators: %1$s - "Next" text, %2$s - Unit/Lesson/Lecture/custom label */ // Only return navigation if we have any links.