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


PHP IsModuleInstalled函数代码示例

本文整理汇总了PHP中IsModuleInstalled函数的典型用法代码示例。如果您正苦于以下问题:PHP IsModuleInstalled函数的具体用法?PHP IsModuleInstalled怎么用?PHP IsModuleInstalled使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: GetUserWorkflowTaskCount

 public static function GetUserWorkflowTaskCount($workflowIDs, $userID = 0)
 {
     if (!is_array($workflowIDs)) {
         return 0;
     }
     if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc'))) {
         return 0;
     }
     $userID = intval($userID);
     if ($userID <= 0) {
         $userID = CCrmSecurityHelper::GetCurrentUserID();
     }
     $filter = array('USER_ID' => $userID);
     $workflowQty = count($workflowIDs);
     if ($workflowQty > 1) {
         //IMPORTANT: will produce SQL error due to CBPTaskService::GetList bug
         //$filter['@WORKFLOW_ID'] = $workflowIDs;
         $filter['WORKFLOW_ID'] = $workflowIDs[0];
     }
     /*elseif($workflowQty === 1)
     		{
     			$filter['WORKFLOW_ID'] = $workflowIDs[0];
     		}*/
     $result = CBPTaskService::GetList(array(), $filter, array(), false, array());
     return is_int($result) ? $result : 0;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:crm_bizproc_helper.php

示例2: IsAdmin

 public static function IsAdmin($userId = null)
 {
     $result = false;
     if ($userId === null) {
         $user = self::GetCurrentUser();
         if ($user->IsAdmin()) {
             return true;
         }
         $userId = $user->getId();
     }
     $userId = (int) $userId;
     if ($userId <= 0) {
         return false;
     }
     try {
         if (IsModuleInstalled('bitrix24') && CModule::IncludeModule('bitrix24')) {
             if (class_exists('CBitrix24') && method_exists('CBitrix24', 'IsPortalAdmin')) {
                 // New style check
                 $result = CBitrix24::IsPortalAdmin($userId);
             } else {
                 // HACK: Check user group 1 ('Portal admins')
                 $arGroups = CUser::GetUserGroup($userId);
                 $result = in_array(1, $arGroups);
             }
         }
     } catch (Exception $e) {
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:29,代码来源:extlinks.php

示例3: CheckModules

 function CheckModules()
 {
     global $APPLICATION;
     if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus()) {
         $this->errors[] = GetMessage('VI_CHECK_PULL');
     }
     if (!IsModuleInstalled('im')) {
         $this->errors[] = GetMessage('VI_CHECK_IM');
     }
     include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/version.php";
     if (version_compare("14.9.2", SM_VERSION) == 1) {
         $this->errors[] = GetMessage('VI_CHECK_MAIN');
     }
     if (IsModuleInstalled('intranet')) {
         include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/install/version.php";
         if (version_compare("14.5.6", $arModuleVersion["VERSION"]) == 1) {
             $this->errors[] = GetMessage('VI_CHECK_INTRANET');
         }
     } else {
         $this->errors[] = GetMessage('VI_CHECK_INTRANET_INSTALL');
     }
     if (is_array($this->errors) && !empty($this->errors)) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         return true;
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:index.php

示例4: DoInstall

 public function DoInstall()
 {
     global $APPLICATION, $adminPage, $USER, $adminMenu, $adminChain;
     if ($GLOBALS['APPLICATION']->GetGroupRight('main') < 'W') {
         return;
     }
     CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/" . $this->MODULE_ID . "/install/components/" . $this->MODULE_ID, $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components/" . $this->MODULE_ID, true, true);
     if (is_array($this->NEED_MODULES) && !empty($this->NEED_MODULES)) {
         foreach ($this->NEED_MODULES as $module) {
             if (!IsModuleInstalled($module)) {
                 $this->ShowForm('ERROR', GetMessage('DADATA_SUGGESTIONS_NEED_MODULES', array('#MODULE#' => $module)));
             }
         }
     }
     if (strlen($this->NEED_MAIN_VERSION) <= 0 || version_compare(SM_VERSION, $this->NEED_MAIN_VERSION) >= 0) {
         if ($this->InstallDB()) {
             $this->ShowForm('OK', GetMessage('MOD_INST_OK'), 'install');
         } else {
             $strError = '';
             if ($ex = $APPLICATION->GetException()) {
                 $strError = $ex->GetString();
             } else {
                 $strError = GetMessage('DADATA_SUGGESTIONS_UNKNOWN_ERR_INSTALL');
             }
             $this->ShowForm('ERROR', GetMessage('DADATA_SUGGESTIONS_NOT_INSTALL', array('#ERR#' => $strError)));
         }
     } else {
         $this->ShowForm('ERROR', GetMessage('DADATA_SUGGESTIONS_NEED_RIGHT_VER', array('#NEED#' => $this->NEED_MAIN_VERSION)));
     }
 }
开发者ID:ASDAFF,项目名称:suggestions-bitrix,代码行数:30,代码来源:index.php

示例5: getFriendsList

 public function getFriendsList($limit, &$next)
 {
     if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
         $redirect_uri = static::CONTROLLER_URL . "/redirect.php";
     } else {
         $redirect_uri = CSocServUtil::ServerName() . "/bitrix/tools/oauth/google.php";
     }
     $ob = $this->getEntityOAuth();
     if ($ob->GetAccessToken($redirect_uri) !== false) {
         $res = $ob->getCurrentUserFriends($limit, $next);
         foreach ($res["items"] as $key => $contact) {
             $contact["uid"] = $contact["id"];
             if (array_key_exists("name", $contact)) {
                 $contact["first_name"] = $contact["name"]["givenName"];
                 $contact["last_name"] = $contact["name"]["familyName"];
             } else {
                 list($contact["first_name"], $contact["last_name"]) = explode(" ", $contact["displayName"], 2);
             }
             if (array_key_exists("image", $contact)) {
                 $contact["picture"] = preg_replace("/\\?.*\$/", "", $contact["image"]["url"]);
             }
             $res["items"][$key] = $contact;
         }
         return $res["items"];
     }
     return false;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:27,代码来源:googleplus.php

示例6: Notify

 public static function Notify($addresseeID, $internalMessage, $externalMessage, $schemeTypeID, $tag = '')
 {
     self::ClearErrors();
     if (!(IsModuleInstalled('im') && CModule::IncludeModule('im'))) {
         self::RegisterError('IM module is not installed.');
         return false;
     }
     if ($addresseeID <= 0) {
         self::RegisterError('Addressee is not assigned.');
         return false;
     }
     $arMessage = array('TO_USER_ID' => $addresseeID, 'FROM_USER_ID' => 0, 'NOTIFY_TYPE' => IM_NOTIFY_SYSTEM, 'NOTIFY_MODULE' => 'crm', 'NOTIFY_MESSAGE' => strval($internalMessage), 'NOTIFY_MESSAGE_OUT' => strval($externalMessage));
     $schemeTypeName = CCrmNotifierSchemeType::ResolveName($schemeTypeID);
     if ($schemeTypeName !== '') {
         $arMessage['NOTIFY_EVENT'] = $schemeTypeName;
     }
     $tag = strval($tag);
     if ($tag !== '') {
         $arMessage['NOTIFY_TAG'] = $tag;
     }
     $msgID = CIMNotify::Add($arMessage);
     if (!$msgID) {
         $e = $GLOBALS['APPLICATION']->GetException();
         $errorMessage = $e ? $e->GetString() : 'Unknown sending error. message not send.';
         self::RegisterError($errorMessage);
         return false;
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:29,代码来源:crm_notifier.php

示例7: isEnabled

 public static function isEnabled()
 {
     if (self::$ENABLE_VOX_IMPLANT === null) {
         self::$ENABLE_VOX_IMPLANT = IsModuleInstalled('voximplant') && CModule::IncludeModule('voximplant');
     }
     return self::$ENABLE_VOX_IMPLANT;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:sip_helper.php

示例8: GetServices

 function GetServices($servicePath, $arFilter = array())
 {
     $arServices = array();
     include $servicePath . ".services.php";
     if (empty($arServices)) {
         return $arServices;
     }
     $servicePosition = 1;
     foreach ($arServices as $serviceID => $arService) {
         if (isset($arFilter["SKIP_INSTALL_ONLY"]) && array_key_exists("INSTALL_ONLY", $arService) && $arService["INSTALL_ONLY"] == $arFilter["SKIP_INSTALL_ONLY"]) {
             unset($arServices[$serviceID]);
             continue;
         }
         if (isset($arFilter["SERVICES"]) && is_array($arFilter["SERVICES"]) && !in_array($serviceID, $arFilter["SERVICES"]) && !array_key_exists("INSTALL_ONLY", $arService)) {
             unset($arServices[$serviceID]);
             continue;
         }
         //Check service dependencies
         $modulesCheck = array($serviceID);
         if (array_key_exists("MODULE_ID", $arService)) {
             $modulesCheck = is_array($arService["MODULE_ID"]) ? $arService["MODULE_ID"] : array($arService["MODULE_ID"]);
         }
         foreach ($modulesCheck as $moduleID) {
             if (!IsModuleInstalled($moduleID)) {
                 unset($arServices[$serviceID]);
                 continue 2;
             }
         }
         $arServices[$serviceID]["POSITION"] = $servicePosition;
         $servicePosition += isset($arService["STAGES"]) && !empty($arService["STAGES"]) ? count($arService["STAGES"]) : 1;
     }
     return $arServices;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:33,代码来源:utils.php

示例9: DoInstall

 function DoInstall()
 {
     // проверка запуска, а также модуль иблоков определённо нужен
     if (!check_bitrix_sessid() || !IsModuleInstalled("iblock")) {
         return false;
     }
     global $DOCUMENT_ROOT, $APPLICATION, $step;
     $step = IntVal($step);
     if ($step < 2) {
         $APPLICATION->IncludeAdminFile(GetMessage("V_MODULE_INSTALL") . $this->MODULE_ID, $DOCUMENT_ROOT . "/bitrix/modules/" . $this->MODULE_ID . "/install/step1.php");
     } elseif ($step == 2) {
         // echo "<pre>";
         // print_r($_REQUEST);
         // echo "</pre>";
         // die();
         $this->InstallComponent();
         // установка компонента
         $this->InstallFiles();
         // копирование файлов
         $this->InstallDB();
         $APPLICATION->IncludeAdminFile(GetMessage("V_MODULE_INSTALL") . $this->MODULE_ID, $DOCUMENT_ROOT . "/bitrix/modules/" . $this->MODULE_ID . "/install/step2.php");
         LocalRedirect("module_admin.php?lang=" . LANGUAGE_ID);
     }
     return true;
 }
开发者ID:Vasek18,项目名称:bitrix-testmodule,代码行数:25,代码来源:index.php

示例10: DoInstall

 public function DoInstall()
 {
     if (is_array($this->NEED_MODULES) && !empty($this->NEED_MODULES)) {
         foreach ($this->NEED_MODULES as $module) {
             if (!IsModuleInstalled($module)) {
                 $this->ShowForm('ERROR', GetMessage('ASD_NEED_MODULES', array('#MODULE#' => $module)));
             }
         }
     }
     if (strlen($this->NEED_MAIN_VERSION) <= 0 || version_compare(SM_VERSION, $this->NEED_MAIN_VERSION) >= 0) {
         RegisterModuleDependences('main', 'OnAdminListDisplay', 'asd.iblock', 'CASDiblockInterface', 'OnAdminListDisplayHandler');
         RegisterModuleDependences('main', 'OnBeforeProlog', 'asd.iblock', 'CASDiblockAction', 'OnBeforePrologHandler');
         RegisterModuleDependences('main', 'OnAdminContextMenuShow', 'asd.iblock', 'CASDiblockInterface', 'OnAdminContextMenuShowHandler');
         RegisterModuleDependences('main', 'OnAdminTabControlBegin', 'asd.iblock', 'CASDiblockInterface', 'OnAdminTabControlBeginHandler');
         RegisterModuleDependences('iblock', 'OnAfterIBlockUpdate', 'asd.iblock', 'CASDiblockAction', 'OnAfterIBlockUpdateHandler');
         RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'asd.iblock', 'CASDiblockPropCheckbox', 'GetUserTypeDescription');
         RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'asd.iblock', 'CASDiblockPropCheckboxNum', 'GetUserTypeDescription');
         RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'asd.iblock', 'CASDiblockPropPalette', 'GetUserTypeDescription');
         RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'asd.iblock', 'CASDiblockPropSection', 'GetUserTypeDescription');
         CopyDirFiles($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/asd.iblock/install/js/', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/js/', true, true);
         CopyDirFiles($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/asd.iblock/install/panel/', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/panel/', true, true);
         CopyDirFiles($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/asd.iblock/install/tools/', $_SERVER['DOCUMENT_ROOT'] . '/bitrix/tools/', true, true);
         RegisterModule('asd.iblock');
         $this->ShowForm('OK', GetMessage('MOD_INST_OK'));
     } else {
         $this->ShowForm('ERROR', GetMessage('ASD_NEED_RIGHT_VER', array('#NEED#' => $this->NEED_MAIN_VERSION)));
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:28,代码来源:index.php

示例11: Authorize

    public function Authorize()
    {
        $GLOBALS["APPLICATION"]->RestartBuffer();
        $bSuccess = 1;
        if (isset($_REQUEST["code"]) && $_REQUEST["code"] != '') {
            if (CSocServAuthManager::CheckUniqueKey()) {
                if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
                    $redirect_uri = self::CONTROLLER_URL . "/redirect.php?redirect_to=" . urlencode(CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code")));
                } else {
                    $redirect_uri = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code"));
                }
                $appID = trim(self::GetOption("facebook_appid"));
                $appSecret = trim(self::GetOption("facebook_appsecret"));
                $fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);
                if ($fb->GetAccessToken($redirect_uri) !== false) {
                    $arFBUser = $fb->GetCurrentUser();
                    if (is_array($arFBUser) && isset($arFBUser["id"])) {
                        $email = $arFBUser["email"] != '' ? $arFBUser["email"] : '';
                        $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $email, 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"]);
                        if (isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url'])) {
                            if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url'])) {
                                $arFields["PERSONAL_PHOTO"] = $arPic;
                            }
                        }
                        if (isset($arFBUser['birthday'])) {
                            if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
                                $arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
                            }
                        }
                        if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
                            if ($arFBUser['gender'] == 'male') {
                                $arFields["PERSONAL_GENDER"] = 'M';
                            } elseif ($arFBUser['gender'] == 'female') {
                                $arFields["PERSONAL_GENDER"] = 'F';
                            }
                        }
                        $arFields["PERSONAL_WWW"] = "http://www.facebook.com/" . $arFBUser["id"];
                        if (strlen(SITE_ID) > 0) {
                            $arFields["SITE_ID"] = SITE_ID;
                        }
                        $bSuccess = $this->AuthorizeUser($arFields);
                    }
                }
            }
        }
        $aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key", "current_fieldset");
        $url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
        if (CModule::IncludeModule("socialnetwork") && strpos($url, "current_fieldset=") === false) {
            $url = preg_match("/\\?/", $url) ? $url . "&current_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
        }
        echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
        die;
    }
开发者ID:spas-viktor,项目名称:books,代码行数:59,代码来源:facebook.php

示例12: Initialize

 public function Initialize()
 {
     parent::Initialize();
     $this->intranet = IsModuleInstalled('intranet');
     if (!$this->intranet) {
         CModule::IncludeModule("socialnetwork");
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:roster.php

示例13: ExtractEmail

 public static function ExtractEmail($str)
 {
     if (!(IsModuleInstalled('mail') && CModule::IncludeModule('mail'))) {
         $result = self::ParseEmail($str);
         return $result['EMAIL'];
     }
     return CMailUtil::ExtractMailAddress($str);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:8,代码来源:crm_mail_helper.php

示例14: ForumEventManager

 function ForumEventManager()
 {
     if (IsModuleInstalled("iblock")) {
         AddEventHandler("forum", "onAfterMessageAdd", array(&$this, "updateIBlockPropertyAfterAddingMessage"));
         AddEventHandler("forum", "onMessageModerate", array(&$this, "updateIBlockProperty"));
         AddEventHandler("forum", "onAfterMessageDelete", array(&$this, "updateIBlockPropertyAfterDeletingMessage"));
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:8,代码来源:event_manager.php

示例15: Add

 function Add($arFields)
 {
     global $DB;
     $arFields1 = array();
     foreach ($arFields as $key => $value) {
         if (substr($key, 0, 1) == "=") {
             $arFields1[substr($key, 1)] = $value;
             unset($arFields[$key]);
         }
     }
     if (!CSocNetUserToGroup::CheckFields("ADD", $arFields)) {
         return false;
     }
     $db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetUserToGroupAdd");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array(&$arFields)) === false) {
             return false;
         }
     }
     $arInsert = $DB->PrepareInsert("b_sonet_user2group", $arFields);
     foreach ($arFields1 as $key => $value) {
         if (strlen($arInsert[0]) > 0) {
             $arInsert[0] .= ", ";
         }
         $arInsert[0] .= $key;
         if (strlen($arInsert[1]) > 0) {
             $arInsert[1] .= ", ";
         }
         $arInsert[1] .= $value;
     }
     $ID = false;
     if (strlen($arInsert[0]) > 0) {
         $strSql = "INSERT INTO b_sonet_user2group(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
         $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         $ID = IntVal($DB->LastID());
         CSocNetGroup::SetStat($arFields["GROUP_ID"]);
         CSocNetSearch::OnUserRelationsChange($arFields["USER_ID"]);
         $events = GetModuleEvents("socialnetwork", "OnSocNetUserToGroupAdd");
         while ($arEvent = $events->Fetch()) {
             ExecuteModuleEventEx($arEvent, array($ID, &$arFields));
         }
         if ($arFields["INITIATED_BY_TYPE"] == SONET_INITIATED_BY_GROUP && $arFields["SEND_MAIL"] != "N" && !IsModuleInstalled("im")) {
             CSocNetUserToGroup::SendEvent($ID, "SONET_INVITE_GROUP");
         }
     }
     if ($ID) {
         global $arSocNetUserInRoleCache;
         if (!isset($arSocNetUserInRoleCache) || !is_array($arSocNetUserInRoleCache)) {
             $arSocNetUserInRoleCache = array();
         }
         $arSocNetUserInRoleCache[$arFields["USER_ID"] . "_" . $arFields["GROUP_ID"]] = $arFields["ROLE"];
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group_G" . $arFields["GROUP_ID"]);
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group_U" . $arFields["USER_ID"]);
         }
     }
     return $ID;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:58,代码来源:user_group.php


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