| @@ -1,62 +1,88 @@ | ||
| 1 | 1 | <?php |
| 2 | - /** | |
| 3 | - * The template for single doc page | |
| 4 | - * | |
| 5 | - * @author WPDeveloper | |
| 6 | - * @package Documentation/SinglePage | |
| 7 | - */ | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 3 | + | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | +/** | |
| 8 | + * The template for single doc page | |
| 9 | + * | |
| 10 | + * @author WPDeveloper | |
| 11 | + * @package Documentation/SinglePage | |
| 12 | + */ | |
| 8 | 13 | |
| 9 | - get_header(); | |
| 14 | + get_header(); | |
| 10 | 15 | |
| 11 | - $view_object = betterdocs()->views; | |
| 12 | - $enable_toc = betterdocs()->settings->get( 'enable_toc' ); | |
| 13 | - $collapsible_toc_mobile = betterdocs()->settings->get( 'collapsible_toc_mobile' ); | |
| 14 | - $enable_sidebar_cat_list = betterdocs()->settings->get( 'enable_sidebar_cat_list' ); | |
| 16 | + $view_object = betterdocs()->views; | |
| 17 | + $enable_toc = betterdocs()->settings->get( 'enable_toc' ); | |
| 18 | + $collapsible_toc_mobile = betterdocs()->settings->get( 'collapsible_toc_mobile' ); | |
| 19 | + $enable_sidebar_cat_list = betterdocs()->settings->get( 'enable_sidebar_cat_list' ); | |
| 15 | 20 | |
| 16 | - $wrapper_class = ['betterdocs-content-full']; | |
| 21 | + $wrapper_class = [ 'betterdocs-content-full' ]; | |
| 17 | 22 | |
| 18 | - if ( $enable_sidebar_cat_list == 1 && $enable_toc == 1 ) { | |
| 19 | - $wrapper_class[] = 'grid-col-3 sidebar-toc-enable'; | |
| 20 | - } elseif ( $enable_sidebar_cat_list == 1 ) { | |
| 21 | - $wrapper_class[] = 'grid-col-2 sidebar-enable'; | |
| 22 | - } elseif ( $enable_toc == 1 ) { | |
| 23 | - $wrapper_class[] = 'grid-col-2 toc-enable'; | |
| 24 | - } elseif ( ! $enable_sidebar_cat_list && ! $enable_toc ) { | |
| 25 | - $wrapper_class[] = 'grid-col-1 content-enable'; | |
| 26 | - } | |
| 23 | +if ( $enable_sidebar_cat_list == 1 && $enable_toc == 1 ) { | |
| 24 | + $wrapper_class[] = 'grid-col-3 sidebar-toc-enable'; | |
| 25 | +} elseif ( $enable_sidebar_cat_list == 1 ) { | |
| 26 | + $wrapper_class[] = 'grid-col-2 sidebar-enable'; | |
| 27 | +} elseif ( $enable_toc == 1 ) { | |
| 28 | + $wrapper_class[] = 'grid-col-2 toc-enable'; | |
| 29 | +} elseif ( ! $enable_sidebar_cat_list && ! $enable_toc ) { | |
| 30 | + $wrapper_class[] = 'grid-col-1 content-enable'; | |
| 31 | +} | |
| 27 | 32 | |
| 28 | 33 | ?> |
| 29 | 34 | <div class="betterdocs-wrapper betterdocs-fluid-wrapper betterdocs-single-wrapper betterdocs-single-layout-5 betterdocs-single-modern-layout betterdocs-single-wraper"> |
| 30 | - <?php betterdocs()->template_helper->search();?> | |
| 31 | - <div class="<?php echo implode( ' ', $wrapper_class ); ?>"> | |
| 32 | - <div class="betterdocs-content-wrapper betterdocs-display-flex"> | |
| 33 | - <?php $view_object->get( 'templates/sidebars/sidebar-5' );?> | |
| 34 | - <div id="betterdocs-single-main" class="betterdocs-content-area"> | |
| 35 | - <div class="betterdocs-content-inner-area"> | |
| 36 | - <div class="doc-single-content-wrapper"> | |
| 37 | - <?php | |
| 38 | - while ( have_posts() ): the_post(); | |
| 39 | - /** | |
| 40 | - * Headers | |
| 41 | - */ | |
| 42 | - $view_object->get( 'templates/headers/layout-4' ); | |
| 43 | - $view_object->get( 'templates/contents/layout-2' ); | |
| 44 | - $view_object->get( 'templates/footer' ); | |
| 45 | - endwhile; | |
| 46 | - $view_object->get( 'templates/parts/navigation' ); | |
| 47 | - $view_object->get( 'templates/parts/credit' ); | |
| 48 | - $view_object->get( 'templates/parts/comment' ); | |
| 49 | - ?> | |
| 50 | - </div> | |
| 51 | - </div> <!-- #main --> | |
| 52 | - </div> | |
| 53 | - <?php | |
| 54 | - if ( $enable_toc ) { | |
| 55 | - $view_object->get( 'templates/sidebars/sidebar-right' ); | |
| 56 | - } | |
| 57 | - ?> | |
| 58 | - </div> | |
| 59 | - </div> <!-- #primary --> | |
| 35 | + <?php betterdocs()->template_helper->search(); ?> | |
| 36 | + <div class="<?php echo esc_html( implode( ' ', $wrapper_class ) ); ?>"> | |
| 37 | + <div class="betterdocs-content-wrapper betterdocs-display-flex"> | |
| 38 | + <?php | |
| 39 | + betterdocs()->views->get( | |
| 40 | + 'templates/sidebars/sidebar-5', | |
| 41 | + [ | |
| 42 | + 'layout_type' => 'template' | |
| 43 | + ] | |
| 44 | + ); | |
| 45 | + ?> | |
| 46 | + <div id="betterdocs-single-main" class="betterdocs-content-area"> | |
| 47 | + <div class="betterdocs-content-inner-area"> | |
| 48 | + <div class="doc-single-content-wrapper"> | |
| 49 | + <?php | |
| 50 | + while ( have_posts() ) : | |
| 51 | + the_post(); | |
| 52 | + $view_object->get( 'templates/parts/breadcrumbs' ); | |
| 53 | + /** | |
| 54 | + * Headers | |
| 55 | + */ | |
| 56 | + $view_object->get( | |
| 57 | + 'templates/parts/mobile-nav', | |
| 58 | + [ | |
| 59 | + 'mobile_sidebar' => true, | |
| 60 | + 'mobile_toc' => true | |
| 61 | + ] | |
| 62 | + ); | |
| 63 | + $view_object->get( 'templates/headers/layout-4' ); | |
| 64 | + $author = betterdocs()->customizer->defaults->get( 'betterdocs_doc_author_enable' ); | |
| 65 | + $updated_date = betterdocs()->customizer->defaults->get( 'betterdocs_doc_author_date' ); | |
| 66 | + if ( $author ) { | |
| 67 | + $view_object->get( 'templates/parts/author', [ 'updated_date' => $updated_date ] ); | |
| 68 | + } | |
| 69 | + $view_object->get( 'templates/contents/layout-2' ); | |
| 70 | + $view_object->get( 'templates/footer' ); | |
| 71 | + endwhile; | |
| 72 | + $view_object->get( 'templates/parts/navigation' ); | |
| 73 | + $view_object->get( 'templates/parts/credit' ); | |
| 74 | + $view_object->get( 'templates/parts/comment' ); | |
| 75 | + ?> | |
| 76 | + </div> | |
| 77 | + </div> <!-- #main --> | |
| 78 | + </div> | |
| 79 | + <?php | |
| 80 | + if ( $enable_toc ) { | |
| 81 | + $view_object->get( 'templates/sidebars/sidebar-right' ); | |
| 82 | + } | |
| 83 | + ?> | |
| 84 | + </div> | |
| 85 | + </div> <!-- #primary --> | |
| 60 | 86 | </div> <!-- .betterdocs-single-wraper --> |
| 61 | 87 | <?php |
| 62 | 88 | get_footer(); |