search_home.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * @package Dolphin Core
  4. * @copyright Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  5. * @license CC-BY - http://creativecommons.org/licenses/by/3.0/
  6. */
  7. require_once('./inc/header.inc.php');
  8. require_once(BX_DIRECTORY_PATH_INC . "languages.inc.php");
  9. require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
  10. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  11. bx_import ('BxDolPageView');
  12. class BxDolPageSearchMain extends BxDolPageView {
  13. function BxDolPageSearchMain() {
  14. parent::BxDolPageView('search_home');
  15. }
  16. function getBlockCode_Keyword() {
  17. $a = array(
  18. 'form_attrs' => array(
  19. 'id' => 'searchForm',
  20. 'action' => BX_DOL_URL_ROOT . 'searchKeyword.php',
  21. 'method' => 'get',
  22. ),
  23. 'inputs' => array(
  24. 'keyword' => array(
  25. 'type' => 'text',
  26. 'name' => 'keyword',
  27. 'caption' => _t('_Keyword'),
  28. ),
  29. 'search' => array(
  30. 'type' => 'submit',
  31. 'name' => 'search',
  32. 'value' => _t('_Search'),
  33. ),
  34. ),
  35. );
  36. bx_import('BxTemplFormView');
  37. $oForm = new BxTemplFormView($a);
  38. return $oForm->getCode();
  39. }
  40. function getBlockCode_People() {
  41. global $logged;
  42. $iProfileId = getLoggedId();
  43. $aProfile = $iProfileId ? getProfileInfo($iProfileId) : array();
  44. // default params for search form
  45. $aDefaultParams = array(
  46. 'LookingFor' => isset($aProfile['Sex']) && $aProfile['Sex'] ? $aProfile['Sex'] : 'male',
  47. 'Sex' => isset($aProfile['LookingFor']) && $aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female',
  48. 'Country' => isset($aProfile['Country']) && $aProfile['Country'] ? $aProfile['Country'] : getParam('default_country'),
  49. 'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age'),
  50. );
  51. bx_import('BxDolProfileFields');
  52. $oPF = new BxDolProfileFields(9);
  53. $a = array('default_params' => $aDefaultParams);
  54. return $oPF->getFormCode($a);
  55. }
  56. }
  57. $oPage = new BxDolPageSearchMain();
  58. $oTemplate = BxDolTemplate::getInstance();
  59. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  60. $oTemplate->setPageHeader (_t('_sys_search_main_title'));
  61. $oTemplate->setPageContent ('page_main_code', $oPage->getCode());
  62. PageCode();