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


PHP Loader::includeModule方法代码示例

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


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

示例1: __construct

 /**
  * @param array $config
  */
 public function __construct(array $config = null)
 {
     Loader::includeModule('highloadblock');
     if ($config) {
         $this->config($config);
     }
 }
开发者ID:marvin255,项目名称:bxmigrate,代码行数:10,代码来源:HighLoadIb.php

示例2: getPropDirectory

function getPropDirectory(&$property)
{
    if (empty($property)) {
        return false;
    }
    if (!is_array($property)) {
        return false;
    }
    if (!isset($property['USER_TYPE_SETTINGS']['TABLE_NAME']) || empty($property['USER_TYPE_SETTINGS']['TABLE_NAME'])) {
        return false;
    }
    $highLoadInclude = \Bitrix\Main\Loader::includeModule('highloadblock');
    $highBlock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array("filter" => array('TABLE_NAME' => $property['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
    if (!isset($highBlock['ID'])) {
        return false;
    }
    $entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($highBlock);
    $entityDataClass = $entity->getDataClass();
    $entityList = $entityDataClass::getList();
    while ($arEntityItem = $entityList->Fetch()) {
        $val =& $property["VALUES"][$arEntityItem["UF_XML_ID"]];
        //foreach($property["VALUES"] as &$val){
        if (!empty($arEntityItem["UF_FILE"])) {
            $property["PICTURE_INCLUDED"] = true;
            $arEntityItem["~UF_FILE"] = $arEntityItem["UF_FILE"];
            $arEntityItem["PICTURE"] = CFile::GetPath($arEntityItem["~UF_FILE"]);
        }
        if (!empty($arEntityItem)) {
            $val = array_merge($val, $arEntityItem);
        }
        //}
        //echo'<pre>';print_r($arEntityItem);echo'</pre>';
    }
    return true;
}
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:35,代码来源:functions.php

示例3: getDirStructure

 public static function getDirStructure($bLogical, $site, $path)
 {
     global $USER;
     $arDirContent = array();
     if ($USER->CanDoFileOperation('fm_view_listing', array($site, $path))) {
         \Bitrix\Main\Loader::includeModule('fileman');
         $arDirs = array();
         $arFiles = array();
         \CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, array(), array("NAME" => "asc"), "DF", $bLogical, true);
         $arDirContent_t = array_merge($arDirs, $arFiles);
         for ($i = 0, $l = count($arDirContent_t); $i < $l; $i++) {
             $file = $arDirContent_t[$i];
             $arPath = array($site, $file['ABS_PATH']);
             if ($file["TYPE"] == "F" && !$USER->CanDoFileOperation('fm_view_file', $arPath) || $file["TYPE"] == "D" && !$USER->CanDoFileOperation('fm_view_listing', $arPath) || $file["TYPE"] == "F" && $file["NAME"] == ".section.php") {
                 continue;
             }
             $f = $file['TYPE'] == 'F' ? new \Bitrix\Main\IO\File($file['PATH'], $site) : new \Bitrix\Main\IO\Directory($file['PATH'], $site);
             $p = $f->getName();
             if ($f->isSystem() || $file['TYPE'] == 'F' && in_array($p, array("urlrewrite.php")) || $file['TYPE'] == 'D' && preg_match("/\\/(bitrix|" . \COption::getOptionString("main", "upload_dir", "upload") . ")\\//", "/" . $p . "/")) {
                 continue;
             }
             $arFileData = array('NAME' => $bLogical ? $file['LOGIC_NAME'] : $p, 'FILE' => $p, 'TYPE' => $file['TYPE'], 'DATA' => $file);
             if (strlen($arFileData['NAME']) <= 0) {
                 $arFileData['NAME'] = GetMessage('SEO_DIR_LOGICAL_NO_NAME');
             }
             $arDirContent[] = $arFileData;
         }
         unset($arDirContent_t);
     }
     return $arDirContent;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:seo_utils.php

示例4: onMessageAdd

 /**
  * Increments conversion post day counter
  *
  * @param int $id Topic ID.
  * @param array $message Message fields.
  * @param array $topicInfo Message TOPIC_INFO field.
  * @param array $forumInfo Message FORUM_INFO field.
  * @param array $fields Message fields used to insert.
  * @return void
  */
 public static function onMessageAdd($id, $message, $topicInfo, $forumInfo, $fields)
 {
     if (Loader::includeModule('conversion')) {
         $context = DayContext::getInstance();
         $context->addDayCounter('forum_post_add_day', 1);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:conversionhandlers.php

示例5: OnBasketAddHandler

function OnBasketAddHandler($ID, $arFields)
{
    global $USER;
    \Bitrix\Main\Loader::includeModule('catalog');
    \Bitrix\Main\Loader::includeModule('sale');
    if ($USER->IsAuthorized()) {
        $arFilter = array("USER_ID" => $USER->GetID());
        $db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
        $arrCount = [];
        while ($ar_sales = $db_sales->Fetch()) {
            $arrCount[] = $ar_sales;
        }
        if (is_array($arrCount) == false) {
            $res = CCatalogDiscount::SetCoupon('SL-CDUEA-HI8MMPY');
            //3%
        } else {
            if (count($arrCount) >= 1) {
                $resClean = CCatalogDiscount::ClearCoupon('SL-CDUEA-HI8MMPY');
                $res5 = CCatalogDiscount::SetCoupon('SL-0JG2C-XIHBEYZ');
                //5%
            } else {
            }
        }
    } else {
        $res = CCatalogDiscountCoupon::SetCoupon('SL-CDUEA-HI8MMPY');
        //3%
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:28,代码来源:CCatalogDiscount.php

示例6: isDesktopImOnline

 /**
  * Checks online status of IM.
  * @return bool
  */
 public static function isDesktopImOnline()
 {
     if (!Loader::includeModule('im')) {
         return false;
     }
     return \CIMMessenger::checkDesktopStatusOnline();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:11,代码来源:desktop.php

示例7: getTabs

 public static function getTabs($iblockElementInfo)
 {
     $showTab = false;
     $request = Context::getCurrent()->getRequest();
     if ($iblockElementInfo["ID"] > 0 && (!isset($request['action']) || $request['action'] != 'copy')) {
         $showTab = true;
         if (Loader::includeModule('catalog')) {
             /*
             				$dbRes = CatalogIblockTable::getList(array(
             					'filter' => array(
             						'=IBLOCK_ID' => $iblockElementInfo["IBLOCK"]["ID"],
             						'!PRODUCT_IBLOCK_ID' => 0
             					),
             					'select' => array('IBLOCK_ID'),
             				));
             				if($dbRes->fetch())
             				{
             					$showTab = false;
             				}
             */
             if (\CCatalogSku::getInfoByOfferIBlock($iblockElementInfo["IBLOCK"]["ID"]) !== false) {
                 $showTab = false;
             }
         }
     }
     return $showTab ? array(array("DIV" => "seo_adv", "SORT" => 4, "TAB" => Loc::getMessage("SEO_ADV_TAB"), "TITLE" => Loc::getMessage("SEO_ADV_TAB_TITLE"))) : null;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:27,代码来源:advtabengine.php

示例8: onPrepareComponentParams

 public function onPrepareComponentParams($arParams)
 {
     $arParams['ERROR'] = array();
     if (!Loader::includeModule('lists') || !Loader::includeModule('bizproc')) {
         $arParams['ERROR'][] = Loc::getMessage('CC_BLL_MODULE_NOT_INSTALLED');
         return $arParams;
     }
     global $USER;
     $arParams['LIST_PERM'] = CListPermissions::CheckAccess($USER, COption::GetOptionString("lists", "livefeed_iblock_type_id"), false);
     if ($arParams['LIST_PERM'] < 0) {
         switch ($arParams['LIST_PERM']) {
             case CListPermissions::WRONG_IBLOCK_TYPE:
                 $arParams['ERROR'][] = Loc::getMessage("CC_BLL_WRONG_IBLOCK_TYPE");
                 break;
             case CListPermissions::WRONG_IBLOCK:
                 $arParams['ERROR'][] = Loc::getMessage("CC_BLL_WRONG_IBLOCK");
                 break;
             case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
                 $arParams['ERROR'][] = Loc::getMessage("CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED");
                 break;
             default:
                 $arParams['ERROR'][] = Loc::getMessage("CC_BLL_UNKNOWN_ERROR");
                 break;
         }
     } elseif ($arParams['LIST_PERM'] <= CListPermissions::ACCESS_DENIED) {
         $arParams['ERROR'][] = Loc::getMessage("CC_BLL_ACCESS_DENIED");
     }
     $arParams['IBLOCK_TYPE_ID'] = COption::GetOptionString("lists", "livefeed_iblock_type_id");
     return $arParams;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:30,代码来源:class.php

示例9: DoInstall

 function DoInstall() {
     global $APPLICATION, $data;
     $loc = \WS\Migrations\Module::getInstance()->getLocalization('setup');
     $options = \WS\Migrations\Module::getInstance()->getOptions();
     global $errors;
     $errors = array();
     if ($data['catalog']) {
         $dir = $_SERVER['DOCUMENT_ROOT'].$data['catalog'];
         if (!is_dir($dir)) {
             mkdir($dir);
         }
         if (!is_dir($dir)) {
             $errors[] = $loc->getDataByPath('error.notCreateDir');
         }
         if (!$errors) {
             $options->catalogPath = $data['catalog'];
         }
         $this->InstallFiles();
         $this->InstallDB();
         RegisterModule(self::MODULE_ID);
         \Bitrix\Main\Loader::includeModule(self::MODULE_ID);
         \Bitrix\Main\Loader::includeModule('iblock');
         \WS\Migrations\Module::getInstance()->install();
     }
     if (!$data || $errors) {
         $APPLICATION->IncludeAdminFile($loc->getDataByPath('title'), __DIR__.'/form.php');
         return;
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-module-migrations,代码行数:29,代码来源:index.php

示例10: onExecuteStartWriting

 function onExecuteStartWriting(\Bitrix\Main\Event $event)
 {
     $parameters = $event->getParameters();
     $userId = $parameters[0];
     $dialogId = $parameters[1] . $parameters[2];
     if ($userId > 0) {
         if (!\Bitrix\Main\Loader::includeModule('pull')) {
             return;
         }
         \CPushManager::DeleteFromQueueBySubTag($userId, 'IM_MESS');
         if (intval($dialogId) > 0) {
             \CPullStack::AddByUser($dialogId, array('module_id' => 'im', 'command' => 'startWriting', 'expiry' => 60, 'params' => array('senderId' => $userId, 'dialogId' => $dialogId)));
         } elseif (substr($dialogId, 0, 4) == 'chat') {
             $chatId = substr($dialogId, 4);
             $arRelation = \CIMChat::GetRelationById($chatId);
             unset($arRelation[$userId]);
             $pullMessage = array('module_id' => 'im', 'command' => 'startWriting', 'expiry' => 60, 'params' => array('senderId' => $userId, 'dialogId' => $dialogId));
             \CPullStack::AddByUsers(array_keys($arRelation), $pullMessage);
             $orm = \Bitrix\Im\ChatTable::getById($chatId);
             $chat = $orm->fetch();
             if ($chat['TYPE'] == IM_MESSAGE_OPEN) {
                 \CPullWatch::AddToStack('IM_PUBLIC_' . $chatId, $pullMessage);
             }
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:26,代码来源:startwritinghandler.php

示例11: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (!Loader::includeModule('search')) {
         throw new BitrixException('Search module is not installed');
     }
     $searchResult = array();
     $bar = new ProgressBar($output, 0);
     do {
         $bar->display();
         $searchResult = \CSearch::ReIndexAll($input->getOption('full'), static::UPDATE_TIME, $searchResult);
         $bar->advance();
         $bar->clear();
         if (is_array($searchResult) && $searchResult['MODULE'] == 'main') {
             list(, $path) = explode("|", $searchResult["ID"], 2);
             $output->writeln("\r       " . $path, OutputInterface::VERBOSITY_VERBOSE);
         }
     } while (is_array($searchResult));
     $bar->finish();
     $bar->clear();
     $output->write("\r");
     if (ModuleManager::isModuleInstalled('socialnetwork')) {
         $output->writeln('<info>The Social Network module needs to be reindexed using the Social Network component in the public section of site.</info>');
     }
     $output->writeln(sprintf('<info>Reindexed</info> %d element%s.', $searchResult, $searchResult > 1 ? 's' : ''));
     return 0;
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:29,代码来源:ReIndexCommand.php

示例12: __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

示例13: checkRequiredModules

 protected function checkRequiredModules()
 {
     if (!Loader::includeModule('bizproc')) {
         throw new SystemException('Install module "bizproc"');
     }
     return $this;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:7,代码来源:class.php

示例14: onBannerClick

 /**
  * Increments conversion banner click day counter
  *
  * @param int $id Banner ID.
  * @param array $fields Banner fields.
  * @return void
  */
 public static function onBannerClick($id, $fields)
 {
     if (Loader::includeModule('conversion')) {
         $context = DayContext::getInstance();
         $context->addDayCounter('advertising_banner_click_day', 1);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:14,代码来源:conversionhandlers.php

示例15: executeComponent

 public function executeComponent()
 {
     try {
         if ($this->notCache() || $this->StartResultCache(false)) {
             if (!Loader::includeModule('iblock')) {
                 ShowError(GetMessage("IT_MODULE_NOT_INSTALLED"));
                 return;
             }
             $this->inCacheFunction();
             if ($this->includeComponentTemplateInCache) {
                 $this->SetResultCacheKeys($this->arSaveInCacheKeys);
                 $this->IncludeComponentTemplate();
             } else {
                 $this->EndResultCache();
             }
         }
         $this->lastCacheFunction();
         if (!$this->includeComponentTemplateInCache) {
             $this->IncludeComponentTemplate();
         }
     } catch (Exception $exc) {
         if ($this->set404) {
             @define("ERROR_404", "Y");
         } elseif ($this->showError) {
             $this->__showError($exc->getMessage());
         }
         $this->AbortResultCache();
     }
 }
开发者ID:Orendev,项目名称:bitrx.local,代码行数:29,代码来源:class.php


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