protected function getLayout($idDashboard)
{
if (Piwik::isUserIsAnonymous()) {
$session = new SessionNamespace("Dashboard");
if (!isset($session->dashboardLayout)) {
return $this->dashboard->getDefaultLayout();
}
$layout = $session->dashboardLayout;
} else {
$layout = $this->dashboard->getLayoutForUser(Piwik::getCurrentUserLogin(), $idDashboard);
}
if (!empty($layout)) {
$layout = $this->dashboard->removeDisabledPluginFromLayout($layout);
}
if (empty($layout)) {
$layout = $this->dashboard->getDefaultLayout();
}
return $layout;
}