diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index a4196f673..28b4321a2 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -299,8 +299,7 @@ function notifier() { var tub1 = 0, tub2 = 0, tub3 = 0; $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { var data = $.parseJSON(json); - $.each(data, function(i, object) { - var notify = $.parseJSON(object); + $.each(data, function(i, notify) { switch (notify.importance) { case 'alert' : tub1++; break; @@ -336,8 +335,7 @@ function digits(number) { function openNotifier(filter) { $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { var data = $.parseJSON(json); - $.each(data, function(i, object) { - var notify = $.parseJSON(object); + $.each(data, function(i, notify) { if (notify.importance == filter) { $.jGrowl(notify.subject+'
'+notify.description, { group: notify.importance, @@ -354,8 +352,7 @@ function closeNotifier(filter) { clearTimeout(timers.notifier); $.post('/webGui/include/Notify.php',{cmd:'get'},function(json) { var data = $.parseJSON(json); - $.each(data, function(i, object) { - var notify = $.parseJSON(object); + $.each(data, function(i, notify) { if (notify.importance == filter) $.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file}); }); $('div.jGrowl').find('.'+filter).find('div.jGrowl-close').trigger('click'); diff --git a/plugins/dynamix/scripts/notify b/plugins/dynamix/scripts/notify index 7729263de..85bcdbc7c 100755 --- a/plugins/dynamix/scripts/notify +++ b/plugins/dynamix/scripts/notify @@ -218,13 +218,12 @@ case 'get': if (!$field) continue; list($key,$val) = explode('=', $field); if ($time) {$val = date($notify['date'].' '.$notify['time'], $val); $time = false;} - $output[$i][] = '\"'.trim($key).'\":\"'.trim($val).'\"'; + $output[$i][trim($key)] = trim($val); } - $output[$i++][] = '\"file\":\"'.basename($file).'\"'; + $output[$i++]["file"] = basename($file); chmod($file,0000); } - for ($n=0; $n<$i; $n++) $json[] = '"{'.implode(',', $output[$n]).'}"'; - echo '['.implode(',', $json).']'; + echo json_encode($output, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); break; case 'archive':