source: trunk/Modules/Base/ModuleBase.pas

Last change on this file was 151, checked in by chronos, 9 months ago
File size: 1.4 KB
Line 
1unit ModuleBase;
2
3interface
4
5uses
6 Classes, SysUtils, ModularSystem, Generics, WebPage, WebApp,
7 WebSession, HTTPServer;
8
9type
10 TGeneratePageEvent = procedure (Session: TWebSession; Page: TWebPage) of object;
11
12 { TModuleBase }
13
14 TModuleBase = class(TModule)
15 private
16 PageAdmin: TWebPage;
17 FOnGeneratePage: TGeneratePageEvent;
18 public
19 Session: TWebSession;
20 Pages: TPageList;
21 HandlerData: THTTPHandlerData;
22 constructor Create(Owner: TComponent); override;
23 procedure Start; override;
24 procedure Stop; override;
25 property OnGeneratePage: TGeneratePageEvent read FOnGeneratePage write FOnGeneratePage;
26 end;
27
28
29implementation
30
31uses
32 PageAdmin;
33
34{ TModuleBase }
35
36constructor TModuleBase.Create(Owner: TComponent);
37begin
38 inherited Create(Owner);
39 Identification := 'Base';
40 Title := 'Base application module';
41 Version := '1.0';
42 License := 'GNU/LGPL v3';
43 Author := 'Chronosoft';
44 Dependencies.Add('System');
45end;
46
47procedure TModuleBase.Start;
48begin
49 BeforeStart;
50 Pages := TPageList.Create;
51 with Pages do begin
52 PageAdmin := TPageAdmin.Create(nil);
53 RegisterPage(PageAdmin, 'administration');
54 end;
55 AfterStart;
56end;
57
58procedure TModuleBase.Stop;
59begin
60 BeforeStop;
61 with Pages do begin
62 UnregisterPage(PageAdmin);
63 FreeAndNil(PageAdmin);
64 end;
65 FreeAndNil(Pages);
66 AfterStop;
67end;
68
69end.
70
Note: See TracBrowser for help on using the repository browser.