Fix that only one default dashboard could be removed

fixes #11078
This commit is contained in:
Eric Lippmann 2016-04-13 12:27:25 +02:00
parent 7dbcd27c3c
commit be7263ebfa
3 changed files with 6 additions and 8 deletions

View File

@ -18,6 +18,7 @@
</thead>
<tbody>
<?php foreach ($this->dashboard->getPanes() as $pane): ?>
<?php if ($pane->getDisabled()) continue; ?>
<tr style="background-color: #f1f1f1;">
<th colspan="2" style="text-align: left; padding: 0.5em;">
<?= $this->escape($pane->getName()) ?>
@ -43,7 +44,7 @@
</tr>
<?php else: ?>
<?php foreach ($dashlets as $dashlet): ?>
<?php if ($dashlet->getDisabled() === true) continue; ?>
<?php if ($dashlet->getDisabled()) continue; ?>
<tr>
<td>
<?= $this->qlink(

View File

@ -201,12 +201,6 @@ class Dashboard extends AbstractWidget
{
/** @var $pane Pane */
foreach ($panes as $pane) {
if ($pane->getDisabled()) {
if ($this->hasPane($pane->getTitle()) === true) {
$this->removePane($pane->getTitle());
}
continue;
}
if ($this->hasPane($pane->getTitle()) === true) {
/** @var $current Pane */
$current = $this->panes[$pane->getName()];
@ -231,6 +225,9 @@ class Dashboard extends AbstractWidget
$this->tabs = new Tabs();
foreach ($this->panes as $key => $pane) {
if ($pane->getDisabled()) {
continue;
}
$this->tabs->add(
$key,
array(

View File

@ -40,7 +40,7 @@ class Pane extends UserWidget
*
* @var bool
*/
private $disabled;
private $disabled = false;
/**
* Create a new pane