index.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. if (cfr('EXPORT')) {
  3. $export = new Export();
  4. //some record deletion?
  5. if (ubRouting::checkGet($export::ROUTE_DELETE)) {
  6. $deletionResult = $export->deleteRecording(ubRouting::get($export::ROUTE_DELETE));
  7. if (empty($deletionResult)) {
  8. ubRouting::nav($export::URL_RECORDS);
  9. } else {
  10. show_error($deletionResult);
  11. }
  12. }
  13. //existing record preview
  14. if (ubRouting::checkGet($export::ROUTE_PREVIEW)) {
  15. show_window(__('Preview'), $export->renderRecordPreview(ubRouting::get($export::ROUTE_PREVIEW)));
  16. } else {
  17. //rendering schedule if not empty
  18. $exportSchedule = $export->renderScheduledExports();
  19. if ($exportSchedule) {
  20. show_window(__('Your scheduled records saving'), $exportSchedule);
  21. }
  22. //motion detection handling
  23. if (ubRouting::checkPost($export::PROUTE_MODET_RUN)) {
  24. if ($ubillingConfig->getAlterParam(MoDet::OPTION_ENABLE)) {
  25. if (cfr('MOTION')) {
  26. if ($export->isMoDetSpaceAvailable(ubRouting::post($export::PROUTE_MODET_RUN))) {
  27. $motionDetector = new MoDet();
  28. $motionThreshold = $export->getMoDetParamSensitivity(ubRouting::post($export::PROUTE_MODET_SENS));
  29. $motionTimeScale = $export->getMoDetParamTimeScale(ubRouting::post($export::PROUTE_MODET_TIMESCALE));
  30. $motionResult = $motionDetector->runMotionFiltering(ubRouting::post($export::PROUTE_MODET_RUN), $motionThreshold, $motionTimeScale);
  31. if (empty($motionResult)) {
  32. show_window('', $motionDetector->renderScheduledNotify());
  33. } else {
  34. show_error($motionResult);
  35. }
  36. } else {
  37. show_error(__('Motion filtering') . ': ' . __('Not enough free space') . '!');
  38. }
  39. } else {
  40. show_error(__('Access denied'));
  41. }
  42. }
  43. }
  44. //already saved records here
  45. if (ubRouting::checkGet($export::ROUTE_REFRESH)) {
  46. $zenflow = new ZenFlow('arreclst', $export->renderAvailableRecords(), 2000);
  47. $availableRecords = $zenflow->render();
  48. } else {
  49. $availableRecords = $export->renderAvailableRecords();
  50. }
  51. show_window(__('Your saved records'), $availableRecords);
  52. }
  53. } else {
  54. show_error(__('Access denied'));
  55. }