Dead code

This commit is contained in:
Marc Delisle 2013-05-20 13:19:12 -04:00
parent 19d1efd90b
commit b5dd9e2d04
2 changed files with 0 additions and 93 deletions

View File

@ -229,80 +229,6 @@ class PMA_List_Database extends PMA_List
return $this->getEmpty();
}
/**
* returns array with dbs grouped with extended infos
*
* @param integer $offset
* @param integer $count
*
* @return array db list
*/
public function getGroupedDetails($offset, $count)
{
$dbgroups = array();
if ($GLOBALS['cfg']['ShowTooltip']
&& $GLOBALS['cfgRelation']['commwork']
) {
$db_tooltips = PMA_getDbComments();
}
if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping']) {
$separators = array();
} elseif (is_array($GLOBALS['cfg']['NavigationTreeDbSeparator'])) {
$separators = $GLOBALS['cfg']['NavigationTreeDbSeparator'];
} elseif (!empty($GLOBALS['cfg']['NavigationTreeDbSeparator'])) {
$separators = array($GLOBALS['cfg']['NavigationTreeDbSeparator']);
} else {
$separators = array();
}
foreach ($this->getLimitedItems($offset, $count) as $db) {
// Get comments from PMA comments table
$db_tooltip = '';
if (isset($db_tooltips[$db])) {
$db_tooltip = $db_tooltips[$db];
}
$pos = false;
foreach ($separators as $separator) {
// use strpos instead of strrpos; it seems more common to
// have the db name, the separator, then the rest which
// might contain a separator
// like dbname_the_rest
$pos = strpos($db, $separator, 1);
if ($pos !== false) {
break;
}
}
if ($pos !== false) {
$group = substr($db, 0, $pos);
$disp_name_cut = substr($db, $pos);
} else {
$group = $db;
$disp_name_cut = $db;
}
$disp_name = $db;
$dbgroups[$group][$db] = array(
'name' => $db,
'disp_name_cut' => $disp_name_cut,
'disp_name' => $disp_name,
'comment' => $db_tooltip,
);
if ($GLOBALS['cfg']['Server']['CountTables']) {
$dbgroups[$group][$db]['num_tables'] = PMA_getTableCount($db);
}
} // end foreach ($GLOBALS['PMA_List_Database']->items as $db)
return $dbgroups;
}
/**
* returns a part of the items
*

View File

@ -110,24 +110,5 @@ class PMA_List_Database_test extends PHPUnit_Framework_TestCase
);
}
/**
* Test for getGroupedDetails
*
* @return void
*/
public function testGetGroupedDetails()
{
$GLOBALS['cfg']['ShowTooltip'] = true;
$GLOBALS['cfgRelation']['commwork'] = true;
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
$GLOBALS['cfg']['NavigationTreeDbSeparator'] = array('|',',');
$this->assertEquals(
$this->object->getGroupedDetails(10, 100),
array()
);
}
}
?>