BxDolProfileForms.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 TridentCore Trident Core
  7. * @{
  8. */
  9. /**
  10. * Functions to automate profile creation/editing/deletion forms.
  11. */
  12. class BxDolProfileForms extends BxDol
  13. {
  14. /**
  15. * Constructor
  16. */
  17. protected function __construct ()
  18. {
  19. parent::__construct ();
  20. }
  21. protected function _redirectAndExit ($sUrl, $isPermalink = true, $aMarkers = false)
  22. {
  23. if ($isPermalink)
  24. $sUrl = BxDolPermalinks::getInstance()->permalink($sUrl);
  25. header('Location: ' . BX_DOL_URL_ROOT . $this->_replaceMarkers($sUrl, $aMarkers));
  26. exit;
  27. }
  28. /**
  29. * Replace provided markers in a string, markers are surrounded by '{' and '}' signs, for example: a.php?x={id}
  30. * @param $mixed string or array to replace markers in
  31. * @param $aMarkers araay or markers for replacement, for example: array ('num' => 123, 'name' => 'Ivan');
  32. * @return string where all markers are replaced
  33. */
  34. protected function _replaceMarkers ($mixed, $aMarkers)
  35. {
  36. return bx_replace_markers($mixed, $aMarkers);
  37. }
  38. }
  39. /** @} */