<commit_before><?php defined('C5_EXECUTE') or die("Access Denied."); ?>

<?php

$navItems = $controller->getNavItems();

foreach ($navItems as $ni) {
    $classes = array();

    if ($ni->isCurrent || $ni->inPath) {
        //class for the page currently being viewed
        $classes[] = 'active';
    }

    if ($ni->hasSubmenu) {
        //class for items that have dropdown sub-menus
        $classes[] = 'dropdown';
    }
 
    //Put all classes together into one space-separated string
    $ni->classes = implode(" ", $classes);
}

echo '<ul class="nav navbar-nav">'; //opens the top-level menu

foreach ($navItems as $ni) {

    echo '<li class="' . $ni->classes . '">'; //opens a nav item
    $name = (isset($translate) && $translate == true) ? t($ni->name) : $ni->name;
    echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">';
    echo $name;
    if ($ni->hasSubmenu) {
        echo '<span class="caret"></span>';
    }
    echo '</a>';

    if ($ni->hasSubmenu) {
        echo '<ul class="dropdown-menu multi-level">'; //opens a dropdown sub-menu
    } else {
        echo '</li>'; //closes a nav item
        echo str_repeat('</ul></li>', $ni->subDepth); //closes dropdown sub-menu(s) and their top-level nav item(s)
    }
}

echo '</ul></nav>'; //closes the top-level menu<commit_msg>Fix worldskills_nav template<commit_after><?php defined('C5_EXECUTE') or die("Access Denied."); ?>

<?php

$navItems = $controller->getNavItems();

foreach ($navItems as $ni) {
    $classes = array();

    if ($ni->isCurrent || $ni->inPath) {
        //class for the page currently being viewed
        $classes[] = 'active';
    }

    if ($ni->hasSubmenu) {
        //class for items that have dropdown sub-menus
        $classes[] = 'dropdown';
    }
 
    //Put all classes together into one space-separated string
    $ni->classes = implode(" ", $classes);
}

echo '<ul class="nav navbar-nav">'; //opens the top-level menu

foreach ($navItems as $ni) {

    echo '<li class="' . $ni->classes . '">'; //opens a nav item
    $name = (isset($translate) && $translate == true) ? t($ni->name) : $ni->name;
    echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">';
    echo $name;
    if ($ni->hasSubmenu) {
        echo '<span class="caret"></span>';
    }
    echo '</a>';

    if ($ni->hasSubmenu) {
        echo '<ul class="dropdown-menu multi-level">'; //opens a dropdown sub-menu
    } else {
        echo '</li>'; //closes a nav item
        echo str_repeat('</ul></li>', $ni->subDepth); //closes dropdown sub-menu(s) and their top-level nav item(s)
    }
}

echo '</ul>'; //closes the top-level menu
{'fraction_non_alphanumeric': 0.20313082370480806, 'fraction_numerical': 0.0007454342154304882, 'mean_word_length': 2.6666666666666665, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '944', 'n_tokens_mistral': 885, 'n_tokens_neox': 860, 'n_words': 251}