From 26ca356ea7bb4521d763204fb68d0cba8086684b Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 20 Nov 2010 17:07:20 +0000
Subject: Fixes #472 handling interactive adding/deleting of widgets with
single/multiple instance constraints
git-svn-id: http://code.elgg.org/elgg/trunk@7385 36083f99-b078-4883-b0ff-0f9b5a30f544
---
views/default/widgets/add_panel.php | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
(limited to 'views/default/widgets/add_panel.php')
diff --git a/views/default/widgets/add_panel.php b/views/default/widgets/add_panel.php
index 09511487c..a010d1e9e 100644
--- a/views/default/widgets/add_panel.php
+++ b/views/default/widgets/add_panel.php
@@ -19,7 +19,8 @@ foreach ($widgets as $column_widgets) {
$widget_type) {
+ foreach ($widget_types as $handler => $widget_type) {
+ $id = "widget_type_$handler";
// check if widget added and only one instance allowed
if ($widget_type->multiple == false && in_array($handler, $current_handlers)) {
$class = 'widget_unavailable';
@@ -29,7 +30,13 @@ foreach ($widgets as $column_widgets) {
$tooltip = $widget_type->description;
}
- echo "- $widget_type->name
";
+ if ($widget_type->multiple) {
+ $class .= ' widget_multiple';
+ } else {
+ $class .= ' widget_single';
+ }
+
+ echo "- $widget_type->name
";
}
?>
--
cgit v1.2.3