LLMS_Admin_Builder::output()

Output the page content


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.builder.php

551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
*/
public static function output() {
 
    global $post;
 
    $course_id = isset( $_GET['course_id'] ) ? absint( $_GET['course_id'] ) : null;
    if ( ! $course_id || ( $course_id && 'course' !== get_post_type( $course_id ) ) ) {
        _e( 'Invalid course ID', 'lifterlms' );
        return;
    }
 
    $post = get_post( $course_id );
 
    $course = llms_get_post( $post );
 
    if ( ! current_user_can( 'edit_course', $course_id ) ) {
        _e( 'You cannot edit this course!', 'lifterlms' );
        return;
    }
 
    remove_all_actions( 'the_title' );
    remove_all_actions( 'the_content' );
 
    global $llms_builder_lazy_load;
    $llms_builder_lazy_load = true;
    ?>
 
    <div class="wrap lifterlms llms-builder">
 
        <?php do_action( 'llms_before_builder', $course_id ); ?>
 
        <div class="llms-builder-main" id="llms-builder-main"></div>
 
        <aside class="llms-builder-sidebar" id="llms-builder-sidebar"></aside>
 
        <?php
            $templates = array(
                'assignment',
                'course',
                'editor',
                'elements',
                'lesson',
                'lesson-settings',
                'quiz',
                'question',
                'question-choice',
                'question-type',
                'section',
                'settings-fields',
                'sidebar',
                'utilities',
                'video-explainer',
            );
 
            foreach ( $templates as $template ) {
                echo self::get_template(
                    $template,
                    array(
                        'course_id' => $course_id,
                    )
                );
            }
 
            ?>
 
        <script>window.llms_builder =
        <?php
        echo json_encode(
            /**
             * Filters the settings passed to the builder.
             *
             * @since 7.2.0
             *
             * @param array $settings Associative array of settings passed to the LifterLMS course builder.
             */
            apply_filters(
                'llms_builder_settings',
                array(
                    'autosave'               => self::get_autosave_status(),
                    'admin_url'              => admin_url(),
                    'course'                 => $course->toArray(),
                    'debug'                  => array(
                        'enabled' => ( defined( 'LLMS_BUILDER_DEBUG' ) && LLMS_BUILDER_DEBUG ),
                    ),
                    'questions'              => array_values( llms_get_question_types() ),
                    'schemas'                => self::get_custom_schemas(),
                    'sync'                   => apply_filters(
                        /**
                         * Filters the sync builder settings.
                         *
                         * @since 3.16.0
                         *
                         * @param array $settings Associative array of settings passed to the LifterLMS course builder used for the sync.
                         */
                        'llms_builder_sync_settings',


Top ↑

Changelog Changelog

Changelog
Version Description
4.14.0 Added builder autosave preference defaults.
3.19.2 Unknown.
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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