aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/add_panel.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 17:07:20 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 17:07:20 +0000
commit26ca356ea7bb4521d763204fb68d0cba8086684b (patch)
tree03b123ed40eb6fc0b50cd8523ea1d8ec7ee6b6e3 /views/default/widgets/add_panel.php
parent078d930d12f450f32f1b7d1976e5d3fe0aa01808 (diff)
downloadelgg-26ca356ea7bb4521d763204fb68d0cba8086684b.tar.gz
elgg-26ca356ea7bb4521d763204fb68d0cba8086684b.tar.bz2
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
Diffstat (limited to 'views/default/widgets/add_panel.php')
-rw-r--r--views/default/widgets/add_panel.php11
1 files changed, 9 insertions, 2 deletions
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) {
</p>
<ul>
<?php
- foreach ($widget_types as $handler => $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 "<li title=\"$tooltip\" id=\"$handler\" class=\"$class\">$widget_type->name</li>";
+ if ($widget_type->multiple) {
+ $class .= ' widget_multiple';
+ } else {
+ $class .= ' widget_single';
+ }
+
+ echo "<li title=\"$tooltip\" id=\"$id\" class=\"$class\">$widget_type->name</li>";
}
?>
</ul>