Exemple #1
0
function treeNavToSideMenu($treeNav, $idCurrent)
{
    $res = '';
    $res .= '<ul>';
    foreach ($treeNav as $id => $content) {
        $current = '';
        if ($idCurrent == $id) {
            $current = 'current';
        }
        $plus = 'direct';
        if ($content['child'] != null) {
            $plus = 'plus';
        }
        if ($content['child'] != null && (multi_array_key_exists($idCurrent, $content['child']) !== false || $idCurrent == $id)) {
            $state = 'open';
        } else {
            $state = 'closed';
        }
        $res .= '<li class="' . $state . ' ' . $current . ' ' . $plus . '"><a href="' . site_url($content['url']) . '">' . htmlspecialchars($content['title']) . '</a>';
        if ($content['child'] != null) {
            $res .= treeNavToSideMenu($content['child'], $idCurrent);
        }
        $res .= '</li>';
    }
    $res .= '</ul>';
    return $res;
}
Exemple #2
0
        echo $version['version'];
        ?>
</a></li>
			<?php 
    }
    ?>
			</ul>
		<?php 
} else {
    ?>
		
		
		
		<?php 
    if ($infos['type'] == 2) {
        echo '<div id="tree">' . treeNavToSideMenu($treeNav, $infos['id']) . '</div>';
    } else {
        echo '<div class="listSide">';
        echo '<h4>' . ($infos['type'] == 1 ? 'Les dernières actualités' : 'Les derniers articles') . '</h4>';
        echo '<ul>';
        foreach ($lastSide as $news) {
            echo '<li><a href="' . site_url($news['url']) . '">' . htmlspecialchars($news['title']) . '</a></li>';
        }
        echo '</ul>';
        echo '</div>';
    }
    ?>
		
		<?php 
}
?>