Ejemplo n.º 1
0
 public function getCode()
 {
     bx_import('BxTemplSearch');
     $oSearch = new BxTemplSearch();
     $oSearch->setLiveSearch(true);
     $aVars = array('menu' => parent::getCode(), 'search' => $oSearch->getForm(BX_DB_CONTENT_ONLY) . $oSearch->getResultsContainer());
     return $this->_oTemplate->parseHtmlByName('menu_site.html', $aVars);
 }
Ejemplo n.º 2
0
 /**
  * Parse system keys.
  *
  * @param  string $sKey key
  * @return string value associated with the key.
  */
 function parseSystemKey($sKey, $mixedKeyWrapperHtml = null, $bProcessInjection = true)
 {
     $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml);
     $sRet = '';
     switch ($sKey) {
         case 'page_charset':
             $sRet = 'UTF-8';
             break;
         case 'page_robots':
             if (!empty($this->aPage['robots']) && is_string($this->aPage['robots'])) {
                 $sRet = '<meta name="robots" content="' . bx_html_attribute($this->aPage['robots']) . '" />';
             }
             break;
         case 'meta_info':
             $sRet = $this->getMetaInfo();
             break;
         case 'page_header':
             if (isset($this->aPage['header'])) {
                 $sRet = bx_process_output(strip_tags($this->aPage['header']));
             }
             break;
         case 'page_header_text':
             if (isset($this->aPage['header_text'])) {
                 $sRet = bx_process_output($this->aPage['header_text']);
             }
             break;
         case 'popup_loading':
             bx_import('BxTemplFunctions');
             $s = $this->parsePageByName('popup_loading.html', array());
             $sRet = BxTemplFunctions::getInstance()->transBox('bx-popup-loading', $s, true);
             bx_import('BxTemplSearch');
             $oSearch = new BxTemplSearch();
             $oSearch->setLiveSearch(true);
             $sRet .= $this->parsePageByName('search.html', array('search_form' => $oSearch->getForm(BX_DB_CONTENT_ONLY), 'results' => $oSearch->getResultsContainer()));
             $sRet .= $this->getMenu('sys_site');
             $sRet .= isLogged() ? $this->getMenu('sys_add_content') : '';
             $sRet .= isLogged() ? $this->getMenu('sys_account_popup') : '';
             break;
         case 'lang':
             $sRet = bx_lang_name();
             break;
         case 'main_logo':
             bx_import('BxTemplFunctions');
             $sRet = BxTemplFunctions::getInstance()->getMainLogo();
             break;
         case 'informer':
             bx_import('BxDolInformer');
             $oInformer = BxDolInformer::getInstance($this);
             $sRet = $oInformer ? $oInformer->display() : '';
             break;
         case 'dol_images':
             $sRet = $this->_processJsImages();
             break;
         case 'dol_lang':
             $sRet = $this->_processJsTranslations();
             break;
         case 'dol_options':
             $sRet = $this->_processJsOptions();
             break;
         case 'bottom_text':
             $sRet = _t('_bottom_text', date('Y'));
             break;
         case 'copyright':
             $sRet = _t('_copyright', date('Y')) . getVersionComment();
             break;
         case 'extra_js':
             $sRet = empty($this->aPage['extra_js']) ? '' : $this->aPage['extra_js'];
             break;
         case 'is_profile_page':
             $sRet = defined('BX_PROFILE_PAGE') ? 'true' : 'false';
             break;
         default:
             bx_import('BxTemplFunctions');
             $sRet = ($sTemplAdd = BxTemplFunctions::getInstance()->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right'];
     }
     if ($bProcessInjection) {
         $sRet = $this->processInjection($this->getPageNameIndex(), $sKey, $sRet);
     }
     return $sRet;
 }
Ejemplo n.º 3
0
<?php

/**
 * @package     Dolphin Core
 * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
 */
require_once './inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . "design.inc.php";
bx_import('BxTemplSearch');
bx_import('BxDolTemplate');
$oSearch = new BxTemplSearch();
$oSearch->setLiveSearch(bx_get('live_search') ? 1 : 0);
$oSearch->setMetaType(bx_process_input(bx_get('type')));
$sCode = '';
if (bx_get('keyword')) {
    $sCode = $oSearch->response();
    if (!$sCode) {
        $sCode = $oSearch->getEmptyResult();
    }
}
$oTemplate = BxDolTemplate::getInstance();
$oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
$oTemplate->setPageHeader(_t("_Search"));
$oTemplate->setPageContent('page_main_code', $oSearch->getForm() . $oSearch->getResultsContainer($sCode));
$oTemplate->getPageCode();