当前位置: 首页>>代码示例>>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;未经允许,请勿转载。