本文整理汇总了PHP中CBitrixComponent::includeComponentClass方法的典型用法代码示例。如果您正苦于以下问题:PHP CBitrixComponent::includeComponentClass方法的具体用法?PHP CBitrixComponent::includeComponentClass怎么用?PHP CBitrixComponent::includeComponentClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBitrixComponent
的用法示例。
在下文中一共展示了CBitrixComponent::includeComponentClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($component = null)
{
parent::__construct($component);
CModule::IncludeModule('iblock');
CModule::IncludeModule('aqw.shop');
CBitrixComponent::includeComponentClass('aqw:store.product');
}
示例2: 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";
}
}
示例3: 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'];
示例4: 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();
示例5: XML
<?php
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule('sale');
CBitrixComponent::includeComponentClass("component.model:xml");
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<customerOrder vatIncluded="true" applicable="true" sourceStoreUuid="existing-store-uuid"
payerVat="true" sourceAgentUuid="existing-counterparty-uuid" targetAgentUuid="existing-organization-uuid"
moment="2011-06-27T06:27:00+04:00" name="0001">
<customerOrderPosition vat="18" goodUuid="existing-good-uuid" quantity="4.0" discount="0.0">
<basePrice sumInCurrency="555000.0" sum="555000.0"/>
<reserve>0.0</reserve>
</customerOrderPosition>
</customerOrder>';
$data = new XML($xml);
var_dump($data->customerOrder->customerOrderPosition->getData());
示例6: foreach
$arRes["BASKET_DATA"]["GRID"]["HEADERS"] = $columnsData;
$arRes["COLUMNS"] = $strColumns;
$arRes["BASKET_ID"] = $arItem['ID'];
}
$arRes["CODE"] = $bBasketUpdate === true ? "SUCCESS" : "ERROR";
if ($bBasketUpdate === false && is_array($arErrors) && !empty($arErrors)) {
foreach ($arErrors as $error) {
$arRes["MESSAGE"] .= (strlen($arRes["MESSAGE"]) > 0 ? "<br/>" : "") . $error;
}
}
}
}
} else {
if ($_POST[$action_var] == "recalculate") {
// todo: extract duplicated code to function
CBitrixComponent::includeComponentClass("redvent:sale.basket.basket");
$basket = new CRedventBasketComponent();
$basket->onIncludeComponentLang();
$basket->weightKoef = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, SITE_ID));
$basket->weightUnit = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', "", SITE_ID));
$basket->columns = $arColumns;
$basket->offersProps = $strOffersProps;
$basket->quantityFloat = isset($_POST["quantity_float"]) && $_POST["quantity_float"] == "Y" ? "Y" : "N";
$basket->countDiscount4AllQuantity = isset($_POST["count_discount_4_all_quantity"]) && $_POST["count_discount_4_all_quantity"] == "Y" ? "Y" : "N";
$basket->priceVatShowValue = isset($_POST["price_vat_show_value"]) && $_POST["price_vat_show_value"] == "Y" ? "Y" : "N";
$basket->hideCoupon = isset($_POST["hide_coupon"]) && $_POST["hide_coupon"] == "Y" ? "Y" : "N";
$basket->usePrepayment = isset($_POST["use_prepayment"]) && $_POST["use_prepayment"] == "Y" ? "Y" : "N";
$res = $basket->recalculateBasket($_POST);
foreach ($res as $key => $value) {
$arRes[$key] = $value;
}
示例7: AqwCatalog
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
CBitrixComponent::includeComponentClass('aqw:store.catalog');
$catalog = new AqwCatalog();
$catalog->setOrder(array("RAND"=>"RAND"));
$catalog->setLimit(8);
$catalog->setFilter(array(">PROPERTY_VENDOR.ID"=>0, ">PROPERTY_MATERIAL.ID"=>0));
$arResult['ITEMS'] = $catalog->getItems();
$this->IncludeComponentTemplate();
?>
示例8: checkRequiredModules
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
/**
* Bitrix Framework
* @package bitrix
* @subpackage sale
* @copyright 2001-2014 Bitrix
*/
use Bitrix\Main;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Loader;
use Bitrix\Sale\Location\Admin\LocationHelper;
CBitrixComponent::includeComponentClass("bitrix:sale.location.import");
Loc::loadMessages(__FILE__);
class CBitrixCrmConfigLocationImport2Component extends CBitrixSaleLocationImportComponent
{
protected function checkRequiredModules()
{
$result = true;
if (!Loader::includeModule('sale')) {
$this->errors['FATAL'][] = Loc::getMessage("SALE_SLI_SALE_MODULE_NOT_INSTALL");
$result = false;
}
if (!Loader::includeModule('crm')) {
$this->errors['FATAL'][] = Loc::getMessage("SALE_CCLI2_CRM_MODULE_NOT_INSTALL");
$result = false;
}
return $result;
示例9: die
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();
CBitrixComponent::includeComponentClass("component.model:item");
/**
* News list
*
* @author Roman Morozov <tesset.studio@gmail.com>
* @version 1.0
*/
class FilterCatalog extends CBitrixComponent
{
const IBLOCK_ID = 6;
/**
* Изначальное значение сортировки
* @var array
*/
private $sort = array(
'NAME' => 'ASC'
);
/**
* Поля для выбора основных элементов
* @var array
*/
private $select = array(
'ID',
示例10: onPrepareComponentParams
* Базовый компонент для списков
* version 1.0.1
* Created by PhpStorm.
* User: Abai Adelshin
* www.orendev.ru
* Date: 01.02.2016
* Time: 11:15
* Базовый класс компонента для формирования списков (news.list)
* По умолчанию формирует независимый блок новостной карусели
* Необходимо подключить фреймворк bootstrap и jquery
*
* Доработать - Сформировать таблицу стилей
* Доработать Проверка условия подключения фреймворка bootstrap
*
*/
CBitrixComponent::includeComponentClass("itmanagement:base.component");
class newsClass extends TBaseComponent
{
const COUNT_ITEM_PAGE_DEFAULT = 4;
//количество элементов в одном блоке по умолчанию
protected $showError;
protected $countPage = 4;
protected $elementArSelect = array('IBLOCK_ID', 'ID', 'NAME', 'ACTIVE_FROM', 'PREVIEW_PICTURE', 'DETAIL_PICTURE', 'CODE', 'DETAIL_PAGE_URL', 'LIST_PAGE_URL');
/**
* @param $arParams
* @return mixed
* @throws Exception
* Обработка массива $arParams
*/
public function onPrepareComponentParams($arParams)
{
示例11: AqwSystem
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
CBitrixComponent::includeComponentClass('aqw:store.system');
$arResult['SYSTEM'] = new AqwSystem();
/**
* @var AqwCatalogMenu $this
* @var $arResult
*/
$this->setSectionID($_REQUEST['SECTION_ID']);
$arResult['MENU'] = $this->getTreeMenu();
if(count($arResult['MENU'])>0)
{
$arResult['ACTIVE_ID'] = $this->getSectionID();
$this->IncludeComponentTemplate();
}
?>
示例12: foreach
$arRes["BASKET_DATA"]["GRID"]["HEADERS"] = $columnsData;
$arRes["COLUMNS"] = $strColumns;
$arRes["BASKET_ID"] = $arItem['ID'];
}
$arRes["CODE"] = $bBasketUpdate === true ? "SUCCESS" : "ERROR";
if ($bBasketUpdate === false && is_array($arErrors) && !empty($arErrors)) {
foreach ($arErrors as $error) {
$arRes["MESSAGE"] .= (strlen($arRes["MESSAGE"]) > 0 ? "<br/>" : "") . $error;
}
}
}
}
} else {
if ($_POST[$action_var] == "recalculate") {
// todo: extract duplicated code to function
CBitrixComponent::includeComponentClass("bitrix:sale.basket.basket");
$basket = new CBitrixBasketComponent();
$basket->onIncludeComponentLang();
$basket->weightKoef = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, SITE_ID));
$basket->weightUnit = htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', "", SITE_ID));
$basket->columns = $arColumns;
$basket->offersProps = $strOffersProps;
$basket->quantityFloat = isset($_POST["quantity_float"]) && $_POST["quantity_float"] == "Y" ? "Y" : "N";
$basket->countDiscount4AllQuantity = isset($_POST["count_discount_4_all_quantity"]) && $_POST["count_discount_4_all_quantity"] == "Y" ? "Y" : "N";
$basket->priceVatShowValue = isset($_POST["price_vat_show_value"]) && $_POST["price_vat_show_value"] == "Y" ? "Y" : "N";
$basket->hideCoupon = isset($_POST["hide_coupon"]) && $_POST["hide_coupon"] == "Y" ? "Y" : "N";
$basket->usePrepayment = isset($_POST["use_prepayment"]) && $_POST["use_prepayment"] == "Y" ? "Y" : "N";
$res = $basket->recalculateBasket($_POST);
foreach ($res as $key => $value) {
$arRes[$key] = $value;
}
示例13: __construct
<?php
CBitrixComponent::includeComponentClass("component.model:abstractItem");
/**
* Сущность элемента
*/
class Item extends AbstractItem
{
public function __construct($item)
{
if (!$item) {
return false;
}
$this->item = $item;
}
/**
* Обрезка текста последним пробелом с добавлнием троеточия
* @param strign $text Большой текст для обрезки
* @param integer $size Максимальный размер обрезанного текста
* @return strging Обрезанный текст
*/
public function cutText($text, $size = 150)
{
if (strlen($text) > $size) {
$text = substr(\HTMLToTxt($text), 0, strripos(substr(\HTMLToTxt($text), 0, $size), " ")) . "...";
}
return $text;
}
/**
* {@inheritdoc}
*/
示例14: 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']);
?>
示例15: processElement
<?php
namespace Notagency\Components;
\CBitrixComponent::includeComponentClass('notagency:materials.detail');
class CatalogDetail extends MaterialsDetail
{
protected $needModules = ['iblock', 'catalog'];
protected function processElement($element)
{
$element = parent::processElement($element);
$element = $this->processAmount($element);
$element = $this->processPrice($element);
return $element;
}
protected function processAmount($element)
{
$product = \CCatalogProduct::GetByID($element['ID']);
$element['QUANTITY'] = $product['QUANTITY'];
return $element;
}
protected function processPrice($element)
{
$element['CATALOG_DETAILS'] = \CCatalogProduct::GetOptimalPrice($element['ID']);
$element['PRICE_FORMATTED'] = $this->formatPrice($element['CATALOG_DETAILS']['PRICE']['PRICE']);
return $element;
}
protected function formatPrice($price)
{
$price = \CCurrencyLang::CurrencyFormat($price, 'RUB', false);
return $price;