本文整理汇总了PHP中CBitrixComponent类的典型用法代码示例。如果您正苦于以下问题:PHP CBitrixComponent类的具体用法?PHP CBitrixComponent怎么用?PHP CBitrixComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBitrixComponent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: array
{
CIBlockPriceTools::setRatioMinPrice($arResult, true);
}
if (!empty($arResult['DISPLAY_PROPERTIES']))
{
foreach ($arResult['DISPLAY_PROPERTIES'] as $propKey => $arDispProp)
{
if ('F' == $arDispProp['PROPERTY_TYPE'])
unset($arResult['DISPLAY_PROPERTIES'][$propKey]);
}
}
$arResult['SKU_PROPS'] = $arSKUPropList;
$arResult['DEFAULT_PICTURE'] = $arEmptyPreview;
$arResult['wish']['isWished'] = CIBlockElement::GetList(false, array(
'IBLOCK_ID' => 23,
'ACTIVE' => 'Y',
'PROPERTY_OBJECT' => $arResult['ID']
), false, false, array('ID'))->SelectedRowsCount();
CBitrixComponent::includeComponentClass("component.model:likes");
$objElement = new CIBlockElement;
$likes = new Likes(1);
$arResult['likes']['already_liked'] = $likes->isLikedByCurrent($arResult['ID']);
$arResult['likes']['value'] = $likes->count($arResult['ID']);
?>
开发者ID:ASDAFF,项目名称:mp,代码行数:31,代码来源:result_modifier.php
示例8: onPrepareComponentParams
<?php
use Bitrix\Main;
use Bitrix\Catalog\CatalogViewedProductTable;
use Bitrix\Main\Text\String;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\SystemException;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
CBitrixComponent::includeComponentClass("bitrix:sale.bestsellers");
class CatalogBigdataProductsComponent extends CSaleBestsellersComponent
{
protected $rcmParams;
protected $ajaxItemsIds;
/**
* Prepare Component Params
*/
public function onPrepareComponentParams($params)
{
global $APPLICATION;
// remember src params for further ajax query
if (!isset($params['RCM_CUR_BASE_PAGE'])) {
$params['RCM_CUR_BASE_PAGE'] = $APPLICATION->GetCurPage();
}
$this->arResult['_ORIGINAL_PARAMS'] = $params;
// bestselling
$params['FILTER'] = array('PAYED');
$params['PERIOD'] = 30;
return parent::onPrepareComponentParams($params);
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:class.php
示例9: onPrepareComponentParams
<?php
namespace Notagency\Components;
\CBitrixComponent::includeComponentClass('notagency:materials.list');
class MaterialsDetail extends MaterialsList
{
protected $checkParams = ['IBLOCK_CODE' => ['type' => 'string']];
public function onPrepareComponentParams($arParams)
{
$arParams = parent::onPrepareComponentParams($arParams);
$arParams['SELECT_SECTIONS'] = 'N';
$arParams['ELEMENTS_COUNT'] = 1;
$arParams['PAGING'] = 'N';
if (array_key_exists($arParams['REQUEST_ELEMENT_CODE'], $_REQUEST) && !empty($_REQUEST[$arParams['REQUEST_ELEMENT_CODE']])) {
$arParams['ELEMENT_CODE'] = htmlspecialchars(trim($_REQUEST[$arParams['REQUEST_ELEMENT_CODE']]));
}
if (array_key_exists($arParams['REQUEST_ELEMENT_ID'], $_REQUEST) && intval($_REQUEST[$arParams['REQUEST_ELEMENT_ID']])) {
$arParams['ELEMENT_ID'] = intval($_REQUEST[$arParams['REQUEST_ELEMENT_ID']]);
}
return $arParams;
}
protected function executeMain()
{
$filterInitialized = false;
if ($this->arParams['ELEMENT_ID']) {
$this->elementsFilter['ID'] = $this->arParams['ELEMENT_ID'];
$filterInitialized = true;
}
if ($this->arParams['ELEMENT_CODE']) {
$this->elementsFilter['CODE'] = $this->arParams['ELEMENT_CODE'];
开发者ID:notagency,项目名称:notagency.base,代码行数:31,代码来源:class.php
示例10: onPrepareComponentParams
<?php
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\SystemException;
use Bitrix\Main\Loader;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
CBitrixComponent::includeComponentClass("bitrix:catalog.viewed.products");
class CSaleBestsellersComponent extends CCatalogViewedProductsComponent
{
/**
* @param $params
* @override
* @return array
*/
public function onPrepareComponentParams($params)
{
$params = parent::onPrepareComponentParams($params);
if (!isset($params["CACHE_TIME"])) {
$params["CACHE_TIME"] = 86400;
}
$params["DETAIL_URL"] = trim($params["DETAIL_URL"]);
if (isset($params["BY"]) && is_array($params["BY"])) {
if (count($params["BY"])) {
$params["BY"] = array_values($params["BY"]);
$params["BY"] = $params["BY"][0];
} else {
$params["BY"] = "AMOUNT";
}
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:class.php
示例11: elseif
/**
* @param CBitrixComponent $parent
* @return bool
*/
function _checkParent($parent)
{
if ('Y' == $parent->arParams['AJAX_MODE']) {
return true;
} elseif ($parentComponent = $parent->GetParent()) {
return $this->_checkParent($parentComponent);
}
return false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:component_ajax.php
示例12: SaveMenu
function SaveMenu($path, $aMenuLinksTmp, $sMenuTemplateTmp)
{
global $APPLICATION;
CMain::InitPathVars($site, $path);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$strMenuLinks = "";
if (strlen($sMenuTemplateTmp) > 0) {
$strMenuLinks .= "\$sMenuTemplate = \"" . CFileMan::EscapePHPString($sMenuTemplateTmp) . "\";\n";
}
$strMenuLinks .= "\$aMenuLinks = Array(";
$i = 0;
foreach ($aMenuLinksTmp as $arMenuItem) {
$i++;
$strMenuLinksTmp = "";
if ($i > 1) {
$strMenuLinksTmp .= ",";
}
$strMenuLinksTmp .= "\n" . "\tArray(\n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[0]) . "\", \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[1]) . "\", \n" . "\t\tArray(";
if (is_array($arMenuItem[2])) {
for ($j = 0, $l = count($arMenuItem[2]); $j < $l; $j++) {
if ($j > 0) {
$strMenuLinksTmp .= ", ";
}
$strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arMenuItem[2][$j]) . "\"";
}
}
$strMenuLinksTmp .= "), \n";
$strMenuLinksTmp .= "\t\tArray(";
if (is_array($arMenuItem[3])) {
$arParams = array_keys($arMenuItem[3]);
for ($j = 0, $l = count($arParams); $j < $l; $j++) {
if ($j > 0) {
$strMenuLinksTmp .= ", ";
}
$strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arParams[$j]) . "\"=>" . "\"" . CFileMan::EscapePHPString($arMenuItem[3][$arParams[$j]]) . "\"";
}
}
$strMenuLinksTmp .= "), \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[4]) . "\" \n" . "\t)";
$strMenuLinks .= $strMenuLinksTmp;
}
$strMenuLinks .= "\n);";
$APPLICATION->SaveFileContent($DOC_ROOT . $path, "<" . "?\n" . $strMenuLinks . "\n?" . ">");
$GLOBALS["CACHE_MANAGER"]->CleanDir("menu");
CBitrixComponent::clearComponentCache("bitrix:menu");
}
开发者ID:Satariall,项目名称:izurit,代码行数:45,代码来源:fileman.php
示例13: array
/**
* Bitrix Framework
* @package bitrix
* @subpackage sale
* @copyright 2001-2014 Bitrix
*/
use Bitrix\Main;
use Bitrix\Main\DB;
use Bitrix\Main\Config;
use Bitrix\Main\Localization\Loc;
use Bitrix\Sale\Location;
use Bitrix\Main\Data;
CBitrixComponent::includeComponentClass("bitrix:sale.location.selector.search");
Loc::loadMessages(__FILE__);
class CBitrixLocationSelectorSystemComponent extends CBitrixLocationSelectorSearchComponent
{
const ID_BLOCK_LEN = 90;
const HUGE_TAIL_LEN = 30;
const PAGE_SIZE = 10;
const LOCATION_ENTITY_NAME = '\Bitrix\Sale\Location\LocationTable';
protected $entityClass = false;
protected $useGroups = true;
protected $useCodes = false;
protected $dbResult = array();
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:30,代码来源:class.php
示例14: IncludeComponent
function IncludeComponent($componentName, $componentTemplate, $arParams = array(), $parentComponent = null, $arFunctionParams = array())
{
/** @global CMain $APPLICATION */
global $APPLICATION, $USER;
if (is_array($this->arComponentMatch)) {
$skipComponent = true;
foreach ($this->arComponentMatch as $cValue) {
if (strpos($componentName, $cValue) !== false) {
$skipComponent = false;
break;
}
}
if ($skipComponent) {
return false;
}
}
$componentRelativePath = CComponentEngine::MakeComponentPath($componentName);
if (StrLen($componentRelativePath) <= 0) {
return False;
}
if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) {
$debug = new CDebugInfo();
$debug->Start();
} elseif ($APPLICATION->ShowIncludeStat) {
$debug = new CDebugInfo();
$debug->Start();
} else {
$debug = null;
}
if (is_object($parentComponent)) {
if (!$parentComponent instanceof cbitrixcomponent) {
$parentComponent = null;
}
}
$bDrawIcons = (!isset($arFunctionParams["HIDE_ICONS"]) || $arFunctionParams["HIDE_ICONS"] != "Y") && $APPLICATION->GetShowIncludeAreas();
if ($bDrawIcons) {
echo $this->IncludeStringBefore();
}
$result = null;
$bComponentEnabled = !isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] != "N";
$component = new CBitrixComponent();
if ($component->InitComponent($componentName)) {
$obAjax = null;
if ($bComponentEnabled) {
if ($arParams['AJAX_MODE'] == 'Y') {
$obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent);
}
$result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent);
}
if ($bDrawIcons) {
$panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled);
$arIcons = $panel->GetIcons();
echo $s = $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]);
}
if ($bComponentEnabled && $obAjax) {
$obAjax->Process();
}
}
if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) {
echo $debug->Output($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]);
} elseif (is_object($debug)) {
$debug->Stop($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]);
}
return $result;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:65,代码来源:main.php
示例15: __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
示例16: 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
示例17: 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
示例18: __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
示例19: __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
示例20: 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
注:本文中的CBitrixComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论