Changeset 105 for trunk/Modules/Portal/UModulePortal.pas
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/UModulePortal.pas
r104 r105 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses; 9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses, 10 UModuleBase, UModuleUser; 10 11 11 12 type … … 16 17 private 17 18 Time: TDateTime; 19 WebPagePortal: TWebPage; 18 20 function ShowFooter(Session: TWebSession): string; 19 21 function ShowHeader(Session: TWebSession): string; 20 22 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 21 23 public 24 ModuleBase: TModuleBase; 25 ModuleUser: TModuleUser; 22 26 constructor Create(Owner: TComponent); override; 23 27 destructor Destroy; override; … … 46 50 Author := 'Chronosoft'; 47 51 Dependencies.Add('User'); 52 Dependencies.Add('Finance'); 53 Dependencies.Add('News'); 48 54 end; 49 55 … … 55 61 procedure TModulePortal.Start; 56 62 begin 57 Core.GeneratePage := GeneratePage; 58 Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 59 inherited; 63 BeforeStart; 64 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 65 ModuleBase.GeneratePage := GeneratePage; 66 WebPagePortal := TWebPagePortal.Create(nil); 67 ModuleBase.Pages.RegisterPage(WebPagePortal, ''); 68 TWebPagePortal(WebPagePortal).ModuleUser := TModuleUser(Manager.FindModuleByName('User')); 69 AfterStart; 60 70 end; 61 71 62 72 procedure TModulePortal.Stop; 63 73 begin 64 inherited; 65 Core.Pages.UnregisterPage('portal'); 74 BeforeStop; 75 ModuleBase.Pages.UnregisterPage(WebPagePortal); 76 FreeAndNil(WebPagePortal); 77 ModuleBase := nil; 78 AfterStop; 66 79 end; 67 80 … … 208 221 '<div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '; 209 222 Output := Output + Navigation + '</span><div class="MenuItem2">'; 210 if Session.User.Id = UnknownUser then223 if ModuleUser.User.Id = UnknownUser then 211 224 Output := Output + '<a href="' + MakeLink('Přihlášení', 212 225 NavigationLink('/?Action=LoginForm')) + ' ' + 213 226 MakeLink('Registrace', NavigationLink('/?Action=UserRegister')) 214 else Output := Output + Session.User.Name + ' ' + MakeLink('Odhlásit',227 else Output := Output + ModuleUser.User.Name + ' ' + MakeLink('Odhlásit', 215 228 NavigationLink('/?Action=Logout')); 216 229 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>';
Note:
See TracChangeset
for help on using the changeset viewer.