BxPhotosFormsEntryHelper.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Photos Photos
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry forms helper functions
  13. */
  14. class BxPhotosFormsEntryHelper extends BxBaseModFilesFormsEntryHelper
  15. {
  16. public function __construct($oModule)
  17. {
  18. $this->_sDisplayForFormAdd ='bx_photos_entry_upload';
  19. $this->_sObjectNameForFormAdd ='bx_photos_upload';
  20. parent::__construct($oModule);
  21. }
  22. public function addDataForm ($sDisplay = false, $sCheckFunction = false)
  23. {
  24. $mixedContent = $this->addDataFormAction($sDisplay, $sCheckFunction);
  25. if (is_array($mixedContent) && $mixedContent['need_redirect_after_action']){
  26. $CNF = &$this->_oModule->_oConfig->CNF;
  27. $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id=' . bx_get_logged_profile_id());
  28. if($this->_bAjaxMode) {
  29. echoJson($this->prepareResponse($sUrl, $this->_bAjaxMode, 'redirect'));
  30. exit;
  31. }
  32. else
  33. $this->_redirectAndExit($sUrl);
  34. }
  35. else {
  36. return $mixedContent;
  37. }
  38. }
  39. }
  40. /** @} */