<ul>
    <li class="title">
        <img src="admin/skin/icon/folder1.png" /><br />
        <?php echo htmlspecialchars(ucfirst($menu['name'])); ?>
    </li>
    <li class="menu_item_add"><a href="menu_item/add/<?php echo htmlspecialchars($menu['id']); ?>">Add item</a></li>
</ul>
<?php
$template = '
    <div class="menu_item_type">
        <ul>
';

foreach ($menu_item_type as $mit) {
    $template .= '
        <li>
            <a href="menu_item/add/' . htmlspecialchars($menu['id']) . '/' . htmlspecialchars($mit['id']) . '">' . htmlspecialchars($mit['name']) . '</a><br />
            <span>' . htmlspecialchars($mit['description']) . '</span>
        </li>
    ';
}

$template .= '
        </ul>
    </div>
';
?>
<script type="text/javascript">
    $(document).ready(function() {
        $('#menu .menu_item_add a').click(function() {
            $.facebox('<?php echo str_replace(array("\rn", "\r", "\n"), ' ', addslashes($template)); ?>');
            return false;
        });
    });
</script>
