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


PHP CModule::CreateModuleObject方法代码示例

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


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

示例1: loadIblockVersion

 protected static function loadIblockVersion()
 {
     $moduleIblock = CModule::CreateModuleObject('iblock');
     if ($moduleIblock) {
         self::$iblockVersion = $moduleIblock->MODULE_VERSION;
     }
     unset($moduleIblock);
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:8,代码来源:iblock_version.php

示例2: unset

 /**
  * @return \CModule
  */
 protected function &getObject()
 {
     if (!isset($this->object)) {
         $this->object = \CModule::CreateModuleObject($this->name);
     }
     if (!is_object($this->object) || !$this->object instanceof \CModule) {
         unset($this->object);
         throw new Exception\ModuleNotFoundException('Module not found or incorrect', $this->name);
     }
     return $this->object;
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:14,代码来源:Module.php

示例3: GetMessage

		</script>
		<select name="MODULE_ID" id="__module_id_select">
			<option value="main" <?php 
echo $str_MODULE_ID == 'main' ? 'selected' : '';
?>
><?php 
echo GetMessage('KERNEL');
?>
</option>
		<?php 
$modules = COperation::GetAllowedModules();
foreach ($modules as $MID) {
    if ($MID == "main") {
        continue;
    }
    if (!($m = CModule::CreateModuleObject($MID))) {
        continue;
    }
    ?>
			<script>arModules.push('<?php 
    echo $MID;
    ?>
');</script>
			<option value="<?php 
    echo htmlspecialcharsbx($MID);
    ?>
"<?php 
    echo $str_MODULE_ID == $MID ? ' selected' : '';
    ?>
><?php 
    echo htmlspecialcharsbx($m->MODULE_NAME);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:task_edit.php

示例4: uasort

					$arModules[$dir]["IsInstalled"] = $info->IsInstalled();
				}
			}
		}
		closedir($handle);
	}
}
uasort($arModules, create_function('$a, $b', 'if($a["MODULE_SORT"] == $b["MODULE_SORT"]) return strcasecmp($a["MODULE_NAME"], $b["MODULE_NAME"]); return ($a["MODULE_SORT"] < $b["MODULE_SORT"])? -1 : 1;'));

$fb = ($id == 'fileman' && !$USER->CanDoOperation('fileman_install_control'));
if($isAdmin && !$fb && check_freetrix_sessid())
{
	if(strlen($_REQUEST["uninstall"])>0 || strlen($_REQUEST["install"])>0)
	{
		$id = str_replace("\\", "", str_replace("/", "", $id));
		if($Module = CModule::CreateModuleObject($id))
		{
			if($Module->IsInstalled() && strlen($_REQUEST["uninstall"])>0)
			{
				OnModuleInstalledEvent($id);
				$Module->DoUninstall();
				LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANGUAGE_ID);
			}
			elseif(!$Module->IsInstalled() && strlen($_REQUEST["install"]) > 0)
			{
				if (strtolower($DB->type)=="mysql" && defined("MYSQL_TABLE_TYPE") && strlen(MYSQL_TABLE_TYPE)>0)
				{
					$DB->Query("SET storage_engine = '".MYSQL_TABLE_TYPE."'", true);
				}

				OnModuleInstalledEvent($id);
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:module_admin.php

示例5: array

    $aMenu[] = array("parent_menu" => "global_menu_settings", "section" => "MAIN", "sort" => 1700, "text" => GetMessage("MAIN_MENU_SETTINGS"), "title" => GetMessage("MAIN_MENU_SETTINGS_TITLE"), "icon" => "sys_menu_icon", "page_icon" => "sys_page_icon", "items_id" => "menu_system", "items" => array(array("text" => GetMessage("MAIN_MENU_SITES_LIST"), "url" => "site_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("site_edit.php"), "title" => GetMessage("MAIN_MENU_SITES_ALT")), array("text" => GetMessage("MAIN_MENU_TEMPLATE"), "title" => GetMessage("MAIN_MENU_TEMPL_TITLE"), "url" => "template_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("template_edit.php", "template_load.php"))));
}
if ($USER->CanDoOperation('view_other_settings')) {
    $aModuleItems = array();
    if (method_exists($adminMenu, "IsSectionActive")) {
        if ($adminMenu->IsSectionActive("menu_module_settings") || $APPLICATION->GetCurPage() == "/bitrix/admin/settings.php" && $_REQUEST["mid_menu"] != "" || BX_SEARCH_ADMIN === true) {
            $adminPage->Init();
            foreach ($adminPage->aModules as $module) {
                if ($module != "main") {
                    if ($APPLICATION->GetGroupRight($module) < "R") {
                        continue;
                    }
                    if (getLocalPath("modules/" . $module . "/install/index.php") === false || getLocalPath("modules/" . $module . "/options.php") === false) {
                        continue;
                    }
                    $info = CModule::CreateModuleObject($module);
                    $name = $info->MODULE_NAME;
                    $sort = $info->MODULE_SORT;
                } else {
                    if (!$USER->CanDoOperation('view_other_settings')) {
                        continue;
                    }
                    $name = GetMessage("MAIN_MENU_MAIN_MODULE");
                    $sort = -1;
                }
                $aModule = array("text" => $name, "url" => "settings.php?lang=" . LANGUAGE_ID . "&amp;mid=" . $module . "&amp;mid_menu=1", "more_url" => array("settings.php?lang=" . LANGUAGE_ID . "&mid=" . $module . "&mid_menu=1"), "title" => GetMessage("MAIN_MENU_MODULE_SETT") . " &quot;" . $name . "&quot;", "sort" => $sort);
                if (BX_SEARCH_ADMIN === true) {
                    $lfile = getLocalPath("modules/" . $module . "/lang/" . LANGUAGE_ID . "/options.php");
                    if ($lfile !== false) {
                        $aModule["keywords"] = implode(' ', __IncludeLang($_SERVER["DOCUMENT_ROOT"] . $lfile, true));
                    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:menu.php

示例6: SetModules

 function SetModules($arModules)
 {
     $arInstalled = array();
     $arm = CModule::_GetCache();
     foreach ($arm as $module_id => $tr) {
         $arInstalled[] = $module_id;
     }
     $arBackup = CControllerClient::GetBackup();
     if (!isset($arBackup["modules"])) {
         $arBackup["modules"] = $arInstalled;
         CControllerClient::SetBackup($arBackup);
     }
     foreach ($arModules as $module_id => $status) {
         if (!($oModule = CModule::CreateModuleObject($module_id))) {
             continue;
         }
         if ($status == "Y" && !in_array($module_id, $arInstalled)) {
             if (!method_exists($oModule, "InstallDB") || $oModule->InstallDB() === false) {
                 $oModule->Add();
             }
         } elseif ($status == "N" && in_array($module_id, $arInstalled)) {
             $oModule->Remove();
         }
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:controller_member.php

示例7: CheckGetModuleInfo

function CheckGetModuleInfo($path)
{
	include_once($path);

	$arr = explode("/", $path);
	$i = array_search("modules", $arr);
	$class_name = $arr[$i+1];

	return CModule::CreateModuleObject($class_name);
}
开发者ID:nycmic,项目名称:bittest,代码行数:10,代码来源:site_checker.php

示例8: GetNotifyNames

 public static function GetNotifyNames()
 {
     $arNames = array();
     $arNotify = CIMNotifySchema::GetNotifySchema();
     foreach ($arNotify as $moduleId => $notifyTypes) {
         $arNames[$moduleId]['NAME'] = $notifyTypes['NAME'];
         if (strlen($notifyTypes['NAME']) <= 0) {
             $info = CModule::CreateModuleObject($moduleId);
             $arNames[$moduleId]['NAME'] = $info->MODULE_NAME;
         }
         foreach ($notifyTypes['NOTIFY'] as $notifyId => $notify) {
             $arNames[$moduleId]['NOTIFY'][$notifyId] = $notify['NAME'];
         }
     }
     return $arNames;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:im_settings.php

示例9: GetModules

 function GetModules()
 {
     $arModules = array();
     $arModules["main"] = array("MODULE_ID" => "main", "MODULE_NAME" => GetMessage("MAIN_WIZARD_MAIN_MODULE_NAME"), "MODULE_DESCRIPTION" => GetMessage("MAIN_WIZARD_MAIN_MODULE_DESC"), "MODULE_VERSION" => SM_VERSION, "MODULE_VERSION_DATE" => SM_VERSION_DATE, "IsInstalled" => true);
     $handle = @opendir($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules");
     if ($handle) {
         while (false !== ($dir = readdir($handle))) {
             if (is_dir($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/" . $dir) && $dir != "." && $dir != "..") {
                 $module_dir = $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/" . $dir;
                 if ($info = CModule::CreateModuleObject($dir)) {
                     $arModules[$dir]["MODULE_ID"] = $info->MODULE_ID;
                     $arModules[$dir]["MODULE_NAME"] = $info->MODULE_NAME;
                     $arModules[$dir]["MODULE_DESCRIPTION"] = $info->MODULE_DESCRIPTION;
                     $arModules[$dir]["MODULE_VERSION"] = $info->MODULE_VERSION;
                     $arModules[$dir]["MODULE_VERSION_DATE"] = $info->MODULE_VERSION_DATE;
                     $arModules[$dir]["MODULE_SORT"] = $info->MODULE_SORT;
                     $arModules[$dir]["IsInstalled"] = $info->IsInstalled();
                 }
             }
         }
         closedir($handle);
     }
     return $arModules;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:24,代码来源:wizard_util.php

示例10: foreach

			{
				BX.remove(BX.findParent(el, {'tag': 'tr'}));
				return false;
			}

			</script>

		</td>
	</tr>
	<?php 
    foreach ($arModules as $MID) {
        if ($MID == "main") {
            continue;
        }
        /** @var CModule $module */
        if ($module = CModule::CreateModuleObject($MID)) {
            if ($module->MODULE_GROUP_RIGHTS == "Y") {
                $moduleName = str_replace(".", "_", $MID);
                ?>
	<tr>
		<td><?php 
                echo $module->MODULE_NAME . ":";
                ?>
</td>
		<td>
		<?php 
                $ar = array();
                if (isset($arTasksModules[$MID])) {
                    if ($strError != '') {
                        $v = $_REQUEST["TASKS_" . $moduleName];
                    } else {
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:group_edit.php

示例11: IncludeModuleLangFile

<?php

if (!$USER->IsAdmin()) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
$md = CModule::CreateModuleObject($module_id);
$arGROUPS = array();
$arFilter = array("ACTIVE" => "Y");
if ($md->SHOW_SUPER_ADMIN_GROUP_RIGHTS != "Y") {
    $arFilter["ADMIN"] = "N";
}
$z = CGroup::GetList($v1 = "sort", $v2 = "asc", $arFilter);
while ($zr = $z->Fetch()) {
    $ar = array();
    $ar["ID"] = intval($zr["ID"]);
    $ar["NAME"] = htmlspecialcharsbx($zr["NAME"]);
    $arGROUPS[] = $ar;
}
if ($REQUEST_METHOD == "POST" && strlen($Update) > 0 && $USER->IsAdmin() && check_bitrix_sessid()) {
    // установка прав групп
    COption::SetOptionString($module_id, "GROUP_DEFAULT_TASK", $GROUP_DEFAULT_TASK, "Task for groups by default");
    $letter = ($l = CTask::GetLetter($GROUP_DEFAULT_TASK)) ? $l : 'D';
    COption::SetOptionString($module_id, "GROUP_DEFAULT_RIGHT", $letter, "Right for groups by default");
    $arTasksInModule = array();
    foreach ($arGROUPS as $value) {
        $tid = ${"TASKS_" . $value["ID"]};
        if ($tid) {
            $arTasksInModule[$value["ID"]] = array('ID' => $tid);
        }
        $rt = $tid ? CTask::GetLetter($tid) : '';
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:group_rights2.php

示例12: GetModulesList

 function GetModulesList()
 {
     $result = array();
     foreach (GetModuleEvents("search", "OnReindex", true) as $arEvent) {
         if (!array_key_exists($arEvent["TO_MODULE_ID"], $result)) {
             $module = $arEvent["TO_MODULE_ID"];
             if (IsModuleInstalled($module)) {
                 $obModule = CModule::CreateModuleObject($module);
                 if ($obModule) {
                     $result[$module] = "[" . $module . "] " . $obModule->MODULE_NAME;
                 }
             }
         }
     }
     ksort($result);
     return $result;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:17,代码来源:comp_parameters.php

示例13: installDisableSaleEvents

 public static function installDisableSaleEvents()
 {
     $fmodule = new CModule();
     if ($module = $fmodule->CreateModuleObject("sale")) {
         $module->UnInstallEvents();
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:7,代码来源:crm_invoice.php

示例14: checkRequirements

 public static function checkRequirements($aGemInfo)
 {
     $bResult = true;
     if (isset($aGemInfo['REQUIRED_MIN_MODULE_VERSION'])) {
         $oModule = CModule::CreateModuleObject('iv.bitrixgems');
         if ($oModule->MODULE_VERSION < $aGemInfo['REQUIRED_MIN_MODULE_VERSION']) {
             $bResult = false;
         }
     }
     if (isset($aGemInfo['REQUIRED_MODULES']) && $bResult) {
         foreach ($aGemInfo['REQUIRED_MODULES'] as $sModule) {
             $sModule = trim($sModule);
             if (empty($sModule)) {
                 continue;
             }
             if (!CModule::IncludeModule($sModule)) {
                 $bResult = false;
             }
         }
     }
     if (isset($aGemInfo['REQUIRED_GEMS']) && $bResult) {
         foreach ($aGemInfo['REQUIRED_GEMS'] as $sGem) {
             $sGem = trim($sGem);
             if (empty($sGem)) {
                 continue;
             }
             if (!self::isGemInstalled($sGem)) {
                 $bResult = false;
             }
         }
     }
     return $bResult;
 }
开发者ID:ASDAFF,项目名称:BitrixGems,代码行数:33,代码来源:BitrixGems.class.php

示例15: foreach

            }
        }
    } else {
        $id = CSalePaySystem::Add(array("LID" => $currentSiteID, "CURRENCY" => $defCurrency, "NAME" => $val["NAME"], "ACTIVE" => $val["ACTIVE"] == "N" ? "N" : "Y", "SORT" => $val["SORT"], "DESCRIPTION" => $val["DESCRIPTION"]));
        foreach ($val["ACTION"] as &$action) {
            $action["PAY_SYSTEM_ID"] = $id;
            if (strlen($action["ACTION_FILE"]) > 0 && file_exists($_SERVER["DOCUMENT_ROOT"] . $action["ACTION_FILE"] . "/logo.gif")) {
                $action["LOGOTIP"] = CFile::MakeFilearray($_SERVER["DOCUMENT_ROOT"] . $action["ACTION_FILE"] . "/logo.gif");
            }
            CSalePaySystemAction::Add($action);
        }
    }
}
if (!Main\ModuleManager::isModuleInstalled('catalog')) {
    $CModule = new CModule();
    if ($Module = $CModule->CreateModuleObject("catalog")) {
        OnModuleInstalledEvent('catalog');
        $result = true;
        if (!Main\ModuleManager::isModuleInstalled('bitrix24') || !defined('BX24_HOST_NAME')) {
            $result = $Module->InstallFiles();
        }
        if ($result) {
            $result = $Module->InstallDB();
        }
        if ($result) {
            $result = $Module->InstallEvents();
        }
        if (!$result) {
            $errMsg[] = Loc::getMessage('CRM_CANT_INSTALL_CATALOG');
            return;
        }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:sale_link.php


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