Changeset 105 for trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r104 r105 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UWebPage, 9 UWebSession, DateUtils; 9 UWebSession, DateUtils, UModuleBase, UModuleUser, 10 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, 11 ULinksPage, UPlansPage, UServerInfoPage, UWebCamPage, UUser, 12 UNetworkPage, UAboutPage, UContactPage, UProjectsPage; 10 13 11 14 type … … 15 18 TModuleZdechovNET = class(TModule) 16 19 private 20 InternetPage: TInternetPage; 21 HostingPage: THostingPage; 22 HistoryPage: THistoryPage; 23 DocumentsPage: TDocumentsPage; 24 VoIPPage: TVoIPPage; 25 LinksPage: TLinksPage; 26 ContactPage: TContactPage; 27 ServerInfoPage: TServerInfoPage; 28 WebCamPage: TWebCamPage; 29 PlansPage: TPlansPage; 30 NetworkPage: TNetworkPage; 31 ProjectsPage: TProjectsPage; 32 AboutPage: TAboutPage; 17 33 procedure Footer(Session: TWebSession); 18 34 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 19 35 procedure TopMenu(Session: TWebSession); 20 36 public 37 ModuleBase: TModuleBase; 38 ModuleUser: TModuleUser; 21 39 constructor Create(Owner: TComponent); override; 22 40 destructor Destroy; override; … … 32 50 33 51 uses 34 UCore, USqlDatabase, UXmlClasses, UHtmlClasses, UUtils, 35 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, 36 ULinksPage, UPlansPage, UServerInfoPage, UWebCamPage, UUser, 37 UNetworkPage, UAboutPage, UContactPage, UProjectsPage; 52 UCore, USqlDatabase, UXmlClasses, UHtmlClasses, UUtils; 38 53 39 54 { TModuleZdechovNET } … … 48 63 Author := 'Chronosoft'; 49 64 Dependencies.Add('User'); 65 Dependencies.Add('Base'); 50 66 end; 51 67 … … 57 73 procedure TModuleZdechovNET.Start; 58 74 begin 59 with Core.Pages do begin 60 Core.GeneratePage := GeneratePage; 61 RegisterPage(TInternetPage, InternetPage, 'internet'); 62 RegisterPage(THostingPage, HostingPage, 'hosting'); 63 RegisterPage(THistoryPage, HistoryPage, 'historie'); 64 RegisterPage(TDocumentsPage, DocumentsPage, 'dokumenty'); 65 RegisterPage(TVoIPPage, VoIPPage, 'voip'); 66 RegisterPage(TLinksPage, LinksPage, 'odkazy'); 67 RegisterPage(TContactPage, ContactPage, 'kontakt'); 68 RegisterPage(TServerInfoPage, ServerInfoPage, 'serverinfo'); 69 RegisterPage(TWebCamPage, WebCamPage, 'kamery'); 70 RegisterPage(TPlansPage, PlansPage, 'plany'); 71 RegisterPage(TNetworkPage, NetworkPage, 'sit'); 72 RegisterPage(TProjectsPage, ProjectsPage, 'projekty'); 73 RegisterPage(TAboutPage, AboutPage, ''); 75 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 76 ModuleUser := TModuleUser(Manager.FindModuleByName('User')); 77 with ModuleBase, Pages do begin 78 //GeneratePage := GeneratePage; 79 InternetPage := TInternetPage.Create(nil); 80 RegisterPage(InternetPage, 'internet'); 81 HostingPage := THostingPage.Create(nil); 82 RegisterPage(HostingPage, 'hosting'); 83 HistoryPage := THistoryPage.Create(nil); 84 RegisterPage(HistoryPage, 'historie'); 85 DocumentsPage := TDocumentsPage.Create(nil); 86 RegisterPage(DocumentsPage, 'dokumenty'); 87 VoIPPage := TVoIPPage.Create(nil); 88 RegisterPage(VoIPPage, 'voip'); 89 LinksPage := TLinksPage.Create(nil); 90 RegisterPage(LinksPage, 'odkazy'); 91 ContactPage := TContactPage.Create(nil); 92 RegisterPage(ContactPage, 'kontakt'); 93 ServerInfoPage := TServerInfoPage.Create(nil); 94 RegisterPage(ServerInfoPage, 'serverinfo'); 95 WebCamPage := TWebCamPage.Create(nil); 96 RegisterPage(WebCamPage, 'kamery'); 97 PlansPage := TPlansPage.Create(nil); 98 RegisterPage(PlansPage, 'plany'); 99 NetworkPage := TNetworkPage.Create(nil); 100 RegisterPage(NetworkPage, 'sit'); 101 ProjectsPage := TProjectsPage.Create(nil); 102 RegisterPage(ProjectsPage, 'projekty'); 103 AboutPage := TAboutPage.Create(nil); 104 RegisterPage(AboutPage, ''); 74 105 end; 75 106 inherited; … … 79 110 begin 80 111 inherited Stop; 81 with Core.Pages do begin 82 UnregisterPage('internet'); 83 UnregisterPage('hosting'); 84 UnregisterPage('historie'); 85 UnregisterPage('dokumenty'); 86 UnregisterPage('voip'); 87 UnregisterPage('odkazy'); 88 UnregisterPage('kontakt'); 89 UnregisterPage('serverinfo'); 90 UnregisterPage('kamery'); 91 UnregisterPage('plany'); 92 UnregisterPage('sit'); 93 UnregisterPage('projekty'); 94 UnregisterPage(''); 95 end; 112 with ModuleBase, Pages do begin 113 UnregisterPage(AboutPage); 114 FreeAndNil(AboutPage); 115 UnregisterPage(InternetPage); 116 FreeAndNil(InternetPage); 117 UnregisterPage(HostingPage); 118 FreeAndNil(HostingPage); 119 UnregisterPage(HistoryPage); 120 FreeAndNil(HistoryPage); 121 UnregisterPage(DocumentsPage); 122 FreeAndNil(DocumentsPage); 123 UnregisterPage(VoIPPage); 124 FreeAndNil(VoIPPage); 125 UnregisterPage(LinksPage); 126 FreeAndNil(LinksPage); 127 UnregisterPage(ContactPage); 128 FreeAndNil(ContactPage); 129 UnregisterPage(ServerInfoPage); 130 FreeAndNil(ServerInfoPage); 131 UnregisterPage(WebCamPage); 132 FreeAndNil(WebCamPage); 133 UnregisterPage(PlansPage); 134 FreeAndNil(PlansPage); 135 UnregisterPage(NetworkPage); 136 FreeAndNil(NetworkPage); 137 UnregisterPage(ProjectsPage); 138 FreeAndNil(ProjectsPage); 139 end; 140 ModuleBase := nil; 141 ModuleUser := nil; 96 142 end; 97 143 … … 179 225 begin 180 226 inherited Uninstall; 181 Core.GeneratePage := nil;227 ModuleBase.GeneratePage := nil; 182 228 try 183 229 DbRows := TDbRows.Create; … … 257 303 '<li><a href="http://wiki.zdechov.net/">Wiki</a></li>' + 258 304 '</ul><ul class="MenuItem2">'; //<li> </li>'; 259 if Assigned( TCore(MainModule).Pages.FindByName('uzivatel')) then begin260 if UserOnline.User = UnknownUser then begin305 if Assigned(ModuleBase.Pages.FindByName('uzivatel')) then begin 306 if ModuleUser.UserOnline.User = UnknownUser then begin 261 307 Text := Text + '</ul>' + 262 308 '<ul class="MenuItem2">' + … … 268 314 Text := Text + '</ul>' + 269 315 '<ul class="MenuItem2">' + 270 '<li>' + User.FullName + '</li>' +316 '<li>' + ModuleUser.User.FullName + '</li>' + 271 317 '<li>' + MakeLink('Odhlášení', NavigationLink('/uzivatel/odhlaseni/')) + '</li>' + 272 318 '<li>' + MakeLink('Profil', NavigationLink('/uzivatel/profil/')) + '</li>';
Note:
See TracChangeset
for help on using the changeset viewer.