$args = array(
'name' => '',
'multiple' => true,
'leadingOptions' => array(),
'optgroups' => array('group 1' => array('label' => 'g1o1', 'value' => 'grp 1 opt 1'),
'group 2' => array(),),
'options' => array('value1' => 'text1', 'value2' => 'text2', 'value3' => 'text3'),
'value' => array('value2', 'value3') //if (multiple==false) 'value' => (str) 'value3'
);
if (!isset($_SESSION['user'])) { echo $form->getFormOpen(); echo $html->div($form->getInput(array('name' => 'username', 'focus' => true))); echo $html->div($form->getInput(array('type' => 'password', 'name' => 'password'))); echo $html->div($form->getInput(array('type' => 'submit', 'value' => 'Login', 'class' => 'ui-state-hover'))); echo $form->getFormClose(); exit(0); } } echo '<div id="dbcollnav">'; $formArgs = array('method' => 'get'); if (isset($mo->mongo['repairDb'])) { $formArgs['alert'] = isset($mo->mongo['repairDb']['ok']) && $mo->mongo['repairDb']['ok'] ? 'Database has been repaired and compacted' : 'Database could not be repaired'; } echo $form->getFormOpen($formArgs); echo $html->div($form->getSelect(array('name' => 'db', 'options' => $mo->mongo['dbs'], 'label' => '', 'value' => $db, 'addBreak' => false)) . $form->getInput(array('type' => 'submit', 'value' => 'Change database', 'class' => 'ui-state-hover')) . ' <span style="font-size: xx-large;">' . get::htmlentities($db) . '</span> [' . $html->link("javascript: mo.repairDatabase('" . get::htmlentities($db) . "'); void(0);", 'repair database') . '] [' . $html->link("javascript: mo.dropDatabase('" . get::htmlentities($db) . "'); void(0);", 'drop database') . ']'); echo $form->getFormClose() . $html->jsInline('var mo = {} mo.urlEncode = function(str) { return escape(str)' . '.replace(/\\+/g, "%2B").replace(/%20/g, "+").replace(/\\*/g, "%2A").replace(/\\//g, "%2F").replace(/@/g, "%40"); } mo.repairDatabase = function(db) { mo.confirm("Are you sure that you want to repair and compact the " + db + " database?", function() { window.location.replace("' . $baseUrl . '?db=' . $dbUrl . '&action=repairDb"); }); } mo.dropDatabase = function(db) { mo.confirm("Are you sure that you want to drop the " + db + " database?", function() { mo.confirm("All the collections in the " + db + " database will be lost along with all the data within them!' . '\\n\\nAre you 100% sure that you want to drop this database?' . '\\n\\nLast chance to cancel!", function() { window.location.replace("' . $baseUrl . '?db=' . $dbUrl . '&action=dropDb"); }); });
if (!isset($_SESSION['user'])) { echo $form->getFormOpen(); echo $html->div($form->getInput(array('name' => 'username', 'focus' => true))); echo $html->div($form->getInput(array('type' => 'password', 'name' => 'password'))); echo $html->div($form->getInput(array('type' => 'submit', 'value' => 'Login', 'class' => 'ui-state-hover'))); echo $form->getFormClose(); exit(0); } } echo '<div id="dbcollnav">'; $formArgs = array('method' => 'get'); if (isset($mo->mongo['repairDb'])) { $formArgs['alert'] = isset($mo->mongo['repairDb']['ok']) && $mo->mongo['repairDb']['ok'] ? 'Database has been repaired and compacted' : 'Database could not be repaired'; } echo $form->getFormOpen($formArgs); echo $html->div($form->getSelect(array('name' => 'db', 'options' => $mo->mongo['dbs'], 'label' => '', 'value' => $db, 'addBreak' => false)) . $form->getInput(array('type' => 'submit', 'value' => 'Change database', 'class' => 'ui-state-hover')) . ' <span style="font-size: xx-large;">' . get::htmlentities($db) . '</span> [' . $html->link("javascript: mo.repairDatabase('" . get::htmlentities($db) . "'); void(0);", 'repair database') . '] [' . $html->link("javascript: mo.dropDatabase('" . get::htmlentities($db) . "'); void(0);", 'drop database') . ']'); echo $form->getFormClose() . $html->jsInline('var mo = {} mo.urlEncode = function(str) { return escape(str)' . '.replace(/\\+/g, "%2B").replace(/%20/g, "+").replace(/\\*/g, "%2A").replace(/\\//g, "%2F").replace(/@/g, "%40"); } mo.repairDatabase = function(db) { mo.confirm("Are you sure that you want to repair and compact the " + db + " database?", function() { window.location.replace("' . $baseUrl . '?db=' . $dbUrl . '&action=repairDb"); }); } mo.dropDatabase = function(db) { mo.confirm("Are you sure that you want to drop the " + db + " database?", function() { mo.confirm("All the collections in the " + db + " database will be lost along with all the data within them!' . '\\n\\nAre you 100% sure that you want to drop this database?' . '\\n\\nLast chance to cancel!", function() { window.location.replace("' . $baseUrl . '?db=' . $dbUrl . '&action=dropDb"); }); });