Changeset 104


Ignore:
Timestamp:
Oct 8, 2012, 10:22:08 AM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení hlavní stránky modulu Portál.
Location:
trunk
Files:
65 added
4 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
  • trunk/Modules/Portal/UPagePortal.lfm

    r102 r104  
    44  OnProduce = DataModuleProduce
    55  Height = 142
    6   HorizontalOffset = 313
    7   VerticalOffset = 71
     6  HorizontalOffset = 400
     7  VerticalOffset = 193
    88  Width = 214
    99end
  • trunk/Modules/Portal/UPagePortal.pas

    r103 r104  
    77uses
    88  Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils,
    9   SpecializedDictionary, UWebSession, SpecializedList;
     9  SpecializedDictionary, UWebSession, SpecializedList, UHtmlClasses,
     10  UModularSystem;
    1011
    1112type
     
    2021    function SystemMessage(Title, Text: string): string;
    2122    function ShowLinks(GroupId: Integer): string;
    22     function Show: string;
     23    procedure Show(HandlerData: THTTPHandlerData);
    2324    function OnlineHostList: string;
    2425    function UserPanel: string;
     
    4849  Session := TWebSession(HandlerData);
    4950  with TWebSession(HandlerData) do begin
    50 
     51    Show(HandlerData);
     52    GeneratePage(Self);
    5153  end;
    5254end;
     
    8587end;
    8688
    87 function TWebPagePortal.Show: string;
     89procedure TWebPagePortal.Show(HandlerData: THTTPHandlerData);
    8890var
    8991  Output: string;
     
    9799  I, J: Integer;
    98100begin
     101  try
     102    DbRows := TDbRows.Create;
     103    DbRows2 := TDbRows.Create;
    99104  Output := '';
    100105  with Session.Request do
     
    117122      TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Username').Value.Value,
    118123        TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value));
    119       Output := Output + SystemMessage('Přihlášení', Result);
     124      Output := Output + SystemMessage('Přihlášení', 'Přihlášení provedeno');
    120125      if Session.User.Id <> UnknownUser then begin
    121126        //Form.LoadValuesFromForm;
     
    165170      Form.Load(Session.Request.Post);
    166171      //Result = Session.User.PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    167       Output := Output + SystemMessage('Obnova hesla', Result);
     172      Output := Output + SystemMessage('Obnova hesla', 'Heslo obnoveno');
    168173      //if Result <> USER_PASSWORD_RECOVERY_SUCCESS then begin
    169174        Output := Output + Form.AsXmlElement.AsString;
     
    219224      end;
    220225    end *);
     226    end;
    221227
    222228    //Session.Database.Database := Config['Database']['Database'];
     
    235241      Session.Database.Query(DbRows2, 'SELECT * FROM `Panel` WHERE `PanelColumn`=' +
    236242        PanelColumn.Values['Id'] + ' ORDER BY `Order`');
    237       for J := 0 to DbRows2.Count - 1 do
    238         Panel := DbRows[J];
     243      for J := 0 to DbRows2.Count - 1 do begin
     244        Panel := DbRows2[J];
    239245        if Panel.Values['Module'] = 'HyperlinkGroup' then
    240246          Output := Output + ShowLinks(StrToInt(Panel.Values['Parameters']))
     
    253259      Output := Output + '</td>';
    254260    end;
    255     Output := Output + '</table>';
    256     Result := Output;
     261    Output := Output + '</tr></table>';
     262    with TWebSession(HandlerData) do begin
     263      with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do
     264        Text := Text + Output;
     265    end;
     266  finally
     267    DbRows2.Free;
     268    DbRows.Free;
    257269  end;
     270end;
    258271
    259272function TWebPagePortal.OnlineHostList: string;
  • trunk/Modules/ZdechovNET/UModuleZdechovNET.pas

    r103 r104  
    5858begin
    5959  with Core.Pages do begin
     60    Core.GeneratePage := GeneratePage;
    6061    RegisterPage(TInternetPage, InternetPage, 'internet');
    6162    RegisterPage(THostingPage, HostingPage, 'hosting');
     
    103104    DbRows := TDbRows.Create;
    104105    Data := TDictionaryStringString.Create;
    105 
    106     Core.GeneratePage := GeneratePage;
    107106
    108107    Core.CommonDatabase.Query(DbRows,
Note: See TracChangeset for help on using the changeset viewer.