Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (21 months ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
File:
1 edited

Legend:

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

    r137 r138  
    55uses
    66  Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils,
    7   SpecializedDictionary, UWebSession, UHtmlClasses, UModularSystem, UModuleUser,
     7  UGenerics, UWebSession, UHtmlClasses, UModularSystem, UModuleUser,
    88  UModuleNews;
    99
     
    7070    for I := 0 to HyperLinks.Count - 1 do begin
    7171      HyperLink := Hyperlinks[I];
    72       if HyperLink.Values['IconFile'] = '' then
    73           HyperLink.Values['IconFile'] := 'clear.png';
    74         if Copy(HyperLink.Values['URL'], 1, 4) <> 'http' then
    75           HyperLink.Values['URL'] := NavigationLink(HyperLink.Values['URL']);
    76         if ((HyperLink.Values['PermissionModule'] = '') or
    77         ((HyperLink.Values['PermissionModule'] <> '') and
    78         ModuleUser.User.CheckPermission(HyperLink.Values['PermissionModule'], HyperLink.Values['PermissionOperation']))) then
    79         Result := Result + '<img alt="' + HyperLink.Values['Name'] + '" src="images/favicons/' + HyperLink.Values['IconFile'] + '" width="16" height="16" /> <a href="' + HyperLink.Values['URL'] + '">' + HyperLink.Values['Name'] + '</a><br />';
     72      if HyperLink.Items['IconFile'] = '' then
     73          HyperLink.Items['IconFile'] := 'clear.png';
     74        if Copy(HyperLink.Items['URL'], 1, 4) <> 'http' then
     75          HyperLink.Items['URL'] := NavigationLink(HyperLink.Items['URL']);
     76        if ((HyperLink.Items['PermissionModule'] = '') or
     77        ((HyperLink.Items['PermissionModule'] <> '') and
     78        ModuleUser.User.CheckPermission(HyperLink.Items['PermissionModule'], HyperLink.Items['PermissionOperation']))) then
     79        Result := Result + '<img alt="' + HyperLink.Items['Name'] + '" src="images/favicons/' + HyperLink.Items['IconFile'] + '" width="16" height="16" /> <a href="' + HyperLink.Items['URL'] + '">' + HyperLink.Items['Name'] + '</a><br />';
    8080    end;
    81     Result := ShowPanel(HyperlinkGroups[0].Values['Name'], Result);
     81    Result := ShowPanel(HyperlinkGroups[0].Items['Name'], Result);
    8282
    8383  finally
     
    9898  DbRows2: TDbRows;
    9999  I, J: Integer;
     100  Action: string;
    100101begin
    101102  try
     
    104105  Output := '';
    105106  with Session.Request do
    106   if Query.SearchKey('Action') <> -1 then begin
    107     if Query.Values['Action'] = 'CustomizeNewsSave' then begin
     107  if Query.TryGetValue('Action', Action) then begin
     108    if Action = 'CustomizeNewsSave' then begin
    108109      //Output := $this->System->Modules['News']->CustomizeSave();
    109110    end else
    110     if Query.Values['Action'] = 'LoginForm' then begin
     111    if Action = 'LoginForm' then begin
    111112      Form := TQueryForm.Create; // UserLogin
    112113      Form.AddNewAction('Přihlásit', '?Action=Login');
     
    115116        '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';
    116117    end else
    117     if Query.Values['Action'] = 'Login' then begin
     118    if Action = 'Login' then begin
    118119      Form := TQueryForm.Create; // UserLogin
    119120      Form.Load(Session.Request.Post);
     
    131132      end;
    132133    end else
    133     if Query.Values['Action'] = 'Logout' then begin
     134    if Action = 'Logout' then begin
    134135      ModuleUser.UserOnline.Logout;
    135136      Output := Output + SystemMessage('Odhlášení', 'Uživatel odhlášen');
    136137    end else
    137     if Query.Values['Action'] = 'UserOptions' then begin
     138    if Action = 'UserOptions' then begin
    138139      UserOptions := TQueryForm.Create; // UserOptions
    139140      //UserOptions.LoadValuesFromDatabase(Session.User.Id);
     
    141142      Output := Output + UserOptions.AsXmlElement.AsString;
    142143    end else
    143     if Query.Values['Action'] = 'UserOptionsSave' then begin
     144    if Action = 'UserOptionsSave' then begin
    144145      UserOptions := TQueryForm.Create; // UserOptions
    145146      UserOptions.Load(Session.Request.Post);
     
    151152      Output := Output + UserOptions.AsXmlElement.AsString;
    152153    end else
    153     if Query.Values['Action'] = 'UserRegister' then begin
     154    if Action = 'UserRegister' then begin
    154155      Form := TQueryForm.Create; //'UserRegister');
    155156      Form.Load(Session.Request.Post);
     
    157158      Output := Output + Form.AsXmlElement.AsString;
    158159    end else
    159     if Query.Values['Action'] = 'UserRegisterConfirm' then begin
     160    if Action = 'UserRegisterConfirm' then begin
    160161      //Session.User.RegisterConfirm($_GET['User'], $_GET['H']);
    161162      Output := Output + SystemMessage('Potvrzení registrace', 'Registrace potvrzena');
    162163    end else
    163     if Query.Values['Action'] = 'PasswordRecovery' then begin
     164    if Action = 'PasswordRecovery' then begin
    164165      Form := TQueryForm.Create; // PasswordRecovery
    165166      Form.AddNewAction('Obnovit', '?Action=PasswordRecovery2');
    166167      Output := Output + Form.AsXmlElement.AsString;
    167168    end else
    168     if Query.Values['Action'] = 'PasswordRecovery2' then begin
     169    if Action = 'PasswordRecovery2' then begin
    169170      Form := TQueryForm.Create; // PasswordRecovery
    170171      Form.Load(Session.Request.Post);
     
    175176      //end;
    176177    end else
    177     if Query.Values['Action'] = 'PasswordRecoveryConfirm' then begin
     178    if Action = 'PasswordRecoveryConfirm' then begin
    178179      //Session.User.PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']);
    179180      Output := Output + SystemMessage('Obnova hesla', 'Potvrzení obnovení hesla');
    180181    end (*else
    181     if Query.Values['Action'] = 'UserRegisterSave' then begin
     182    if Action = 'UserRegisterSave' then begin
    182183          Form := TQueryForm.Create; // UserRegister
    183184          Form.Load(Session.Request.Post);
     
    189190      end;
    190191    end else
    191     if Query.Values['Action'] = 'MemberOptions' then begin
     192    if Action = 'MemberOptions' then begin
    192193          $UserOptions = new Form('MemberOptions');
    193194          $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->User['Member']);
     
    200201          $Output .= $UserOptions->ShowEditForm();
    201202     end else
    202      if Query.Values['Action'] = 'MemberOptionsSave' then begin
     203     if Action = 'MemberOptionsSave' then begin
    203204          $UserOptions = new Form('MemberOptions');
    204205          $UserOptions->LoadValuesFromForm();
     
    235236    for I := 0 to DbRows.Count - 1 do begin
    236237      PanelColumn := DbRows[I];
    237       if PanelColumn.Values['Width'] <> '' then
    238           Width := ' width="' + PanelColumn.Values['Width'] + '"'
     238      if PanelColumn.Items['Width'] <> '' then
     239          Width := ' width="' + PanelColumn.Items['Width'] + '"'
    239240        else Width := '';
    240241      Output := Output + '<td valign="top"' + Width + '>';
    241242      Session.Database.Query(DbRows2, 'SELECT * FROM `Panel` WHERE `PanelColumn`=' +
    242         PanelColumn.Values['Id'] + ' ORDER BY `Order`');
     243        PanelColumn.Items['Id'] + ' ORDER BY `Order`');
    243244      for J := 0 to DbRows2.Count - 1 do begin
    244245        Panel := DbRows2[J];
    245         if Panel.Values['Module'] = 'HyperlinkGroup' then
    246           Output := Output + ShowLinks(StrToInt(Panel.Values['Parameters']))
    247         else if Panel.Values['Module'] = 'OnlineHostList' then
     246        if Panel.Items['Module'] = 'HyperlinkGroup' then
     247          Output := Output + ShowLinks(StrToInt(Panel.Items['Parameters']))
     248        else if Panel.Items['Module'] = 'OnlineHostList' then
    248249          Output := Output + ShowPanel('Online počítače', OnlineHostList)
    249         else if Panel.Values['Module'] = 'UserOptions' then
     250        else if Panel.Items['Module'] = 'UserOptions' then
    250251        begin
    251252          if ModuleUser.User.Id <> UnknownUser then
    252253            Output := Output + ShowPanel('Přihlášený uživatel', UserPanel);
    253254        end else
    254         if Panel.Values['Module'] = 'Webcam' then
     255        if Panel.Items['Module'] = 'Webcam' then
    255256          Output := Output + ShowPanel('Kamery', WebcamPanel)
    256         else if Panel.Values['Module'] = 'NewsGroupList' then
     257        else if Panel.Items['Module'] = 'NewsGroupList' then
    257258          Output := Output + ShowPanel('Aktuality',
    258259          ModuleNews.Show(HandlerData)); //,
     
    263264    Output := Output + '</tr></table>';
    264265    with TWebSession(HandlerData) do begin
    265       with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do
     266      with HtmlDocument.Body, SubItems.AddString do
    266267        Text := Text + Output;
    267268    end;
Note: See TracChangeset for help on using the changeset viewer.