mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow multiple instances of the same widget
This commit is contained in:
@@ -20,13 +20,6 @@ elseif ($sub_type == 'remove-all') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($sub_type == 'add' && is_numeric($widget_id)) {
|
elseif ($sub_type == 'add' && is_numeric($widget_id)) {
|
||||||
$dupe_check = dbFetchCEll('SELECT `user_widget_id` FROM `users_widgets` WHERE `user_id`=? AND `widget_id`=?',array($_SESSION['user_id'],$widget_id));
|
|
||||||
|
|
||||||
if (is_numeric($dupe_check)) {
|
|
||||||
$message = 'This widget has already been added';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
$widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id));
|
$widget = dbFetchRow('SELECT * FROM `widgets` WHERE `widget_id`=?', array($widget_id));
|
||||||
if (is_array($widget)) {
|
if (is_array($widget)) {
|
||||||
list($x,$y) = explode(',',$widget['base_dimensions']);
|
list($x,$y) = explode(',',$widget['base_dimensions']);
|
||||||
@@ -37,7 +30,6 @@ elseif ($sub_type == 'add' && is_numeric($widget_id)) {
|
|||||||
$message = '';
|
$message = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$status = 'ok';
|
$status = 'ok';
|
||||||
|
Reference in New Issue
Block a user