Dashboard: show DB selection only for setups...
...with multiple DBs
This commit is contained in:
parent
e6563b9882
commit
06b6356de1
|
@ -10,13 +10,16 @@ class DashboardController extends ActionController
|
|||
{
|
||||
protected function checkDirectorPermissions()
|
||||
{
|
||||
// No special permissions required, override parent method
|
||||
}
|
||||
|
||||
protected function addDbSelection()
|
||||
{
|
||||
$form = new DbSelectorForm($this->Window(), $this->listAllowedDbResourceNames());
|
||||
$this->content()->add($form);
|
||||
$form->handleRequest($this->getRequest());
|
||||
if ($this->isMultiDbSetup()) {
|
||||
$form = new DbSelectorForm($this->Window(), $this->listAllowedDbResourceNames());
|
||||
$this->content()->add($form);
|
||||
$form->handleRequest($this->getRequest());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,6 +66,11 @@ trait DirectorDb
|
|||
return preg_split('/\s*,\s*/', $string, -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
protected function isMultiDbSetup()
|
||||
{
|
||||
return count($this->listAvailableDbResourceNames()) > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue