HomeHelpTrac

source: trunk/search_home.php @ 15211

Revision 15211, 2.5 KB checked in by Alexander Trofimov, 12 months ago (diff)

Code cleaning:

  • converting new lines to \n
  • deleting spaces at the end of every line
  • converting all tabs to 4 spaces
  • automated script for future cleaning was added
Line 
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
8require_once('./inc/header.inc.php');
9require_once(BX_DIRECTORY_PATH_INC . "languages.inc.php");
10require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
11require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
12
13bx_import ('BxDolPageView');
14
15class BxDolPageSearchMain extends BxDolPageView {
16
17    function BxDolPageSearchMain() {
18        parent::BxDolPageView('search_home');
19    }
20
21    function getBlockCode_Keyword() {
22
23        $a = array(
24            'form_attrs' => array(
25               'id' => 'searchForm',
26               'action' => BX_DOL_URL_ROOT . 'searchKeyword.php',
27               'method' => 'get',
28            ),
29            'inputs' => array(
30                'keyword' => array(
31                    'type' => 'text',
32                    'name' => 'keyword',
33                    'caption' => _t('_Keyword'),
34                ),
35                'search' => array(
36                    'type' => 'submit',
37                    'name' => 'search',
38                    'value' => _t('_Search'),
39                ),
40            ),
41        );
42
43        bx_import('BxTemplFormView');
44        $oForm = new BxTemplFormView($a);
45        return $oForm->getCode();
46
47    }
48
49    function getBlockCode_People() {
50
51        global $logged;
52
53        $iProfileId = getLoggedId();
54        $aProfile = $iProfileId ? getProfileInfo($iProfileId) : array();
55
56        // default params for search form
57        $aDefaultParams = array(
58            'LookingFor'  => isset($aProfile['Sex']) && $aProfile['Sex'] ? $aProfile['Sex'] : 'male',
59            'Sex'         => isset($aProfile['LookingFor']) && $aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female',
60            'Country'     => isset($aProfile['Country']) && $aProfile['Country'] ? $aProfile['Country'] : getParam('default_country'),
61            'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age'),
62        );
63
64        bx_import('BxDolProfileFields');
65        $oPF = new BxDolProfileFields(9);
66        $a = array('default_params' => $aDefaultParams);
67        return $oPF->getFormCode($a);
68    }
69}
70
71$oPage = new BxDolPageSearchMain();
72
73$oTemplate = BxDolTemplate::getInstance();
74$oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
75$oTemplate->setPageHeader (_t('_sys_search_main_title'));
76$oTemplate->setPageContent ('page_main_code', $oPage->getCode());
77
78PageCode();
79
Note: See TracBrowser for help on using the repository browser.