page.php 521 B

123456789101112131415161718192021
  1. <?php
  2. $params = array();
  3. $params['name'] = 'sandbox_page';
  4. $params['menu'] = array();
  5. $params['menu']['default'] = array();
  6. for ($i = 1; $i <= 5; $i++) {
  7. $params['menu']['default'][] = new ElggMenuItem($i, "Page $i", "#");
  8. }
  9. $params['menu']['default'][2]->setSelected(true);
  10. $m = new ElggMenuItem(10, "Child", "#");
  11. $m->setParent($params['menu']['default'][1]);
  12. $params['menu']['default'][1]->addChild($m);
  13. ?>
  14. <div class="theme-sandbox-demo-sidebar">
  15. <?php
  16. echo elgg_view('navigation/menu/page', $params);
  17. ?>
  18. </div>