LLMS_Widget_Course_Syllabus::form( array $instance )

Back-end widget form.


Description Description

See also See also


Top ↑

Parameters Parameters

$instance

(array) (Required) Previously saved values from database.


Top ↑

Source Source

File: includes/widgets/class.llms.widget.course.syllabus.php

	public function form( $instance ) {

		// Call widget defaults from parent.
		parent::form( $instance );

		$collapse       = ( ! empty( $instance['collapse'] ) ) ? $instance['collapse'] : 0;
		$toggles        = ( ! empty( $instance['toggles'] ) ) ? $instance['toggles'] : 0;
		$toggle_display = ( ! $collapse ) ? ' style="display:none;"' : '';
		?>
		<p>
			<input <?php checked( 1, $collapse ); ?> class="checkbox llms-course-outline-collapse" id="<?php echo $this->get_field_id( 'collapse' ); ?>" name="<?php echo $this->get_field_name( 'collapse' ); ?>" type="checkbox" value="1">
			<label for="<?php echo $this->get_field_id( 'collapse' ); ?>">
				<?php _e( 'Make outline collapsible?', 'lifterlms' ); ?><br>
				<em><?php _e( 'Allow students to hide lessons within a section by clicking the section titles.', 'lifterlms' ); ?></em>
			</label>
		</p>

		<p class="llms-course-outline-toggle-wrapper"<?php echo $toggle_display; ?>>
			<input <?php checked( 1, $toggles ); ?> class="checkbox" id="<?php echo $this->get_field_id( 'toggles' ); ?>" name="<?php echo $this->get_field_name( 'toggles' ); ?>" type="checkbox" value="1">
			<label for="<?php echo $this->get_field_id( 'toggles' ); ?>">
				<?php _e( 'Display open and close all toggles', 'lifterlms' ); ?><br>
				<em><?php _e( 'Display "Open All" and "Close All" toggles at the bottom of the outline.', 'lifterlms' ); ?></em>
			</label>
		</p>
		<?php
	}


Top ↑

User Contributed Notes User Contributed Notes

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