Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added mongoDB-esque theme

Separated the inline css into an external file for easier editing of
overall theme, as well as to include reference to banner image (which
was too large/complex to store as base64 data in php file).
  • Loading branch information...
commit c8dfdc07e2a5123f8693f4faf430919599c4885a 1 parent b239a18
tveatch authored
Showing with 229 additions and 194 deletions.
  1. +168 −0 mongo.css
  2. BIN  mongoDB_Banner.png
  3. +61 −194 mongodbadmin.php
View
168 mongo.css
@@ -0,0 +1,168 @@
+@charset "UTF-8";
+/* CSS Document */
+
+ html{color:#000;background:#FFF;}
+ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;color:#666;}
+ table{border-collapse:collapse;border-spacing:0;}
+ fieldset,img{border:0;}
+ address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
+ li{list-style:none;}
+ caption,th{text-align:left;}
+ h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
+ q:before,q:after{content:'';}
+ abbr,acronym{border:0;font-variant:normal;}
+ sup{vertical-align:text-top;}
+ sub{vertical-align:text-bottom;}
+ input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}
+ input,textarea,select{*font-size:100%;}
+ legend{color:#000;}
+ html { background: #666; font:13px/1.231 "Lucida Grande",verdana,arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
+ table {font-size:inherit;font:100%;}
+ pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+ a:link, a:visited, a:active { text-decoration:none; color:#666; outline:none; border:0; }
+ a:hover { color:#F90; text-decoration:none; border:0; }
+
+ pre {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ padding: 10px;
+ background-color: #222;
+ overflow/**/: auto;
+ margin-bottom: 15px;
+ line-height: 17px;
+ font-size: 13px;
+ color: #fff;
+ font-family: "Bitstream Vera Sans Mono", monospace;
+ white-space: pre-wrap;
+ }
+
+ pre a {
+ color: #fff !important;
+ text-decoration: underline !important;
+ }
+
+ #content {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ padding: 20px;
+ width: 90%;
+ margin-left: auto;
+ margin-right: auto;
+ position:relative;
+ background:#FFF;
+ color: #495a7e;
+ }
+ #content h1 { font-size: 20px; font-weight: bold; margin-bottom: 15px; color:#FBDDA4; }
+ #content h2 { font-size: 14px; font-weight: bold; margin-bottom: 15px; margin-top: 10px; color:#5AAC41; }
+
+ #footer {
+ margin-top: 15px;
+ text-align: center;
+ font-weight: bold;
+ font-size: 10px;
+ color:#FFF;
+ }
+
+ #create_form {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ padding: 15px;
+ background: #5AAC41;
+ width: 400px;
+ float: right;
+ margin-bottom: 10px;
+ }
+ #create_form label {
+ float: left;
+ padding: 4px;
+ font-weight: bold;
+ margin-right: 10px;
+ color:#FFF;
+ }
+ #pager {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ background: #f5f5f5;
+ padding: 8px;
+ margin-bottom: 15px;
+ width: 350px;
+ float: left;
+ }
+ #search {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ background: #F90;
+ padding: 8px;
+ margin-bottom: 15px;
+ width: 500px;
+ float: right;
+ }
+ #mongoLogo{
+ background-image:url(mongoDB_Banner.png);
+ background-repeat:no-repeat;
+ width:200px;
+ height:75px;
+ float:left;
+ margin-left:-32px;
+ }
+ table {
+ background: #000;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ border-collapse: collapse;
+ width: 100%;
+ }
+ table th {
+ color: #fff;
+ font-weight: bold;
+ padding: 8px;
+ }
+ table td {
+ padding: 8px;
+ }
+ table td a {
+ font-weight: bold;
+ }
+ table tbody tr {
+ background-color: #F3F4EB;
+ border-bottom: 1px solid #ccc;
+ }
+ table tbody tr:hover {
+ background-color: #333;
+ }
+ .save_button {
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ background-color: #F90;
+ color: #fff;
+ padding: 4px;
+ font-weight: bold;
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+ .save_button:hover {
+ background-color: #ccc;
+ color: #333;
+ cursor: pointer;
+ }
+ textarea {
+ padding: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ border: 1px solid #ccc;
+ width: 100%;
+ height: 350px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+ .footer{color:#CCC;}
View
BIN  mongoDB_Banner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
255 mongodbadmin.php
@@ -14,7 +14,8 @@
* http://github.com/jwage/php-mongodb-admin
* http://www.twitter.com/jwage
*
- * @author Jonathan H. Wage <jonwage@gmail.com>
+ * @author Jonathan H. Wage <hide@address.com>
+ * @Theme Ted Veatch
*/
header('Pragma: no-cache');
@@ -97,16 +98,16 @@ function linkDocumentReferences($mongo, $document)
$refDb = isset($value['$db']) ? $value['$db'] : $_REQUEST['db'];
- $document[$key]['$ref'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.urlencode($refDb).'&collection='.$value['$ref'].'">'.$value['$ref'].'</a>';
+ $document[$key]['$ref'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.$refDb.'&collection='.$value['$ref'].'">'.$value['$ref'].'</a>';
if ($ref['_id'] instanceof MongoId) {
- $document[$key]['$id'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.urlencode($refDb).'&collection='.$value['$ref'].'&id='.$value['$id'].'">'.$value['$id'].'</a>';
+ $document[$key]['$id'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.$refDb.'&collection='.$value['$ref'].'&id='.$value['$id'].'">'.$value['$id'].'</a>';
} else {
- $document[$key]['$id'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.urlencode($refDb).'&collection='.$value['$ref'].'&id='.$value['$id'].'&custom_id=1">'.$value['$id'].'</a>';
+ $document[$key]['$id'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.$refDb.'&collection='.$value['$ref'].'&id='.$value['$id'].'&custom_id=1">'.$value['$id'].'</a>';
}
if (isset($value['$db'])) {
- $document[$key]['$db'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.urlencode($refDb).'">'.$refDb.'</a>';
+ $document[$key]['$db'] = '<a href="'.$_SERVER['PHP_SELF'].'?db='.$refDb.'">'.$refDb.'</a>';
}
} else {
$document[$key] = linkDocumentReferences($mongo, $value);
@@ -202,9 +203,6 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
$collection = $mongo->selectDB($db)->selectCollection($collection);
if (isset($_REQUEST['custom_id']) || $forceCustomId) {
- if (is_numeric($id)) {
- $id = (int) $id;
- }
$document =$collection->findOne(array('_id' => $id));
} else {
$document = $collection->findOne(array('_id' => new MongoId($id)));
@@ -226,7 +224,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
}
if (isset($document['_id'])) {
- $url = $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
+ $url = $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
if ($customId) {
header('location: ' . $url . '&custom_id=true');
@@ -251,7 +249,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
$mongo->selectDB($_REQUEST['create_db'])->createCollection('__tmp_collection_');
$mongo->selectDB($_REQUEST['create_db'])->dropCollection('__tmp_collection_');
- header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['create_db']));
+ header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['create_db']);
exit;
}
@@ -262,7 +260,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
->selectDB($_REQUEST['db'])
->createCollection($_REQUEST['create_collection']);
- header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['create_collection']);
+ header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['create_collection']);
exit;
}
@@ -273,7 +271,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
->selectCollection($_REQUEST['delete_collection'])
->drop();
- header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']));
+ header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db']);
exit;
}
@@ -282,16 +280,12 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
$collection = $mongo->selectDB($_REQUEST['db'])->selectCollection($_REQUEST['collection']);
if (isset($_REQUEST['custom_id'])) {
- $id = $_REQUEST['delete_document'];
- if (is_numeric($id)) {
- $id = (int) $id;
- }
- $collection->remove(array('_id' => $id));
+ $collection->remove(array('_id' => $_REQUEST['delete_document']));
} else {
$collection->remove(array('_id' => new MongoId($_REQUEST['delete_document'])));
}
- header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection']);
+ header('location: ' . $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection']);
exit;
}
@@ -305,7 +299,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
unset($document[$_REQUEST['delete_document_field']]);
$coll->save($document);
- $url = $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
+ $url = $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
header('location: ' . $url);
exit;
}
@@ -318,7 +312,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
$document = prepareValueForMongoDB($_REQUEST['value']);
$collection->save($document);
- $url = $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
+ $url = $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] . '&id=' . (string) $document['_id'];
header('location: ' . $url . ($customId ? '&custom_id=1' : null));
exit;
}
@@ -333,164 +327,40 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP MongoDB Admin</title>
- <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAABILAAASCwAAAAEAAAABAACObVoAkG5bAJFwXgCVdmYAlXZmAJV2ZgCVdmYAo4h4AKOIeACul4oArpeKALKbjwC5pJkAuaSZALmkmQC5pJkAv62jAMGupADFtasAxbWrAMW1qwDKu7IAz8C4ANLEuwDWysQA1srEANbKxADWysQA3dLMAOXc2ADl3NgA6OLdAOji3QDs5%2BMA7OfjAOzn4wDx7OoA8%2FDuAPr49wD6%2BPcA%2Bvj3APAA6wAA9gAAAQH7AAEHAQATAQ0AARkBACUBHwABKwEAOAEyAAE%2BAQBMAUUAAVIBAGABWQABZwEAdQFuAAF8AQCLAYMAAZIBAKEBmgABqQEAuQGxAAHBAQDRAckAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEDHB0fISQlGBIVFRURAAEBAxwdHyEkJRgSFRUVEQEBAQMcHx8hJSUXFRUVFhAAAQEAGB8hJCUmFxUVFRYMAAEBABUhISQlJhgVFRUXBwEBAQELJCElJiYYFRUVFQMBAQEBByEkJSYmGBUWFwwAAQEBAQEYJSUmJhgVFhcHAQEBAQEBCSYmJiYYFhcQAQEBAQEBAQIYJiYmGBYWAwEBAQEBAQEBByYmJhgXCQEBAQEBAQEBAQEMJiYcDAIBAQEBAQEBAQEBARImEgIBAQEBAQEBAQEBAQEBEQcBAQEBAQEBAQEBAQEBAQICAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%3D" type="image/x-icon" />
- <style type="text/css">
- html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
- html { background: #010410; font:13px/1.231 "Lucida Grande",verdana,arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
- a:link, a:visited, a:active { text-decoration:none; color:#3370C9; outline:none; border:0; }
- a:hover { color: #00508c; text-decoration:underline; border:0; }
-
- pre {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- padding: 10px;
- background-color: #222;
- overflow/**/: auto;
- margin-bottom: 15px;
- line-height: 17px;
- font-size: 13px;
- color: #fff;
- font-family: "Bitstream Vera Sans Mono", monospace;
- white-space: pre-wrap;
- }
-
- pre a {
- color: #fff !important;
- text-decoration: underline !important;
- }
-
- #content {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- margin-top: 20px;
- margin-bottom: 20px;
- padding: 20px;
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- position:relative;
- background:#fff;
- color: #495a7e;
- }
- #content h1 { font-size: 25px; font-weight: bold; margin-bottom: 15px; }
- #content h2 { font-size: 20px; font-weight: bold; margin-bottom: 15px; margin-top: 10px; }
-
- #footer {
- margin-top: 15px;
- text-align: center;
- font-weight: bold;
- font-size: 12px;
- }
-
- #create_form {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- padding: 15px;
- background: #f5f5f5;
- border: 1px solid #ccc;
- width: 400px;
- float: right;
- margin-bottom: 10px;
- }
- #create_form label {
- float: left;
- padding: 4px;
- font-weight: bold;
- margin-right: 10px;
- }
- #pager {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- background: #f5f5f5;
- border: 1px solid #ccc;
- padding: 8px;
- margin-bottom: 15px;
- width: 350px;
- float: left;
- }
- #search {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- background: #f5f5f5;
- border: 1px solid #ccc;
- padding: 8px;
- margin-bottom: 15px;
- width: 400px;
- float: right;
- }
- table {
- background: #333;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- border-collapse: collapse;
- width: 100%;
- }
- table th {
- color: #fff;
- font-weight: bold;
- padding: 8px;
- }
- table td {
- padding: 8px;
- }
- table td a {
- font-weight: bold;
- }
- table tbody tr {
- background-color: #fff;
- border-bottom: 1px solid #ccc;
- }
- table tbody tr:hover {
- background-color: #eee;
- }
- .save_button {
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- background-color: #333;
- border: 1px solid #333;
- color: #fff;
- padding: 4px;
- font-weight: bold;
- padding-left: 10px;
- padding-right: 10px;
- }
- .save_button:hover {
- background-color: #ccc;
- border: 1px solid #ccc;
- color: #333;
- cursor: pointer;
- }
- textarea {
- padding: 10px;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- border: 1px solid #ccc;
- width: 100%;
- height: 350px;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- </style>
+ <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA
+AAAAAAA9Umn/K0Jb/y9FXv8vRV7/L0Ve/y9FXv8vRV7/OU9m/0JWbf8vRV7/L0Ve/y9FXv8vRV7/
+L0Ve/y9FXv8vRV7/LkRe/x83Uv8fN1L/HzdS/x83Uv8fN1L/HzdS/zhOZv9GWnD/HzdS/x83Uv8f
+N1L/HzdS/x83Uv8fN1L/HzdS/y5EXv8fN1L/HzdS/x83Uv8fN1L/HzdS/x83Uv9SbnD/Vm92/x83
+Uv8fN1L/HzdS/x83Uv8fN1L/HzdS/x83Uv8uRF7/HzdS/x83Uv8fN1L/HzdS/x83Uv9MaWX/UKgz
+/0SOJf9NZmn/HzdS/x83Uv8fN1L/HzdS/x83Uv8fN1L/LkRe/x83Uv8fN1L/HzdS/x83Uv86UWP/
+Sqcc/1SsOP9HkiT/QpAe/zNKX/8fN1L/HzdS/x83Uv8fN1L/HzdS/y5EXv8fN1L/HzdS/x83Uv8i
+OVT/VZBF/06pJf9XrkH/SZUo/0OSH/9SfVT/LURa/x83Uv8fN1L/HzdS/x83Uv8uRF7/HzdS/x83
+Uv8fN1L/Ql5g/0qmGf9TrDL/WrFJ/0mWKv9IlSf/SZIt/0NjWv8fN1L/HzdS/x83Uv8fN1L/LkRe
+/x83Uv8fN1L/HzdS/0J0Rf9NqCD/Va05/16yT/9LmCv/SZYo/0mWKf89cED/HzdS/x83Uv8fN1L/
+HzdS/y5EXv8fN1L/HzdS/x83Uv9AeT3/UKko/1evQf9htFX/TZks/0qYKv9KmCn/OnI7/x83Uv8f
+N1L/HzdS/x83Uv8uRF7/HzdS/x83Uv8fN1L/RG1V/0+rLf9asEj/ZbZa/02aLv9MmSz/TJgu/0Rr
+VP8fN1L/HzdS/x83Uv8fN1L/LkRe/x83Uv8fN1L/HzdS/zhTXv9Vqzr/XbJP/2i4X/9OnDD/S5kr
+/1GKR/83UF7/HzdS/x83Uv8fN1L/HzdS/y5EXv8fN1L/HzdS/x83Uv8fN1L/WIxc/16zUf9sumT/
+T50x/0aZJf9GY2L/HzdS/x83Uv8fN1L/HzdS/x83Uv8uRF7/HzdS/x83Uv8fN1L/HzdS/zZOYf9f
+tFT/cLxp/02dLf9WkUr/HzdS/x83Uv8fN1L/HzdS/x83Uv8fN1L/LkRe/x83Uv8fN1L/HzdS/x83
+Uv8fN1L/XXx2/2y8Zf9Qmjj/NEpg/x83Uv8fN1L/HzdS/x83Uv8fN1L/HzdS/y5EXv8fN1L/HzdS
+/x83Uv8fN1L/HzdS/x83Uv9cgnD/Q1tn/x83Uv8fN1L/HzdS/x83Uv8fN1L/HzdS/x83Uv89Umn/
+K0Jb/y9FXv8vRV7/L0Ve/y9FXv8vRV7/OlBl/zRJYf8vRV7/L0Ve/y9FXv8vRV7/L0Ve/y9FXv8v
+RV7/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAA==" type="image/x-icon" />
+ <LINK href="mongo.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="content">
+ <a href="http://docs.mongodb.org"><div id="mongoLogo"></div></a>
<h1>
- PHP MongoDB Admin -
<?php if (is_array($server)): ?>
<?php if (count($server) > 1): ?>
<select id="server" onChange="document.cookie='mongo_server='+this[this.selectedIndex].value;document.location.reload();return false;">
<?php foreach ($server as $key => $s): ?>
- <option value="<?php echo $key ?>"<?php if (isset($_COOKIE['mongo_server']) && $_COOKIE['mongo_server'] == $key): ?> selected="selected"<?php endif; ?>><?php echo preg_replace('/\/\/(.*):(.*)@/', '//$1:*****@', $s); ?></option>
+ <option value="<?php echo $key ?>"<?php if (isset($_COOKIE['mongo_server']) && $_COOKIE['mongo_server'] == $key): ?> selected="selected"<?php endif; ?>><?php echo $s ?></option>
<?php endforeach; ?>
</select>
<?php else: ?>
@@ -516,7 +386,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<label for="create_db_field">Create Database</label>
<input type="text" name="create_db" id="create_db_field" />
- <input type="submit" name="save" value="Save" class="save_button" />
+ <input type="submit" name="save" value="Save" />
</form>
</div>
<?php endif; ?>
@@ -535,11 +405,11 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php $dbs = $mongo->listDBs() ?>
<?php foreach ($dbs['databases'] as $db): if ($db['name'] === 'local' || $db['name'] === 'admin') continue; ?>
<tr>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($db['name']) ?>"><?php echo $db['name'] ?></a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $db['name'] ?>"><?php echo $db['name'] ?></a></td>
<td><?php echo count($mongo->selectDb($db['name'])->listCollections()) ?></td>
<?php if ($readOnly !== true): ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?delete_db=<?php echo urlencode($db['name']) ?>" onClick="return confirm('Are you sure you want to delete this database?');">Delete</a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?delete_db=<?php echo $db['name'] ?>" onClick="return confirm('Are you sure you want to delete this database?');">Delete</a></td>
<?php else: ?>
<td>&nbsp;</td>
<?php endif; ?>
@@ -553,10 +423,10 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php if ($readOnly !== true): ?>
<div id="create_form">
- <form action="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo urlencode($_REQUEST['db']) ?>" method="POST">
+ <form action="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo $_REQUEST['db'] ?>" method="POST">
<label for="create_collection_field">Create Collection</label>
<input type="text" name="create_collection" id="create_collection_field" />
- <input type="submit" name="create" value="Save" class="save_button" />
+ <input type="submit" name="create" value="Save" />
</form>
</div>
<?php endif; ?>
@@ -568,7 +438,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<table>
<thead>
<tr>
- <th>Name</th>
+ <th>Collection Name</th>
<th>Documents</th>
<th></th>
</tr>
@@ -577,11 +447,11 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php $collections = $mongo->selectDB($_REQUEST['db'])->listCollections() ?>
<?php foreach ($collections as $collection): ?>
<tr>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $collection->getName() ?>"><?php echo $collection->getName() ?></a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $collection->getName() ?>"><?php echo $collection->getName() ?></a></td>
<td><?php echo $collection->count(); ?></td>
<?php if ($readOnly !== true): ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo urlencode($_REQUEST['db']) ?>&delete_collection=<?php echo $collection->getName() ?>" onClick="return confirm('Are you sure you want to delete this collection?');">Delete</a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo $_REQUEST['db'] ?>&delete_collection=<?php echo $collection->getName() ?>" onClick="return confirm('Are you sure you want to delete this collection?');">Delete</a></td>
<?php else: ?>
<td>&nbsp;</td>
<?php endif; ?>
@@ -614,8 +484,7 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
->selectCollection($_REQUEST['collection'])
->find()
->limit($limit)
- ->skip($skip)
- ->sort(array('_id' => 1));
+ ->skip($skip);
}
$total = $cursor->count();
@@ -629,14 +498,14 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<h2>
<a href="<?php echo $_SERVER['PHP_SELF'] ?>">Databases</a> >>
- <a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo urlencode($_REQUEST['db']) ?>"><?php echo $_REQUEST['db'] ?></a> >>
+ <a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo $_REQUEST['db'] ?>"><?php echo $_REQUEST['db'] ?></a> >>
<?php echo $_REQUEST['collection'] ?> (<?php echo $cursor->count() ?> Documents)
</h2>
<?php if ($pages > 1): ?>
<div id="pager">
<?php echo $pages ?> pages. Go to page
- <input type="text" name="page" size="4" value="<?php echo $page ?>" onChange="javascript: location.href = '<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?><?php if (isset($_REQUEST['search'])): ?>&search=<?php echo urlencode($_REQUEST['search']) ?><?php endif; ?>&page=' + this.value;" />
+ <input type="text" name="page" size="4" value="<?php echo $page ?>" onChange="javascript: location.href = '<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?><?php if (isset($_REQUEST['search'])): ?>&search=<?php echo urlencode($_REQUEST['search']) ?><?php endif; ?>&page=' + this.value;" />
<input type="button" name="go" value="Go" />
</div>
<?php endif; ?>
@@ -659,9 +528,9 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php foreach ($cursor as $document): ?>
<tr>
<?php if (is_object($document['_id']) && $document['_id'] instanceof MongoId): ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&id=<?php echo (string) $document['_id'] ?>"><?php echo (string) $document['_id'] ?></a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&id=<?php echo (string) $document['_id'] ?>"><?php echo (string) $document['_id'] ?></a></td>
<?php else: ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&id=<?php echo (string) $document['_id'] ?>&custom_id=1"><?php echo (string) $document['_id'] ?></a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&id=<?php echo (string) $document['_id'] ?>&custom_id=1"><?php echo (string) $document['_id'] ?></a></td>
<?php endif; ?>
<td>
<?php
@@ -694,9 +563,9 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
?>
</td>
<?php if (is_object($document['_id']) && $document['_id'] instanceof MongoId && $readOnly !== true): ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a></td>
<?php elseif ($readOnly !== true): ?>
- <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>&custom_id=1" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a></td>
+ <td><a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>&custom_id=1" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
@@ -718,9 +587,8 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php endforeach; ?>
<h2>Create New Document</h2>
- <input type="submit" name="save" value="Save" class="save_button" />
<textarea name="value"></textarea>
- <input type="submit" name="save" value="Save" class="save_button" />
+ <input type="submit" name="save" value="Save" />
</form>
<?php endif; ?>
@@ -729,8 +597,8 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<h2>
<a href="<?php echo $_SERVER['PHP_SELF'] ?>">Databases</a> >>
- <a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo urlencode($_REQUEST['db']) ?>"><?php echo $_REQUEST['db'] ?></a> >>
- <a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>"><?php echo $_REQUEST['collection'] ?></a> >>
+ <a href="<?php echo $_SERVER['PHP_SELF'] ?>?db=<?php echo $_REQUEST['db'] ?>"><?php echo $_REQUEST['db'] ?></a> >>
+ <a href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>"><?php echo $_REQUEST['collection'] ?></a> >>
<?php echo $_REQUEST['id'] ?>
</h2>
<?php $document = findMongoDbDocument($_REQUEST['id'], $_REQUEST['db'], $_REQUEST['collection']); ?>
@@ -748,22 +616,21 @@ function findMongoDbDocument($id, $db, $collection, $forceCustomId = false)
<?php endforeach; ?>
<h2>Edit Document</h2>
- <input type="submit" name="save" value="Save" class="save_button" />
<textarea name="value"><?php echo var_export($prepared, true) ?></textarea>
- <input type="submit" name="save" value="Save" class="save_button" />
+ <input type="submit" name="save" value="Save" />
</form>
<?php endif; ?>
<br/>
<?php if (is_object($document['_id']) && $document['_id'] instanceof MongoId && $readOnly !== true): ?>
- <a class="save_button" href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a>
+ <a class="save_button" href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a>
<?php elseif ($readOnly !== true): ?>
- <a class="save_button" href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . urlencode($_REQUEST['db']) . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>&custom_id=1" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a>
+ <a class="save_button" href="<?php echo $_SERVER['PHP_SELF'] . '?db=' . $_REQUEST['db'] . '&collection=' . $_REQUEST['collection'] ?>&delete_document=<?php echo (string) $document['_id'] ?>&custom_id=1" onClick="return confirm('Are you sure you want to delete this document?');">Delete</a>
<?php endif; ?>
<?php endif; ?>
<?php // END ACTION TEMPLATES ?>
- <p id="footer">Created by <a href="http://www.twitter.com/jwage" target="_BLANK">Jonathan H. Wage</a></p>
+ <p id="footer"><sapn class="footer">Created by <a href="http://www.twitter.com/jwage" target="_BLANK">Jonathan H. Wage</a> | Theme by Ted Veatch</span></p>
</div>
</body>
-</html>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.