main.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. * @defgroup Resources Resources
  5. * @ingroup UnaModules
  6. *
  7. * @{
  8. */
  9. function BxResourcesMain(oOptions) {
  10. this._oOptions = oOptions
  11. this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
  12. }
  13. BxResourcesMain.prototype.processList = function (iContextId, iId, oSource) {
  14. var $this = this;
  15. $(window).dolPopupAjax({
  16. url: $this._oOptions.sActionUrl + 'process_list_form/' + iContextId + '/' + iId + '/',
  17. closeOnOuterClick: false,
  18. removeOnClose: true
  19. });
  20. };
  21. BxResourcesMain.prototype.deleteList = function (iContextId, iListId, oSource) {
  22. var $this = this;
  23. bx_confirm($this._oOptions.t_confirm_block_deletion, function () {
  24. $.getJSON($this._oOptions.sActionUrl + 'delete_list/' + iContextId + '/' + iListId + '/', {}, function (oData) {
  25. $this.reloadData(oData, iContextId);
  26. });
  27. });
  28. };
  29. BxResourcesMain.prototype.processEntry = function (iContextId, iListId, oSource) {
  30. var $this = this;
  31. $(window).dolPopupAjax({
  32. url: $this._oOptions.sActionUrl + 'process_entry_form/' + iContextId + '/' + iListId + '/',
  33. closeOnOuterClick: false,
  34. removeOnClose: true
  35. });
  36. };
  37. BxResourcesMain.prototype.reloadData = function (oData, iContextId) {
  38. $(".bx-popup-applied:visible").dolPopupHide();
  39. loadDynamicBlockAuto($('#' + this._aHtmlIds['lists']), window.location.href);
  40. };
  41. BxResourcesMain.prototype.reload = function (oData) {
  42. $(".bx-popup-applied:visible").dolPopupHide();
  43. document.location = document.location;
  44. };