function display($tpl = null) { BookingForConnectorViewCondominiumBase::basedisplay($tpl); $state = $this->get('State'); $item = $this->get('Item'); $document = JFactory::getDocument(); $language = $document->getLanguage(); $isFromSearch = false; BFCHelper::setState($item, 'condominium', 'condominium'); if (JRequest::getString('layout') == 'resourcesajax') { $items = $this->get('ItemsResourcesAjax'); } else { //if (JRequest::getString('layout') == 'resources') { if (JRequest::getString('search') == '1') { $isFromSearch = true; $items = $this->get('ItemsSearch'); $pagination = $this->get('Pagination'); } else { $items = $this->get('Items'); $pagination = $this->get('Pagination'); } } // $document->addStyleSheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH.'assets/css/resource.css'); // add stylesheet $document->addStylesheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/css/bookingfor.css'); $document->addStylesheet(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/css/bookingfor-responsive.css'); $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/jquery.form.js'); $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/jquery.blockUI.js'); $document->addScript(COM_BOOKINGFORCONNECTOR_SCRIPT_PATH . 'assets/js/bf.js'); $this->assignRef('document', $document); $this->assignRef('language', $language); $this->assignRef('item', $item); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('isFromSearch', $isFromSearch); // $item = $this->get('Item'); //$item->Name = $item->nome; //$this->setBreadcrumb($item, 'resources'); $this->setBreadcrumb($item, 'condominiums', $language); parent::display($tpl); }
function display($tpl = null, $preparecontent = false) { BookingForConnectorViewCondominiumBase::basedisplay($tpl); $state = $this->get('State'); $item = $this->get('Item'); $document = JFactory::getDocument(); $language = $document->getLanguage(); $isFromSearch = false; $app = JFactory::getApplication(); $sitename = $app->get('sitename'); $config = JComponentHelper::getParams('com_bookingforconnector'); $params = $this->params; BFCHelper::setState($item, 'condominium', 'condominium'); $allobjects = array(); if (JRequest::getString('layout') == 'resourcesajax') { $items = $this->get('ItemsResourcesAjax'); } else { //if (JRequest::getString('layout') == 'resources') { if (JRequest::getString('search') == '1') { $isFromSearch = true; $items = $this->get('ItemsSearch'); $pagination = $this->get('Pagination'); } else { $items = $this->get('Items'); $pagination = $this->get('Pagination'); } if (!empty($items)) { foreach ($items as $key => $value) { $obj = new stdClass(); $obj->id = "" . $value->ResourceId . " - Resource"; $obj->name = $value->ResName; $obj->category = $value->DefaultLangMrcCategoryName; $obj->brand = $value->MrcName; $obj->position = $key; $allobjects[] = $obj; } } } $analyticsEnabled = $this->checkAnalytics("Condominium page"); if ($analyticsEnabled && $config->get('eecenabled', 0) == 1) { $obj = new stdClass(); $obj->id = "" . $item->CondominiumId . " - Resource Group"; $obj->name = $item->Name; $obj->category = $item->MrcCategoryName; $obj->brand = $item->MerchantName; $obj->variant = 'NS'; $document->addScriptDeclaration('callAnalyticsEEc("addProduct", [' . json_encode($obj) . '], "item");'); $document->addScriptDeclaration('callAnalyticsEEc("addImpression", ' . json_encode($allobjects) . ', "list", "Condominium Resources Search List");'); } // $document->addStyleSheet('components/com_bookingforconnector/assets/css/resource.css'); // add stylesheet $document->addStylesheet('components/com_bookingforconnector/assets/css/bookingfor.css'); $document->addStylesheet('components/com_bookingforconnector/assets/css/bookingfor-responsive.css'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.form.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.blockUI.js'); $document->addScript('components/com_bookingforconnector/assets/js/bf.js'); $this->assignRef('document', $document); $this->assignRef('language', $language); $this->assignRef('item', $item); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('isFromSearch', $isFromSearch); $this->assignRef('sitename', $sitename); $this->assignRef('config', $config); $this->assignRef('analyticsEnabled', $analyticsEnabled); $this->setBreadcrumb($item, 'condominiums', $language); parent::display($tpl); }