Skip to content

Commit 79b6cc8

Browse files
committed
Fixed bugs regarding empty databases
1 parent 16acb3c commit 79b6cc8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

views/generalmodals.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@
5454
<label class="control-label" for="inputEmail">Database: </label>
5555
<div class="controls">
5656
<select name="dbIdx" id="dbIdx">
57+
<?php if (isset($this->app->current['dbs']) && !empty($this->app->current['dbs'])): ?>
5758
<?php for ($x=0; $x < $this->app->current['max_databases']; $x++): ?>
5859
<?php if (!array_key_exists($x, $this->app->current['dbs'])): ?>
5960
<option value='<?=$x?>'>DB <?=$x?></option>
6061
<?php endif; ?>
61-
<?php endfor; ?>
62+
<?php endfor; ?>
63+
<?php endif; ?>
6264
</select>
6365
</div>
6466
</div>

views/navigation.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
</ul>
99
<div class="tabbable tabs-left" id="dbTabs">
1010
<ul class="nav nav-tabs">
11+
<?php if (isset($this->app->current['dbs']) && !empty($this->app->current['dbs'])): ?>
1112
<?php foreach ($this->app->current['dbs'] as $database): ?>
1213
<li class="database <?= ($database['id'] == $this->app->current['database'] ? 'active':null) ?>">
1314
<a href="<?=$this->router->url?>/welcome/index/<?= $this->app->current['serverId'] . '/' . $database['id'] ?>">
1415
<?= ($database['name'] !== null ? $database['name'] : "DB ".$database['id']) ?>
1516
<span class="label pull-right" title="Number of keys"><?= $database['keys'] ?></span>
1617
</a>
1718
</li>
18-
<?php endforeach; if ($this->app->current['newDB']): ?>
19+
<?php endforeach; endif; if ($this->app->current['newDB']): ?>
1920
<li class="database active">
2021
<a href="<?=$this->router->url?>/welcome/index/<?= $this->app->current['serverId'] . '/' . $this->app->current['database'] ?>">
2122
<i class="icon-plus"></i> DB <?=$this->app->current['database']?>

0 commit comments

Comments
 (0)