$url .= '&collection=' . urlencode($collection);
    }
    echo $form->open(array('action' => $url, 'style' => 'width: 80px; height: 20px;')) . $form->input(array('name' => 'limit', 'value' => $_SESSION['limit'], 'label' => '', 'addBreak' => false, 'style' => 'width: 40px;')) . $form->submit(array('value' => 'limit', 'class' => 'ui-state-hover')) . $form->close();
    echo '</div>';
}
echo '</div>';
//end of dbcollnav
$dbcollnavJs = '$("#dbcollnav").after(\'<a id="dbcollnavlink" href="javascript: $(\\\'#dbcollnav\\\').show();' . ' $(\\\'#dbcollnavlink\\\').hide(); void(0);">[Show Database &amp; Collection selection]</a>\').hide();';
if (isset($mo->mongo['listRows'])) {
    echo $form->open(array('action' => $baseUrl . '?db=' . $dbUrl . '&action=renameCollection', 'style' => 'width: 600px; display: none;', 'id' => 'renamecollectionform')) . $form->hidden(array('name' => 'collectionfrom', 'value' => $collection)) . $form->input(array('name' => 'collectionto', 'value' => $collection, 'label' => '', 'addBreak' => false)) . $form->submit(array('value' => 'Rename Collection', 'class' => 'ui-state-hover')) . $form->close();
    $js = "\$('#collectionname').hide(); \$('#renamecollectionform').show(); void(0);";
    echo '<h1 id="collectionname">' . $html->link('javascript: ' . $js, $collection) . '</h1>';
    if (isset($mo->mongo['listIndexes'])) {
        echo '<ol id="indexes" style="display: none; margin-bottom: 10px;">';
        echo $form->open(array('method' => 'get'));
        echo '<div id="indexInput">' . $form->input(array('name' => 'index[]', 'label' => '', 'addBreak' => false)) . $form->checkboxes(array('name' => 'isdescending[]', 'options' => array('Descending'))) . '</div>' . '<a id="addindexcolumn" style="margin-left: 160px;" href="javascript: ' . "\$('#addindexcolumn').before('<div>' + \$('#indexInput').html().replace(/isdescending_Descending/g, " . "'isdescending_Descending' + mo.indexCount++) + '</div>'); void(0);" . '">[Add another index field]</a>' . $form->radios(array('name' => 'unique', 'options' => array('Index', 'Unique'), 'value' => 'Index')) . $form->submit(array('value' => 'Add new index', 'class' => 'ui-state-hover')) . $form->hidden(array('name' => 'action', 'value' => 'ensureIndex')) . $form->hidden(array('name' => 'db', 'value' => get::htmlentities($db))) . $form->hidden(array('name' => 'collection', 'value' => $collection)) . $form->close();
        foreach ($mo->mongo['listIndexes'] as $indexArray) {
            $index = '';
            foreach ($indexArray['key'] as $key => $direction) {
                $index .= !$index ? $key : ', ' . $key;
                if (!is_object($direction)) {
                    $index .= ' [' . ($direction == -1 ? 'desc' : 'asc') . ']';
                }
            }
            if (isset($indexArray['unique']) && $indexArray['unique']) {
                $index .= ' [unique]';
            }
            if (key($indexArray['key']) != '_id' || count($indexArray['key']) !== 1) {
                $index = '[' . $html->link($baseUrl . '?db=' . $dbUrl . '&collection=' . urlencode($collection) . '&action=deleteIndex&index=' . serialize($indexArray['key']), 'X', array('title' => 'Drop Index', 'onclick' => "mo.confirm.href=this.href; " . "mo.confirm('Are you sure that you want to drop this index?', " . "function() {window.location.replace(mo.confirm.href);}); return false;")) . '] ' . $index;
            }
            echo '<li>' . $index . '</li>';