BxBasePrivacy.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinCore Dolphin Core
  7. * @{
  8. */
  9. bx_import('BxDolPrivacy');
  10. /**
  11. * Privacy representation.
  12. * @see BxDolPrivacy
  13. */
  14. class BxBasePrivacy extends BxDolPrivacy {
  15. protected $_oTemplate;
  16. public function __construct ($aOptions, $oTemplate) {
  17. parent::__construct ($aOptions);
  18. if ($oTemplate)
  19. $this->_oTemplate = $oTemplate;
  20. else
  21. $this->_oTemplate = BxDolTemplate::getInstance();
  22. }
  23. protected function _addJsCss()
  24. {
  25. /*
  26. $this->_oTemplate->addJs('BxDolGrid.js');
  27. $this->_oTemplate->addCss('grid.css');
  28. */
  29. }
  30. protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
  31. {
  32. header('Content-type: text/html; charset=utf-8');
  33. require_once(BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php');
  34. $oParser = new Services_JSON();
  35. $s = $oParser->encode($a);
  36. if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
  37. $s = '<textarea>' . $s . '</textarea>';
  38. echo $s;
  39. }
  40. }
  41. /** @} */