本文整理汇总了PHP中Bitrix\Main\ModuleManager类的典型用法代码示例。如果您正苦于以下问题:PHP ModuleManager类的具体用法?PHP ModuleManager怎么用?PHP ModuleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: DoUninstall
public function DoUninstall()
{
$this->uninstallFiles();
\Bitrix\Main\Config\Option::delete($this->MODULE_ID);
\Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
return true;
}
开发者ID:beGateway,项目名称:bitrix-payment-module,代码行数:7,代码来源:index.php
示例2: DoUninstall
public function DoUninstall()
{
$this->UnInstallFiles();
ModuleManager::unRegisterModule($this->MODULE_ID);
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->unRegisterEventHandler("fileman", "OnBeforeHTMLEditorScriptRuns", $this->MODULE_ID, '\\Newkaliningrad\\Typografru\\Typograf', "onBeforeHTMLEditorScriptRuns");
}
开发者ID:askew-,项目名称:bitrix-typograf,代码行数:7,代码来源:index.php
示例3: 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
示例4: getSecurityContextByUser
/**
* Gets security context (access provider) for user.
* Attention! File/Folder can use anywhere and SecurityContext have to check rights anywhere (any module).
* @param mixed $user User which use for check rights.
* @return SecurityContext
*/
public function getSecurityContextByUser($user)
{
if ($this->isCurrentUser($user)) {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if (Loader::includeModule('socialnetwork') && \CSocnetUser::isCurrentUserModuleAdmin()) {
return new FakeSecurityContext($user);
}
if (UserModel::isCurrentUserAdmin()) {
return new FakeSecurityContext($user);
}
} else {
$userId = UserModel::resolveUserId($user);
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if ($userId && Loader::includeModule('socialnetwork') && \CSocnetUser::isUserModuleAdmin($userId)) {
return new FakeSecurityContext($user);
}
try {
if ($userId && ModuleManager::isModuleInstalled('bitrix24') && Loader::includeModule('bitrix24') && \CBitrix24::isPortalAdmin($userId)) {
return new FakeSecurityContext($user);
} elseif ($userId) {
//Check user group 1 ('Admins')
$tmpUser = new \CUser();
$arGroups = $tmpUser->getUserGroup($userId);
if (in_array(1, $arGroups)) {
return new FakeSecurityContext($user);
}
}
} catch (\Exception $e) {
}
}
return new DiskSecurityContext($user);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:38,代码来源:disk.php
示例5: DoUninstall
function DoUninstall()
{
$this->unInstallDB();
$this->unInstallFiles();
ModuleManager::unRegisterModule($this->MODULE_ID);
$GLOBALS['APPLICATION']->IncludeAdminFile(GetMessage("UMBM_UNINSTALL_TITLE"), $this->install_source . 'unstep.php');
}
开发者ID:u-mulder,项目名称:bixmigs,代码行数:7,代码来源:index.php
示例6: UnInstallDB
public function UnInstallDB($arParams = array())
{
global $errors;
//COption::RemoveOption($this->getModuleId());
\Bitrix\Main\ModuleManager::unRegisterModule($this->MODULE_ID);
return true;
}
开发者ID:ASDAFF,项目名称:bitrix_parser,代码行数:7,代码来源:index.php
示例7: doUninstall
public function doUninstall()
{
ModuleManager::unregisterModule($this->MODULE_ID);
$this->UnInstallFiles();
$this->uninstallDB();
UnRegisterModuleDependences('iblock', 'OnBeforeIBlockElementDelete', $this->MODULE_ID, '\Iiko\Event', 'onIBlockElementDelete');
}
开发者ID:phwb,项目名称:ugraweb.iiko,代码行数:8,代码来源:index.php
示例8: getActiveUsersCount
public static function getActiveUsersCount()
{
$sql = "SELECT COUNT(ID) " . "FROM b_user " . "WHERE ACTIVE = 'Y' " . " AND LAST_LOGIN IS NOT NULL";
if (ModuleManager::isModuleInstalled("intranet")) {
$sql = "SELECT COUNT(U.ID) " . "FROM b_user U " . "WHERE U.ACTIVE = 'Y' " . " AND U.LAST_LOGIN IS NOT NULL " . " AND EXISTS(" . " SELECT 'x' " . " FROM b_utm_user UF, b_user_field F " . " WHERE F.ENTITY_ID = 'USER' " . " AND F.FIELD_NAME = 'UF_DEPARTMENT' " . " AND UF.FIELD_ID = F.ID " . " AND UF.VALUE_ID = U.ID " . " AND UF.VALUE_INT IS NOT NULL " . " AND UF.VALUE_INT <> 0" . " )";
}
$connection = Application::getConnection();
return $connection->queryScalar($sql);
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:9,代码来源:user.php
示例9: isExternalUser
/**
* Check if user is extranet user
* @param integer $userID User ID
* @return boolean
*/
public static function isExternalUser($userID)
{
if (!ModuleManager::isModuleInstalled('extranet')) {
return false;
}
$dbResult = \CUser::getList($o = 'ID', $b = 'ASC', array('ID_EQUAL_EXACT' => $userID), array('FIELDS' => array('ID'), 'SELECT' => array('UF_DEPARTMENT')));
$user = $dbResult->Fetch();
return !(is_array($user) && isset($user['UF_DEPARTMENT']) && isset($user['UF_DEPARTMENT'][0]) && $user['UF_DEPARTMENT'][0] > 0);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:14,代码来源:intranetmanager.php
示例10: isPaidLicense
public static function isPaidLicense()
{
if (self::$isLicensePaid !== null) {
return self::$isLicensePaid;
}
if (!(ModuleManager::isModuleInstalled('bitrix24') && Loader::includeModule('bitrix24')) && method_exists('CBitrix24', 'IsLicensePaid')) {
return self::$isLicensePaid = false;
}
return self::$isLicensePaid = \CBitrix24::IsLicensePaid();
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:10,代码来源:bitrix24manager.php
示例11: UnInstallDB
function UnInstallDB($arParams = array())
{
UnRegisterModuleDependences('conversion', 'OnGetCounterTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetCounterTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeGroupTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeGroupTypes');
UnRegisterModuleDependences('conversion', 'OnSetDayContextAttributes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onSetDayContextAttributes');
UnRegisterModuleDependences('main', 'OnProlog', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onProlog');
global $DB;
$DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/conversion/install/db/' . strtolower($DB->type) . '/uninstall.sql');
ModuleManager::unRegisterModule('conversion');
return true;
}
开发者ID:vim84,项目名称:b-markt,代码行数:12,代码来源:index.php
示例12: IsAdmin
public static function IsAdmin($userID = 0)
{
if (!is_int($userID)) {
$userID = is_numeric($userID) ? (int) $userID : 0;
}
$result = false;
if ($userID <= 0) {
$user = CCrmSecurityHelper::GetCurrentUser();
$userID = $user->GetID();
if ($userID <= 0) {
false;
}
if (isset(self::$USER_ADMIN_FLAGS[$userID])) {
return self::$USER_ADMIN_FLAGS[$userID];
}
$result = $user->IsAdmin();
if ($result) {
self::$USER_ADMIN_FLAGS[$userID] = true;
return true;
}
try {
if (\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24') && CModule::IncludeModule('bitrix24')) {
if (class_exists('CBitrix24') && method_exists('CBitrix24', 'IsPortalAdmin')) {
// New style check
$result = CBitrix24::IsPortalAdmin($userID);
} else {
// Check user group 1 ('Portal admins')
$arGroups = $user->GetUserGroup($userID);
$result = in_array(1, $arGroups);
}
}
} catch (Exception $e) {
}
} else {
if (isset(self::$USER_ADMIN_FLAGS[$userID])) {
return self::$USER_ADMIN_FLAGS[$userID];
}
try {
if (IsModuleInstalled('bitrix24') && CModule::IncludeModule('bitrix24') && class_exists('CBitrix24') && method_exists('CBitrix24', 'IsPortalAdmin')) {
// Bitrix24 context new style check
$result = CBitrix24::IsPortalAdmin($userID);
} else {
//Check user group 1 ('Admins')
$user = new CUser();
$arGroups = $user->GetUserGroup($userID);
$result = in_array(1, $arGroups);
}
} catch (Exception $e) {
}
}
self::$USER_ADMIN_FLAGS[$userID] = $result;
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:53,代码来源:crm_perms.php
示例13: initDiscountSettings
public static function initDiscountSettings()
{
if (self::$useSaleDiscount === null)
{
self::$useSaleDiscount = ModuleManager::isModuleInstalled('sale') && (string)Option::get('sale', 'use_sale_discount_only') == 'Y';
}
if (self::$getPercentFromBasePrice === null)
{
$moduleID = (self::$useSaleDiscount ? 'sale' : 'catalog');
self::$getPercentFromBasePrice = (string)Option::get($moduleID, 'get_discount_percent_from_base_price') == 'Y';
}
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:12,代码来源:discount.php
示例14: onUserLoginSocserv
public static function onUserLoginSocserv($params)
{
global $USER;
if ($params['EXTERNAL_AUTH_ID'] === \CSocServBitrix24Net::ID && \Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24')) {
$notificationOptions = \CUserOptions::getOption("socialservices", "notifications", array());
$lastDate = 0;
if (isset($notificationOptions["CONTACTS_NOTIFY_DATE"])) {
$lastDate = $notificationOptions["CONTACTS_NOTIFY_DATE"];
}
if ($lastDate < time() - 86400) {
static::notifyPossible($USER->getId());
$notificationOptions["CONTACTS_NOTIFY_DATE"] = time();
\CUserOptions::setOption("socialservices", "notifications", $notificationOptions);
}
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:contact.php
示例15: UnInstallDB
function UnInstallDB($params = array())
{
UnRegisterModuleDependences('conversion', 'OnGetCounterTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetCounterTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeTypes');
UnRegisterModuleDependences('conversion', 'OnGetAttributeGroupTypes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onGetAttributeGroupTypes');
UnRegisterModuleDependences('conversion', 'OnSetDayContextAttributes', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onSetDayContextAttributes');
UnRegisterModuleDependences('main', 'OnProlog', 'conversion', '\\Bitrix\\Conversion\\Internals\\Handlers', 'onProlog');
ModuleManager::unRegisterModule('conversion');
if ($params['SAVE_TABLES'] !== 'Y') {
global $DB;
$DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/conversion/install/db/' . strtolower($DB->type) . '/uninstall.sql');
Option::delete('conversion', array('name' => 'START_DATE_TIME'));
Option::delete('conversion', array('name' => 'BASE_CURRENCY'));
Option::delete('conversion', array('name' => 'GENERATE_INITIAL_DATA'));
}
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:index.php
示例16: buildSaleAdminMobileMenu
function buildSaleAdminMobileMenu()
{
$items = array(array("text" => GetMessage("SMOB_ALL_ORDERS"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php", "data-pageid" => "orders_list", "default" => true, "push-param" => "sl"), array("text" => GetMessage("SMOB_WAITING_FOR_PAY"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php?action=get_filtered&filter_name=waiting_for_pay", "data-pageid" => "orders_waiting_for_pay"), array("text" => GetMessage("SMOB_WAITING_FOR_DELIVERY"), "data-url" => "/bitrix/admin/mobile/sale_orders_list.php?action=get_filtered&filter_name=waiting_for_delivery", "data-pageid" => "orders_waiting_for_delivery"));
if (\Bitrix\Main\ModuleManager::isModuleInstalled("pull")) {
$items[] = array("text" => GetMessage("SMOB_PUSH_SETTINGS"), "data-url" => "/bitrix/admin/mobile/sale_orders_push.php", "data-pageid" => "orders_push");
}
$arMenu = array(array("text" => GetMessage("SMOB_ORDERS_MANAGEMENT"), "type" => "section", "items" => $items));
$arRepMenu = self::getMobileReports();
if ($arRepMenu) {
$arMenu[] = $arRepMenu;
}
$startSortMenuPosition = 200;
foreach ($arMenu as $key => $item) {
$item["sort"] = $key + $startSortMenuPosition;
CAdminMobileMenu::addItem($item);
}
return true;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:mobile_order.php
示例17: getModules
public static function getModules()
{
if (!($modules =& self::$modules)) {
$default = array('ACTIVE' => !ModuleManager::isModuleInstalled('sale'));
foreach (array(AttributeManager::getTypesInternal(), CounterManager::getTypesInternal(), RateManager::getTypesInternal()) as $types) {
foreach ($types as $type) {
$modules[$type['MODULE']] = $default;
}
}
if ($modules['sale']) {
$modules['sale']['ACTIVE'] = true;
}
$modules = unserialize(Option::get('conversion', 'MODULES', 'a:0:{}')) + $modules;
// TODO all modules with attributes must be active
$modules['conversion'] = $modules['abtest'] = $modules['sender'] = $modules['seo'] = array('ACTIVE' => true);
ksort($modules);
}
return $modules;
}
开发者ID:Satariall,项目名称:izurit,代码行数:19,代码来源:config.php
示例18: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arTemplateParameters['LINE_ELEMENT_COUNT'] = array("PARENT" => "VISUAL", "NAME" => GetMessage("SRP_LINE_ELEMENT_COUNT"), "TYPE" => "STRING", "DEFAULT" => "3");
$arThemes = array();
if (\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix.eshop')) {
$arThemes['site'] = GetMessage('SRP_TPL_THEME_SITE');
}
$arThemesList = array('blue' => GetMessage('SRP_TPL_THEME_BLUE'), 'green' => GetMessage('SRP_TPL_THEME_GREEN'), 'red' => GetMessage('SRP_TPL_THEME_RED'), 'wood' => GetMessage('SRP_TPL_THEME_WOOD'), 'yellow' => GetMessage('SRP_TPL_THEME_YELLOW'), 'black' => GetMessage('SRP_TPL_THEME_BLACK'));
$dir = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/themes/"));
if (is_dir($dir)) {
foreach ($arThemesList as $themeID => $themeName) {
if (!is_file($dir . $themeID . '/style.css')) {
continue;
}
$arThemes[$themeID] = $themeName;
}
}
$arTemplateParameters['TEMPLATE_THEME'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage("SRP_TPL_TEMPLATE_THEME"), 'TYPE' => 'LIST', 'VALUES' => $arThemes, 'DEFAULT' => 'blue', 'ADDITIONAL_VALUES' => 'Y');
开发者ID:rasuldev,项目名称:torino,代码行数:21,代码来源:.parameters.php
示例19: isset
$message = null;
try
{
$currentUser = $engine->getCurrentUser();
}
catch(Exception $e)
{
$currentUser = null;
$bNeedAuth = true;
}
$bReadOnly = $bNeedAuth;
$bAllowUpdate = !$bNeedAuth;
$bSale = Main\ModuleManager::isModuleInstalled('sale')
&& Main\ModuleManager::isModuleInstalled('catalog')
&& Main\Loader::includeModule('currency');
$request = Main\Context::getCurrent()->getRequest();
$back_url = isset($request["back_url"]) ? $request["back_url"] : '';
$campaignId = intval($request["campaign"]);
$elementId = intval($request["element"]);
$ID = intval($request["ID"]);
if($ID > 0)
{
$dbRes = Adv\YandexBannerTable::getByPrimary($ID);
$banner = $dbRes->fetch();
if($banner)
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:seo_search_yandex_direct_banner_edit.php
示例20: array
if (ModuleManager::isModuleInstalled("blog")) {
$arTemplateParameters['BLOG_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['BLOG_USE']) && $arCurrentValues['BLOG_USE'] == 'Y') {
$arTemplateParameters['BLOG_URL'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_URL'), 'TYPE' => 'STRING', 'DEFAULT' => 'catalog_comments');
$arTemplateParameters['BLOG_EMAIL_NOTIFY'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_EMAIL_NOTIFY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N');
}
}
$boolRus = false;
$langBy = "id";
$langOrder = "asc";
$rsLangs = CLanguage::GetList($langBy, $langOrder, array('ID' => 'ru', "ACTIVE" => "Y"));
if ($arLang = $rsLangs->Fetch()) {
$boolRus = true;
}
if ($boolRus) {
$arTemplateParameters['VK_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['VK_USE']) && 'Y' == $arCurrentValues['VK_USE']) {
$arTemplateParameters['VK_API_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_API_ID'), 'TYPE' => 'STRING', 'DEFAULT' => 'API_ID');
}
}
$arTemplateParameters['FB_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['FB_USE']) && 'Y' == $arCurrentValues['FB_USE']) {
$arTemplateParameters['FB_APP_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_APP_ID'), 'TYPE' => 'STRING', 'DEFAULT' => '');
}
}
if (ModuleManager::isModuleInstalled("highloadblock")) {
$arTemplateParameters['BRAND_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BRAND_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['BRAND_USE']) && $arCurrentValues['BRAND_USE'] == 'Y') {
$arTemplateParameters['BRAND_PROP_CODE'] = array('PARENT' => 'VISUAL', "NAME" => GetMessage("CP_BCE_TPL_BRAND_PROP_CODE"), "TYPE" => "LIST", "VALUES" => $arHighloadPropList, "MULTIPLE" => "Y", "ADDITIONAL_VALUES" => "Y");
}
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:.parameters.php
注:本文中的Bitrix\Main\ModuleManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论