<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "C:/wamp/www/sb/core2/admin/lib/viewer_functions.php";

  list($categoryRecords, $selectedCategory) = getCategories(array(
    'tableName'           => 'category',
    'selectedCategoryNum' => '',         // defaults to getNumberFromEndOfUrl()
    'categoryFormat'      => 'showall',  // showall, onelevel, twolevel
  ));

?>
<?php echo "<?xml version='1.0'?>\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <style type="text/css">
    body          { font-family: arial; }
  </style>
 </head>
<body>

<table border="0" cellspacing="0" cellpadding="2"><tr><td valign="top" width="200">

  <!-- category menu -->
    <h3>Nested Menu</h3>
    <?php foreach ($categoryRecords as $categoryRecord): ?>

      <?php echo str_repeat("&nbsp; &nbsp; &nbsp;", $categoryRecord['depth']); ?>

      <?php if ($categoryRecord['_isSelected']): ?><b><?php endif; ?>
      <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
      <?php if ($categoryRecord['_isSelected']): ?></b><?php endif; ?>
      <br/>
    <?php endforeach; ?>
  <!-- /category menu -->

  <br/><br/>

  <h3>Unorder List Menu</h3>
  <!-- unordered list -->
  <ul>
  <?php foreach ($categoryRecords as $categoryRecord): ?>
    <?php echo $categoryRecord['_listItemStart'] ?>

    <?php if ($categoryRecord['_isSelected']): ?>
      <b><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></b>
    <?php else: ?>
      <a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
    <?php endif; ?>

    <?php echo $categoryRecord['_listItemEnd'] ?>
  <?php endforeach; ?>
  </ul>
  <!-- /unordered list -->


</td><td valign="top">

  <?php if (!$selectedCategory): ?>
    No record selected
  <?php endif; ?>

  <?php if ($selectedCategory): ?>

    <h3><?php echo $selectedCategory['name'] ?></h3>
    <?php echo $selectedCategory['content'] ?>

  <?php endif; ?>

</td></tr></table>




</body>
</html>
