當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CBitrixComponent類代碼示例

本文整理匯總了PHP中CBitrixComponent的典型用法代碼示例。如果您正苦於以下問題:PHP CBitrixComponent類的具體用法?PHP CBitrixComponent怎麽用?PHP CBitrixComponent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CBitrixComponent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getComponentTemplatePath

 /**
  * По Битрикс-имени шаблона возвращает путь к его файлу
  *
  * @param string $name
  * @return string
  * @throws \Twig_Error_Loader
  */
 private function getComponentTemplatePath($name)
 {
     $name = $this->normalizeName($name);
     list($namespace, $component, $template, $file) = explode(':', $name);
     $componentName = "{$namespace}:{$component}";
     $component = new \CBitrixComponent();
     $component->InitComponent($componentName, $template);
     $component->__templatePage = $file;
     $obTemplate = new \CBitrixComponentTemplate();
     $obTemplate->Init($component);
     $templatePath = $_SERVER['DOCUMENT_ROOT'] . $obTemplate->GetFile();
     if (!file_exists($templatePath)) {
         throw new \Twig_Error_Loader("Не удалось найти шаблон '{$name}'");
     }
     return $templatePath;
 }
開發者ID:maximaster,項目名稱:tools.twig,代碼行數:23,代碼來源:BitrixLoader.php

示例2: __construct

 function __construct($component = null)
 {
     parent::__construct($component);
     CModule::IncludeModule('iblock');
     CModule::IncludeModule('aqw.shop');
     CBitrixComponent::includeComponentClass('aqw:store.product');
 }
開發者ID:ASDAFF,項目名稱:bitrix_marketplace_module,代碼行數:7,代碼來源:class.php

示例3: __bx_share_get_handlers

 function __bx_share_get_handlers($template = false)
 {
     if (trim($template) == ".default") {
         $template = "";
     }
     $arBookmarkHandlerDropdown = array();
     $arBookmarkHandlerDropdownDefault = array();
     $shareComponent = new CBitrixComponent();
     $shareComponent->InitComponent("bitrix:main.share", $template);
     $shareComponent->InitComponentTemplate($template);
     if (strlen($shareComponent->__template->__folder) > 0) {
         $path2Handlers = $_SERVER["DOCUMENT_ROOT"] . "/" . $shareComponent->__template->__folder . "/handlers/";
         CheckDirPath($path2Handlers);
         $arHandlers = array();
         if ($handle = opendir($path2Handlers)) {
             while (($file = readdir($handle)) !== false) {
                 if ($file == "." || $file == "..") {
                     continue;
                 }
                 if (is_file($path2Handlers . $file) && strtoupper(substr($file, strlen($file) - 4)) == ".PHP") {
                     $name = $title = $icon_url_template = "";
                     $sort = 0;
                     include $path2Handlers . $file;
                     if (strlen($name) > 0) {
                         $arHandlers[$name] = array("TITLE" => $title, "ICON" => $icon_url_template, "SORT" => intval($sort));
                     }
                 }
             }
         }
         foreach ($arHandlers as $name => $arSystem) {
             if (strlen($arSystem["TITLE"]) > 0) {
                 $arBookmarkHandlerDropdown[$name] = $arSystem["TITLE"];
             }
         }
         $arBookmarkHandlerDropdownTmp = $arBookmarkHandlerDropdown;
         if (LANGUAGE != 'ru') {
             if (array_key_exists("vk", $arBookmarkHandlerDropdownTmp)) {
                 unset($arBookmarkHandlerDropdownTmp["vk"]);
             }
             if (array_key_exists("mailru", $arBookmarkHandlerDropdownTmp)) {
                 unset($arBookmarkHandlerDropdownTmp["mailru"]);
             }
         }
         $arBookmarkHandlerDropdownDefault = array_keys($arBookmarkHandlerDropdownTmp);
     }
     return array("HANDLERS" => $arBookmarkHandlerDropdown, "HANDLERS_DEFAULT" => $arBookmarkHandlerDropdownDefault);
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:47,代碼來源:util.php

示例4:

 /**
  * @param string $type
  * @param CBitrixComponent $obMenuComponent
  * @return string
  */
 function __GetMenuString($type = "left", $obMenuComponent)
 {
     /** @var CMenuCustom*/
     global $BX_MENU_CUSTOM;
     $sReturn = "";
     if ($GLOBALS["APPLICATION"]->buffer_manual) {
         $arMenuCustom = $BX_MENU_CUSTOM->GetItems($type);
         if (is_array($arMenuCustom)) {
             $obMenuComponent->arResult = array_merge($obMenuComponent->arResult, $arMenuCustom);
         }
         ob_start();
         $obMenuComponent->IncludeComponentTemplate();
         $sReturn = ob_get_contents();
         ob_end_clean();
     }
     return $sReturn;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:22,代碼來源:functions.php

示例5: includeComponentClass

	/**
	* Function includes class of the component by component name bitrix:component.base
	*
	* @param string $componentName
	* @return string
	*
	*/
	final public static function includeComponentClass($componentName)
	{
		$component = new CBitrixComponent;
		$component->initComponent($componentName);
	}
開發者ID:nProfessor,項目名稱:Mytb,代碼行數:12,代碼來源:component.php

示例6: OnAfterIndexAdd

 function OnAfterIndexAdd($ID, $arFields)
 {
     if (isset($arFields["PARAMS"]) && isset($arFields["PARAMS"]["socnet_group"])) {
         CBitrixComponent::clearComponentCache("bitrix:search.tags.cloud");
     }
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:6,代碼來源:search.php

示例7: __construct

 public function __construct($component = null)
 {
     parent::__construct($component);
     \Bitrix\Main\Loader::includeModule("forum");
     $this->componentId = $this->isAjaxRequest() ? randString(7) : $this->randString();
     $this->errorCollection = new ErrorCollection();
 }
開發者ID:rasuldev,項目名稱:torino,代碼行數:7,代碼來源:class.php

示例8: executeComponent

	public function executeComponent()
	{
		$this->IBLOCK_ID = $this->arParams["IBLOCK_ID"];
		$this->SECTION_ID = $this->arParams["SECTION_ID"];
		$this->FILTER_NAME = $this->arParams["FILTER_NAME"];
		$this->SAFE_FILTER_NAME = htmlspecialcharsbx($this->FILTER_NAME);

		if (self::$catalogIncluded === null)
			self::$catalogIncluded = Loader::includeModule('catalog');
		if (self::$catalogIncluded)
		{
			$arCatalog = CCatalogSKU::GetInfoByProductIBlock($this->IBLOCK_ID);
			if (!empty($arCatalog))
			{
				$this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"];
				$this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"];
			}
		}

		/*DEMO CODE for "pure" class.php component
		$this->arResult["FFF"] = "ggg";
		$this->includeComponentTemplate();
		return $this->ELEMENT_ID;
		*/

		return parent::executeComponent();
	}
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:27,代碼來源:class.php

示例9: setTemplateEpilog

 /**
  * Function saves component epilog environment
  *
  * @param array[string]mixed $arEpilogInfo
  * @return void
  *
  */
 public final function setTemplateEpilog($arEpilogInfo)
 {
     $this->__component_epilog = $arEpilogInfo;
     //Check if parent component exists and plug epilog it to it's "collection"
     if ($this->__parent) {
         $this->__parent->addChildEpilog($this->__component_epilog);
     }
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:15,代碼來源:component.php

示例10: __construct

 public function __construct($component = null)
 {
     parent::__construct($component);
     $this->helper = new CCrmProductSectionCrumbsHelper();
     $this->componentId = $this->randString();
     $this->errors = array();
     $this->catalogId = 0;
     $this->sectionId = 0;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:9,代碼來源:class.php

示例11: __construct

 public function __construct($component = null)
 {
     parent::__construct($component);
     $this->scope = self::STATUS_SCOPE_WEB;
     if (is_callable(array('\\Bitrix\\MobileApp\\Mobile', 'getApiVersion')) && \Bitrix\MobileApp\Mobile::getApiVersion() >= 1 && defined("BX_MOBILE") && BX_MOBILE === true) {
         $this->scope = self::STATUS_SCOPE_MOBILE;
     }
     if ($this->isWeb()) {
         $this->setTemplateName(".default");
     } else {
         $this->setTemplateName("mobile_app");
     }
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:13,代碼來源:class.php

示例12: executeComponent

 public function executeComponent()
 {
     parent::setFramemode(false);
     $this->userId = $this->arParams["USER_ID"];
     $this->fUserId = $this->arParams["FUSER_ID"];
     $this->weightKoef = $this->arParams["WEIGHT_KOEF"];
     $this->weightUnit = $this->arParams["WEIGHT_UNIT"];
     $this->columns = $this->arParams["COLUMNS_LIST"];
     $this->offersProps = $this->arParams["OFFERS_PROPS"];
     $this->quantityFloat = $this->arParams["QUANTITY_FLOAT"];
     $this->countDiscount4AllQuantity = $this->arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"];
     $this->priceVatShowValue = $this->arParams["PRICE_VAT_SHOW_VALUE"];
     $this->hideCoupon = $this->arParams["HIDE_COUPON"];
     $this->usePrepayment = $this->arParams["USE_PREPAYMENT"];
     $this->pathToOrder = $this->arParams["PATH_TO_ORDER"];
     return parent::executeComponent();
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:17,代碼來源:class.php

示例13: onPrepareComponentParams

 public function onPrepareComponentParams($params)
 {
     $params = parent::onPrepareComponentParams($params);
     if (!isset($this->arParams["WIDTH"])) {
         $this->arParams["WIDTH"] = 400;
     }
     if (!isset($this->arParams["HEIGHT"])) {
         $this->arParams["HEIGHT"] = 400;
     }
     if (!isset($this->arParams["SELECTED_STORE"])) {
         $this->arParams["SELECTED_STORE"] = 0;
         if (isset($params["STORES_LIST"]) && is_array($params["STORES_LIST"])) {
             reset($params["STORES_LIST"]);
             $this->arParams["SELECTED_STORE"] = key($params["STORES_LIST"]);
         }
     }
     return $params;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:18,代碼來源:class.php

示例14: __construct

 public function __construct($component = null)
 {
     parent::__construct($component);
     \Bitrix\Main\Loader::includeModule("forum");
     $this->componentId = $this->isAjaxRequest() ? randString(7) : $this->randString();
     $this->errorCollection = new ErrorCollection();
     $this->prepareMobileData = IsModuleInstalled("mobile");
     $this->scope = self::STATUS_SCOPE_WEB;
     if (is_callable(array('\\Bitrix\\MobileApp\\Mobile', 'getApiVersion')) && \Bitrix\MobileApp\Mobile::getApiVersion() >= 1 && defined("BX_MOBILE") && BX_MOBILE === true) {
         $this->scope = self::STATUS_SCOPE_MOBILE;
     }
     self::$index++;
     if ($this->isWeb()) {
         $this->setTemplateName(".default");
     } else {
         $this->setTemplateName("mobile_app");
     }
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:18,代碼來源:class.php

示例15: executeComponent

 public function executeComponent()
 {
     $this->IBLOCK_ID = $this->arParams["IBLOCK_ID"];
     $this->SECTION_ID = $this->arParams["SECTION_ID"];
     $this->FILTER_NAME = $this->arParams["FILTER_NAME"];
     if (CModule::IncludeModule("catalog")) {
         $arCatalog = CCatalog::GetSkuInfoByProductID($this->IBLOCK_ID);
         if (is_array($arCatalog)) {
             $this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"];
             $this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"];
         }
     }
     /*DEMO CODE for "pure" class.php component
     		$this->arResult["FFF"] = "ggg";
     		$this->includeComponentTemplate();
     		return $this->ELEMENT_ID;
     		*/
     return parent::executeComponent();
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:19,代碼來源:class.php


注:本文中的CBitrixComponent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。