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

View File

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

View File

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