Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/profistudio.tools/install/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/profistudio.tools/install/index.php

<?
IncludeModuleLangFile(__FILE__);
Class profistudio_tools extends CModule
{
	const MODULE_ID = 'profistudio.tools';
	var $MODULE_ID = 'profistudio.tools';
	var $MODULE_VERSION;
	var $MODULE_VERSION_DATE;
	var $MODULE_NAME;
	var $MODULE_DESCRIPTION;
	var $MODULE_CSS;
	var $strError = '';

	function __construct()
	{
		$arModuleVersion = array();
		include(dirname(__FILE__)."/version.php");
		$this->MODULE_VERSION = $arModuleVersion["VERSION"];
		$this->MODULE_VERSION_DATE = $arModuleVersion["VERSION_DATE"];
		$this->MODULE_NAME = GetMessage("profi.tools_MODULE_NAME");
		$this->MODULE_DESCRIPTION = GetMessage("profi.tools_MODULE_DESC");

		$this->PARTNER_NAME = GetMessage("profi.tools_PARTNER_NAME");
		$this->PARTNER_URI = GetMessage("profi.tools_PARTNER_URI");
	}

	function InstallDB($arParams = array())
	{
		return true;
	}

	function UnInstallDB($arParams = array())
	{
		return true;
	}

	function InstallEvents()
	{
		global $APPLICATION, $DB, $errors;
		CModule::IncludeModule('iblock');

		RegisterModule(self::MODULE_ID);

		RegisterModuleDependences('main', 'OnAdminListDisplay', 'profistudio.tools', 'CSort', '_Sort_AdminList');
		RegisterModuleDependences("main", "OnAdminContextMenuShow", self::MODULE_ID, 'CSort', '_Sort_AdminList1');
		return true;
	}

	function UnInstallEvents()
	{
		UnRegisterModuleDependences('main', 'OnAdminListDisplay', 'profistudio.tools', 'CSort', '_Sort_AdminList');
		UnRegisterModuleDependences("main", "OnAdminContextMenuShow", self::MODULE_ID, 'CSort', '_Sort_AdminList1');
		UnRegisterModule(self::MODULE_ID);
		return true;
	}


	function InstallFiles()
	{		
		CopyDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".self::MODULE_ID."/install/js", $_SERVER["DOCUMENT_ROOT"]."/bitrix/js", true, true);
		CopyDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".self::MODULE_ID."/install/admin", $_SERVER["DOCUMENT_ROOT"]."/bitrix/admin", true, true);
		CopyDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".self::MODULE_ID."/install/gadgets", $_SERVER["DOCUMENT_ROOT"]."/bitrix/gadgets", true, true);

		return true;
	}

	function UnInstallFiles()
	{
		DeleteDirFilesEx("/bitrix/js/sort/jquery-ui-1.10.3.custom.min.js");
		DeleteDirFilesEx("/bitrix/js/sort/jquery-ui.css");
		DeleteDirFilesEx("/bitrix/js/sort/sort.js");
		DeleteDirFilesEx("/bitrix/js/sort/profistudio_tools.css");
		DeleteDirFilesEx("/bitrix/js/sort/images/ui-icons_222222_256x240.png");
		DeleteDirFilesEx("/bitrix/admin/profistudio.sort/");
		DeleteDirFilesEx("/bitrix/gadgets/profistudio/robots/");

		return true;
	}

	function DoInstall()
	{
		$this->InstallFiles();
		$this->InstallEvents();
	}

	function DoUninstall()
	{
		$this->UnInstallFiles();
		$this->UnInstallEvents();
	}
}
?>