Changeset 97 for trunk/Modules


Ignore:
Timestamp:
Oct 2, 2012, 9:42:35 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Stránky přesunuty do modulu ZděchovNET.
  • Přidáno: Instalace a odinstalace modulu ZděchovNET.
Location:
trunk/Modules
Files:
25 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/System/UModuleSystem.pas

    r93 r97  
    8686  end;
    8787  Core.ModuleManager.OnModuleChange := ModuleChange;
    88   inherited Start;
     88  inherited;
    8989end;
    9090
     
    128128  try
    129129    DbRows := TDbRows.Create;
    130     Core.CommonDatabase.Query(DbRows, 'DROP TABLE `SystemModule`');
     130    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `SystemModule`');
    131131  finally
    132132    DbRows.Free;
  • trunk/Modules/User/UModuleUser.pas

    r96 r97  
    116116  try
    117117    DbRows := TDbRows.Create;
    118     Core.CommonDatabase.Query(DbRows, 'DROP TABLE `User`');
    119     Core.CommonDatabase.Query(DbRows, 'DROP TABLE `UserOnline`');
     118    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `User`');
     119    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `UserOnline`');
    120120  finally
    121121    DbRows.Free;
  • trunk/Modules/ZdechovNET/UModuleZdechovNET.pas

    r92 r97  
    66
    77uses
    8   Classes, SysUtils, UModularSystem;
     8  Classes, SysUtils, UModularSystem, SpecializedDictionary;
    99
    1010type
     
    7272begin
    7373  inherited Stop;
     74  with Core.Pages do begin
     75    UnregisterPage('internet');
     76    UnregisterPage('hosting');
     77    UnregisterPage('historie');
     78    UnregisterPage('dokumenty');
     79    UnregisterPage('voip');
     80    UnregisterPage('odkazy');
     81    UnregisterPage('kontakt');
     82    UnregisterPage('serverinfo');
     83    UnregisterPage('kamery');
     84    UnregisterPage('plany');
     85    UnregisterPage('sit');
     86    UnregisterPage('projekty');
     87    UnregisterPage('');
     88  end;
    7489end;
    7590
    7691procedure TModuleZdechovNET.Install;
     92var
     93  DbRows: TDbRows;
     94  Data: TDictionaryStringString;
    7795begin
     96  try
     97    DbRows := TDbRows.Create;
     98    Data := TDictionaryStringString.Create;
     99
     100    Core.CommonDatabase.Query(DbRows,
     101    'CREATE TABLE IF NOT EXISTS `VPSHosting` (' +
     102    '  `Id` int(11) NOT NULL AUTO_INCREMENT,' +
     103    '  `Name` varchar(255) NOT NULL,' +
     104    '  `Memory` varchar(255) NOT NULL,' +
     105    '  `Space` varchar(255) NOT NULL,' +
     106    '  `Internet` varchar(255) NOT NULL,' +
     107    '  `CPU` varchar(255) NOT NULL,' +
     108    '  `Price` int(11) NOT NULL,' +
     109    '  PRIMARY KEY (`Id`)' +
     110    ') ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     111
     112    Core.CommonDatabase.Query(DbRows,
     113    'CREATE TABLE IF NOT EXISTS `History` (' +
     114    '  `Id` int(11) NOT NULL AUTO_INCREMENT,' +
     115    '  `Date` date NOT NULL,' +
     116    '  `Text` text COLLATE utf8_czech_ci NOT NULL,' +
     117    '  PRIMARY KEY (`Id`)' +
     118    ') ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;');
     119
     120    Core.CommonDatabase.Query(DbRows,
     121    'CREATE TABLE IF NOT EXISTS `Webcam` (' +
     122    '  `Id` int(11) NOT NULL AUTO_INCREMENT,' +
     123    '  `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' +
     124    '  `Description` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' +
     125    '  `ImageName` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' +
     126    '  `ImageURL` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,' +
     127    '  `ImagePeriod` int(11) NOT NULL,' +
     128    '  `Width` int(11) NOT NULL,' +
     129    '  `Height` int(11) NOT NULL,' +
     130    '  `Enabled` int(11) NOT NULL DEFAULT "1",' +
     131    '  `DeviceType` varchar(255) NOT NULL,' +
     132    '  PRIMARY KEY (`Id`)' +
     133    ') ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     134
     135    Core.CommonDatabase.Query(DbRows,
     136    '  CREATE TABLE IF NOT EXISTS `Plans` (' +
     137    '  `Id` int(11) NOT NULL AUTO_INCREMENT,' +
     138    '  `TimeCreate` datetime NOT NULL,' +
     139    '  `TimeFinished` datetime DEFAULT NULL,' +
     140    '  `Description` text COLLATE utf8_czech_ci NOT NULL,' +
     141    '  `Conclusion` text COLLATE utf8_czech_ci NOT NULL,' +
     142    '  `Public` int(11) NOT NULL DEFAULT "0",' +
     143    '  PRIMARY KEY (`Id`),' +
     144    '  KEY `TimeCreate` (`TimeCreate`),' +
     145    '  KEY `TimeFinished` (`TimeFinished`)' +
     146    ') ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;');
     147
     148  finally
     149    Data.Free;
     150    DbRows.Free;
     151  end;
     152
    78153  inherited Install;
    79154end;
    80155
    81156procedure TModuleZdechovNET.Uninstall;
     157var
     158  DbRows: TDbRows;
    82159begin
    83160  inherited Uninstall;
     161  try
     162    DbRows := TDbRows.Create;
     163    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `Plans`');
     164    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `Webcam`');
     165    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `VPSHosting`');
     166    Core.CommonDatabase.Query(DbRows, 'DROP TABLE IF EXISTS `History`');
     167  finally
     168    DbRows.Free;
     169  end;
    84170end;
    85171
Note: See TracChangeset for help on using the changeset viewer.