Ignore:
Timestamp:
Oct 8, 2012, 10:22:08 AM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení hlavní stránky modulu Portál.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Portal/UModulePortal.pas

    r103 r104  
    77uses
    88  Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase,
    9   UUtils, UWebSession, SpecializedList, UUser;
     9  UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses;
    1010
    1111type
     
    1818    function ShowFooter(Session: TWebSession): string;
    1919    function ShowHeader(Session: TWebSession): string;
     20    procedure GeneratePage(ASession: TWebSession; Page: TWebPage);
    2021  public
    2122    constructor Create(Owner: TComponent); override;
     
    5455procedure TModulePortal.Start;
    5556begin
     57  Core.GeneratePage := GeneratePage;
    5658  Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal');
    5759  inherited;
     
    220222end;
    221223
     224procedure TModulePortal.GeneratePage(ASession: TWebSession; Page: TWebPage);
     225var
     226  I: Integer;
     227  TitleTag: THtmlString;
     228begin
     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;
     255end;
     256
    222257function TModulePortal.ShowFooter(Session: TWebSession): string;
    223258begin
Note: See TracChangeset for help on using the changeset viewer.