From 5ace5fd2dc3379a60a8c771eba00dd3aea155bd9 Mon Sep 17 00:00:00 2001
From: Marius Hein <marius.hein@netways.de>
Date: Tue, 18 Nov 2014 17:47:57 +0100
Subject: [PATCH] Dashboard: Change icons

refs #4537
---
 application/views/scripts/dashboard/settings.phtml | 4 ++--
 library/Icinga/Web/Widget/Dashboard/Pane.php       | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/application/views/scripts/dashboard/settings.phtml b/application/views/scripts/dashboard/settings.phtml
index ebe0188c4..b14c236df 100644
--- a/application/views/scripts/dashboard/settings.phtml
+++ b/application/views/scripts/dashboard/settings.phtml
@@ -25,7 +25,7 @@
                     </th>
                     <th>
                         <a href="<?= $this->href('dashboard/remove-pane', array('pane' => $pane->getName()));  ?>">
-                            <?= $this->icon('remove.png'); ?>
+                            <?= $this->icon('cancel'); ?>
                         </a>
                     </th>
                 </tr>
@@ -49,7 +49,7 @@
                             </td>
                             <td>
                                 <a href="<?= $this->href('dashboard/remove-component', array('pane' => $pane->getName(), 'component' => $component->getTitle()));  ?>">
-                                <?= $this->icon('remove.png'); ?>
+                                <?= $this->icon('cancel'); ?>
                                 </a>
                             </td>
                         </tr>
diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php
index 4773d69b7..4ba9f27dc 100644
--- a/library/Icinga/Web/Widget/Dashboard/Pane.php
+++ b/library/Icinga/Web/Widget/Dashboard/Pane.php
@@ -141,9 +141,11 @@ class Pane extends UserWidget
             if ($component->isUserWidget() === true) {
                 unset($this->components[$title]);
             } else {
-                $component->setUserWidget();
                 $component->setDisabled(true);
+                $component->setUserWidget();
             }
+        } else {
+            throw new ProgrammingError('Component does not exist: ' . $title);
         }
         return $this;
     }