<?php $url = str_replace('admin.', '', $request->base()); ?>

<div class="panel">
    <div class="title">
        Edit Menu - <a target="_blank" href="<?php echo htmlspecialchars($url); ?><?php echo htmlspecialchars($form->alias); ?>">View</a>
    </div>
    <div class="content clear">
        <div>
            <?php echo $form->render(array('method' => 'post', 'id' => 'menu_item_edit_form')); ?>
        </div>
        <div>
        </div>
    </div>
</div>

<div>
    <a href="menu_item/index/<?php echo htmlspecialchars($form->menu_id); ?>">Cancel</a>
</div>

<script type="text/javascript">
    $('#menu_item_edit_form input[name=name]').bind('keyup', function() {
        $('#menu_item_edit_form input[name=alias]').val($(this).val().replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s\\\/]/g, '-').toLowerCase());
    });
</script>
