Advertisement
Guest User

Untitled

a guest
Mar 21st, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. function render($page)
  4. {
  5.     echo '<li>';
  6.     echo HTML::anchor($page->uri, $page->nav);
  7.         if ($page->has_children())
  8.         {
  9.             echo '<ul>';
  10.             foreach ($page->children() as $c):
  11.                 render($c);
  12.             endforeach;
  13.             echo '</ul>';
  14.         }
  15.     echo '</li>';
  16. } // End render
  17.  
  18. ?>
  19. <div class="navigation">
  20.     <ul id="jMenu">
  21.     <?php foreach ($pages as $p):
  22.         if ($p->is_root()): ?>
  23.         <li>
  24.             <?php echo HTML::anchor($p->uri, $p->nav, array('class' => 'fNiv'));
  25.             if ($p->has_children()): ?>
  26.             <ul>
  27.                 <li class="arrow"></li>
  28.                 <?php foreach ($p->children() as $c):
  29.                     render($c);
  30.                  endforeach; ?>
  31.             </ul>  
  32.             <?php endif; ?>
  33.         </li>
  34.         <?php endif;
  35.     endforeach; ?>
  36.     </ul>
  37. </div><!-- End navigation -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement