BxDolProfileForms.php 1.3 KB

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