当前位置: 首页>>代码示例>>PHP>>正文


PHP BFCHelper::setState方法代码示例

本文整理汇总了PHP中BFCHelper::setState方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::setState方法的具体用法?PHP BFCHelper::setState怎么用?PHP BFCHelper::setState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BFCHelper的用法示例。


在下文中一共展示了BFCHelper::setState方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: basedisplay

 function basedisplay($tpl = NULL, $preparecontent = false)
 {
     // Initialise variables
     $state = $this->get('State');
     //$item		= $this->get('Item');
     //$document 	= JFactory::getDocument();
     //$language 	= $document->getLanguage();
     //$document->addScript('//jquery-ui.googlecode.com/svn/tags/legacy/ui/i18n/ui.datepicker-' . substr($language,0,2) . '.js');
     //$document->addStyleSheet('components/com_bookingforconnector/assets/css/resource.css');
     $params = $state->params;
     // se è un pdf non elaboro tutte le richieste
     if ($this->getLayout() != 'pdf') {
         // Check for errors.
         if (count($errors = $this->get('Errors'))) {
             JError::raiseWarning(500, implode("\n", $errors));
             return false;
         }
         if (isset($item->Merchant)) {
             BFCHelper::setState($item->Merchant, 'merchant', 'resource');
         }
         /* creating totals */
     }
     $this->assignRef('state', $state);
     $this->assignRef('params', $params);
     //$this->assignRef('item', $item);
 }
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:26,代码来源:resourceview.php

示例2: display

 function display($tpl = null, $preparecontent = false)
 {
     BookingForConnectorViewOnSellUnitBase::basedisplay($tpl);
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $config = JComponentHelper::getParams('com_bookingforconnector');
     BFCHelper::setState($item, 'onsellunit', 'onsellunit');
     //		$document->addStyleSheet('components/com_bookingforconnector/assets/css/resource.css');
     // add stylesheet
     JHTML::stylesheet('components/com_bookingforconnector/assets/css/bookingfor.css');
     JHTML::stylesheet('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');
     if ($this->checkAnalytics("Sales Resources Page") && $config->get('eecenabled', 0) == 1) {
         $obj = new stdClass();
         $obj->id = "" . $item->ResourceId . " - Sales Resource";
         $obj->name = $item->Name;
         $obj->category = $item->MerchantCategoryName;
         $obj->brand = $item->MerchantName;
         $obj->variant = 'NS';
         $document->addScriptDeclaration('callAnalyticsEEc("addProduct", [' . json_encode($obj) . '], "item");');
     }
     $this->assignRef('document', $document);
     $this->assignRef('language', $language);
     $this->assignRef('item', $item);
     $this->assignRef('config', $config);
     //		$item		= $this->get('Item');
     //$item->Name = $item->nome;
     //$this->setBreadcrumb($item, 'resources');
     $this->setBreadcrumb($item, 'onsellunits', $language);
     parent::display($tpl, true);
 }
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:34,代码来源:view.html.php

示例3: display

 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);
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:41,代码来源:view.html.php

示例4: uniqid

//$areamin;
//$areamax;
//$services="";
//if (count($resource->Services) > 0){
//	$tmpservices = array();
//	foreach ($resource->Services as $service){
//		$tmpservices[] = BFCHelper::getLanguage($service->Name, $this->language);
//	}
//	$services = implode(', ',$tmpservices);
//}
//$resource->Price
/**** for search similar *****/
//add counter
$model = $this->getModel();
$retCounter = $model->setCounterByResourceId($resource->ResourceId, "details", $this->language);
BFCHelper::setState($resource->Merchant, 'merchant', 'merchant');
//$test = BFCHelper::getState('merchant', 'merchant');
//
//echo "<pre>";
//echo print_r($test);
//echo "</pre>";
?>
<form action="<?php 
echo $formAction;
?>
" method="post" id="searchformsimilaronsellunit">
	<input type="hidden" value="<?php 
echo uniqid('', true);
?>
" name="searchid" />
	<input type="hidden" value="1" name="newsearch" />
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:31,代码来源:default-map_popup.php

示例5: display

 function display($tpl = null, $preparecontent = false)
 {
     $config = JComponentHelper::getParams('com_bookingforconnector');
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     $app = JFactory::getApplication();
     $sitename = $app->get('sitename');
     $this->assignRef('document', $document);
     $this->assignRef('language', $language);
     $this->assignRef('config', $config);
     $this->assignRef('sitename', $sitename);
     $params = null;
     $Extras = null;
     //$this->get('ExtrasFromService');
     $PriceTypes = null;
     //$this->get('PriceTypesFromService');
     $additionalJsScripts = "";
     $model = $this->getModel();
     BookingForConnectorViewResourceBase::basedisplay($tpl);
     $item = $this->item;
     $params = $this->params;
     $item->Availability = 0;
     $allstays = $model->getStay($language, isset($this->params['refreshcalc']));
     //$model->getResourceRatePlanFacilieties($item, $stay);
     $stay = null;
     //		echo "<pre>pricetype";
     //		echo $this->params['pricetype'];
     //		echo "</pre>";
     if (is_array($allstays) && (!isset($this->params['pricetype']) || empty($this->params['pricetype']))) {
         $selStay = array_values(array_filter($allstays, function ($st) {
             $resAvailable = 0;
             if (!empty($st->SuggestedStay)) {
                 $resAvailable = $st->SuggestedStay->Available;
             }
             return $resAvailable && $st->TotalAmount > 0;
         }));
         if (count($selStay) > 0) {
             $this->params['pricetype'] = $selStay[0]->RatePlanId;
         }
     }
     if (is_array($allstays) && isset($this->params['pricetype'])) {
         $selStay = array_values(array_filter($allstays, function ($st) {
             return $this->params['pricetype'] == $st->RatePlanId;
         }));
         if (count($selStay) > 0) {
             $stay = $selStay[0];
         }
         if (!empty($stay)) {
             $item->Availability = $stay->SuggestedStay->Availability;
         }
     }
     if (isset($stay->BookingTypes)) {
         $item->MerchantBookingTypes = $stay->BookingTypes;
     }
     if (isset($stay->SelectablePrices)) {
         $Extras = $stay->SelectablePrices;
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     // saves state for accessing from other plugins and components (RSForms specifically) from now on
     BFCHelper::setState(array('resourceId' => $params['resourceId'], 'checkin' => $params['checkin']->format('d/m/Y'), 'checkout' => $params['checkout']->format('d/m/Y'), 'duration' => $params['duration'], 'paxages' => $params['paxages'], 'extras' => $params['extras'], 'packages' => $params['packages'], 'pricetype' => $params['pricetype'], 'rateplanId' => $params['rateplanId'], 'state' => $params['state'], 'variationPlanId' => $params['variationPlanId'], 'gotCalculator' => false), 'stayrequest', 'resource');
     if (!empty($item->MerchantBookingTypes)) {
         BFCHelper::setState($item->MerchantBookingTypes, 'bookingTypes', 'resource');
     }
     BFCHelper::setState($stay, 'stay', 'resource');
     BFCHelper::setState($item->Merchant, 'merchant', 'resource');
     /* creating totals */
     $total = 0;
     $totalDiscounted = 0;
     $totalWithVariation = 0;
     if (!empty($stay->TotalPrice)) {
         $total = $stay->TotalPrice;
     }
     if (!empty($stay->DiscountedPrice)) {
         $totalDiscounted = $stay->DiscountedPrice;
     }
     $totalWithVariation = $totalDiscounted;
     if (!empty($stay)) {
         //TODO: cosa farne dei pacchetti nel calcolo singolo della risorsa?
         /*
         if(!empty($stay->CalculatedPackages)){
         	foreach ($stay->CalculatedPackages as $pkg) {
         		//$totalDiscounted = $totalDiscounted + $pkg->SuggestedStay->DiscountedPrice;
         		//$total = $total + $pkg->SuggestedStay->DiscountedPrice;
         		
         		
         		$totalDiscounted = $totalDiscounted + $pkg->DiscountedAmount;
         		$total = $total + $pkg->DiscountedAmount;
         	}
         }
         */
         if (!empty($stay->Variations)) {
             foreach ($stay->Variations as $var) {
                 $var->TotalPackagesAmount = 0;
                 /*
                 foreach ($stay->CalculatedPackages as $pkg) {
                 	foreach($pkg->Variations as $pvar) {
//.........这里部分代码省略.........
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:101,代码来源:view.calc.php


注:本文中的BFCHelper::setState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。