예제 #1
0
 protected static function loadIblockVersion()
 {
     $moduleIblock = CModule::CreateModuleObject('iblock');
     if ($moduleIblock) {
         self::$iblockVersion = $moduleIblock->MODULE_VERSION;
     }
     unset($moduleIblock);
 }
예제 #2
0
 /**
  * @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;
 }
예제 #3
0
		</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);
예제 #4
0
					$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);
예제 #5
0
    $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));
                    }
예제 #6
0
 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;
 }
예제 #7
0
function CheckGetModuleInfo($path)
{
	include_once($path);

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

	return CModule::CreateModuleObject($class_name);
}
예제 #8
0
 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;
 }
예제 #9
0
 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;
 }
예제 #10
0
			{
				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 {
예제 #11
0
<?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) : '';
예제 #12
0
 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;
 }
예제 #13
0
 public static function installDisableSaleEvents()
 {
     $fmodule = new CModule();
     if ($module = $fmodule->CreateModuleObject("sale")) {
         $module->UnInstallEvents();
     }
 }
예제 #14
0
 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;
 }
예제 #15
0
            }
        }
    } 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;
        }
예제 #16
0
 /**
  * getModules
  * @return mixed
  */
 public function getModules()
 {
     $folders = array("/local/modules", "/bitrix/modules");
     foreach ($folders as $folder) {
         $handle = @opendir($_SERVER["DOCUMENT_ROOT"] . $folder);
         if ($handle) {
             while (false !== ($dir = readdir($handle))) {
                 if (!isset($arModules[$dir]) && is_dir($_SERVER["DOCUMENT_ROOT"] . $folder . "/" . $dir) && $dir != "." && $dir != ".." && $dir != "main" && strpos($dir, ".") === false) {
                     $module_dir = $_SERVER["DOCUMENT_ROOT"] . $folder . "/" . $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]["MODULE_PARTNER"] = strpos($dir, ".") !== false ? $info->PARTNER_NAME : "";
                         $arModules[$dir]["MODULE_PARTNER_URI"] = strpos($dir, ".") !== false ? $info->PARTNER_URI : "";
                         $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;'));
     return $arModules;
 }