Ignore:
Timestamp:
Sep 9, 2022, 1:16:58 AM (2 years ago)
Author:
chronos
Message:
  • Added: Robots page.
  • Modified: Canonical URL for webcams.
  • Modified: Removed compiler mode delphi as it is already set in project.
  • Modified: Updated Common package.
  • Modified: Use Generics.Collections instead of fgl.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/ZdechovNET/UModuleZdechovNET.pas

    r135 r137  
    44
    55uses
    6   Classes, SysUtils, UModularSystem, UWebPage,
     6  Classes, SysUtils, UModularSystem, UWebPage, URobotsPage,
    77  UWebSession, DateUtils, UModuleBase, UModuleUser, UIPTVPage,
    88  UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage,
     
    3030    AboutPage: TAboutPage;
    3131    IPTVPage: TIPTVPage;
     32    RobotsPage: TRobotsPage;
    3233    procedure Footer(Session: TWebSession);
    3334    procedure GeneratePage(ASession: TWebSession; Page: TWebPage);
     
    3637    ModuleBase: TModuleBase;
    3738    ModuleUser: TModuleUser;
     39    Raw: Boolean;
    3840    constructor Create(Owner: TComponent); override;
    3941    destructor Destroy; override;
     
    7476  BeforeStart;
    7577  ModuleBase := TModuleBase(Manager.FindModuleByName('Base'));
    76   ModuleBase.GeneratePage := GeneratePage;
     78  ModuleBase.OnGeneratePage := GeneratePage;
    7779  ModuleUser := TModuleUser(Manager.FindModuleByName('User'));
    7880  with ModuleBase, Pages do begin
    79     //GeneratePage := GeneratePage;
     81    //OnGeneratePage := OnGeneratePage;
    8082    InternetPage := TInternetPage.Create(nil);
    8183    InternetPage.ModuleUser := ModuleUser;
     
    120122    IPTVPage.ModuleUser := ModuleUser;
    121123    RegisterPage(IPTVPage, 'televize');
     124    RobotsPage := TRobotsPage.Create(nil);
     125    RobotsPage.ModuleUser := ModuleUser;
     126    RegisterPage(RobotsPage, 'robots.txt');
    122127  end;
    123128  AfterStart;
     
    156161    UnregisterPage(ProjectsPage);
    157162    FreeAndNil(ProjectsPage);
     163    UnregisterPage(RobotsPage);
     164    FreeAndNil(RobotsPage);
    158165  end;
    159166  ModuleBase := nil;
     
    242249begin
    243250  inherited;
    244   ModuleBase.GeneratePage := nil;
     251  ModuleBase.OnGeneratePage := nil;
    245252  try
    246253    DbRows := TDbRows.Create;
     
    348355begin
    349356  with ASession do begin
    350     HtmlDocument.ContentLanguage := 'cs';
    351     GlobalTitle := 'ZděchovNET';
    352     HtmlDocument.Styles.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Style.css'));
    353     HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Global.js'));
    354     HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/jquery.js'));
     357    if Page.Raw then begin
     358      Response.Content.WriteString(THtmlString(HtmlDocument.Body.SubItems[0]).Text);
     359    end else begin
     360      HtmlDocument.ContentLanguage := 'cs';
     361      GlobalTitle := 'ZděchovNET';
     362      HtmlDocument.Styles.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Style.css'));
     363      HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Global.js'));
     364      HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/jquery.js'));
    355365
    356366      TitleTag := THtmlString.Create;
     
    370380      end;
    371381    end;
     382  end;
    372383end;
    373384
Note: See TracChangeset for help on using the changeset viewer.