public function getCollectonList() { $chttp = new Chttp(); $db = $chttp->getParam('db'); if (!empty($db)) { $model = new Model(); $collections = $model->listCollections($db, TRUE); $collectionList = array(); foreach ($collections as $collection) { $collectionList[] = array('name' => $collection->getName(), 'count' => $collection->count()); } return $collectionList; } else { return FALSE; } }
<?php defined('PMDDA') or die('Restricted access'); ?> <div class="sidebar-nav"> <?php $dbList = Widget::get('DBList'); if (is_array($dbList['databases'])) { $chttp = new Chttp(); $dbName = $chttp->getParam('db'); if (empty($dbName)) { ?> <ul class="nav nav-list collapse in bodymargin"> <?php foreach ($dbList['databases'] as $db) { ?> <a href="<?php echo Theme::URL('Collection/Index', array('db' => $db['name'])); ?> " class="nav-header" > <i class="icon-database"></i><?php echo $db['name']; ?> <span class="label label-info"><?php echo !empty($db['noOfCollecton']) ? $db['noOfCollecton'] : ''; ?> </span></a> <?php }