Changeset 104 for trunk/Modules/Portal/UModulePortal.pas
- Timestamp:
- Oct 8, 2012, 10:22:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/UModulePortal.pas
r103 r104 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 9 UUtils, UWebSession, SpecializedList, UUser ;9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses; 10 10 11 11 type … … 18 18 function ShowFooter(Session: TWebSession): string; 19 19 function ShowHeader(Session: TWebSession): string; 20 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 20 21 public 21 22 constructor Create(Owner: TComponent); override; … … 54 55 procedure TModulePortal.Start; 55 56 begin 57 Core.GeneratePage := GeneratePage; 56 58 Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 57 59 inherited; … … 220 222 end; 221 223 224 procedure TModulePortal.GeneratePage(ASession: TWebSession; Page: TWebPage); 225 var 226 I: Integer; 227 TitleTag: THtmlString; 228 begin 229 with ASession do begin 230 HtmlDocument.ContentLanguage := 'cs'; 231 GlobalTitle := 'Portál'; 232 HtmlDocument.Styles.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Style.css')); 233 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Global.js')); 234 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/jquery.js')); 235 236 TitleTag := THtmlString.Create; 237 TitleTag.Text := ShowHeader(ASession); 238 HtmlDocument.Body.SubItems.Insert(0, TitleTag); 239 TitleTag := THtmlString.Create; 240 TitleTag.Text := ShowFooter(ASession); 241 HtmlDocument.Body.SubItems.Add(TitleTag); 242 //Page.Page.OnProduce(HandlerData); 243 HtmlDocument.Title := Page.Caption; 244 TitleTag.Text := '<div class="TitlePanel"><span class="GlobalTitle">' + GlobalTitle + 245 '</span> - ' + HtmlDocument.Title + '</div>'; 246 HtmlDocument.Title := GlobalTitle + ' - ' + HtmlDocument.Title; 247 with HtmlDocument.AsXmlDocument do 248 try 249 Formated := TCore(MainModule).FormatHTML; 250 Response.Content.WriteString(AsString); 251 finally 252 Free; 253 end; 254 end; 255 end; 256 222 257 function TModulePortal.ShowFooter(Session: TWebSession): string; 223 258 begin
Note:
See TracChangeset
for help on using the changeset viewer.