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/News/UNews.pas

    r137 r138  
    9797  DbRows := TDbRows.Create;
    9898  Database.Select(DbRows, 'NewsCategory', '*', 'Id=' + IntToStr(Category));
    99   Output := '<div class="NewsPanel"><div class="Title">' + DbRows[0].Values['Caption'];
     99  Output := '<div class="NewsPanel"><div class="Title">' + DbRows[0].Items['Caption'];
    100100  Output := Output + '<div class="Action"><a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit</a>';
    101101  if ModuleUser.User.CheckPermission('News', 'Insert', 'Group', Category) then
     
    113113    Output := Output + '<table class="NewsTable">';
    114114    for I := 0 to DbRows.Count - 1 do begin
    115       if DbRows[I].Values['Name'] = '' then Author := DbRows[I].Values['Author']
    116         else Author := DbRows[I].Values['Name'];
     115      if DbRows[I].Items['Name'] = '' then Author := DbRows[I].Items['Author']
     116        else Author := DbRows[I].Items['Name'];
    117117      Output := Output + '<tr><td onclick="window.location=''aktuality/index.php?action=view&amp;id=' +
    118         DbRows[I].Values['Id'] + '''" onmouseover="zobraz(' + '''new' + IntToStr(Category) +
    119           IntToStr(Index) + ''')" style="cursor: pointer; margin: 0px;"><table class="NewsItemFrame"><tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + DbRows[I].Values['Title'] +
     118        DbRows[I].Items['Id'] + '''" onmouseover="zobraz(' + '''new' + IntToStr(Category) +
     119          IntToStr(Index) + ''')" style="cursor: pointer; margin: 0px;"><table class="NewsItemFrame"><tr><td style="font-size: ' +
     120          IntToStr(FontSize) + 'pt"><strong>' + DbRows[I].Items['Title'] +
    120121          '</strong></td><td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' +
    121           Author + ' (' + HumanDate(SQLToDateTime(DbRows[I].Values['Date'])) + ')</td></tr></table>';
    122       Output := Output + '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="NewsTableItem">' + ModifyContent(DbRows[I].Values['Content']);
    123       if DbRows[I].Values['Link'] <> '' then Output := Output + '<br/><a href="' + DbRows[I].Values['Link'] + '">Odkaz</a>';
    124 
    125       if DbRows[I].Values['Enclosure'] <> '' then begin
     122          Author + ' (' + HumanDate(SQLToDateTime(DbRows[I].Items['Date'])) + ')</td></tr></table>';
     123      Output := Output + '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="NewsTableItem">' + ModifyContent(DbRows[I].Items['Content']);
     124      if DbRows[I].Items['Link'] <> '' then Output := Output + '<br/><a href="' + DbRows[I].Items['Link'] + '">Odkaz</a>';
     125
     126      if DbRows[I].Items['Enclosure'] <> '' then begin
    126127        Output := Output + '<br />Přílohy: ';
    127         Enclosures := Explode(';', DbRows[I].Values['Enclosure']);
     128        Enclosures := Explode(';', DbRows[I].Items['Enclosure']);
    128129        for J := 0 to Length(Enclosures) - 1  do begin
    129130          if FileExists(UploadedFilesFolder + Enclosures[J]) then
     
    173174    NewSetting := TNewsSettingItem.Create;
    174175    with NewSetting do begin
    175       CategoryId := StrToInt(DbRows[I].Values['Id']);
     176      CategoryId := StrToInt(DbRows[I].Items['Id']);
    176177      Index := I;
    177178      Enabled := True;
    178179      ItemCount := 6; // System->Config['Web']['News']['Count']
    179180      DaysAgo := 30; // System->Config['Web']['News']['DaysAgo']
    180       Group := StrToInt(DbRows[I].Values['Group']);
     181      Group := StrToInt(DbRows[I].Items['Group']);
    181182    end;
    182183    Settings.Add(NewSetting);
     
    205206  Column: Integer;
    206207  I: Integer;
     208  Action: string;
    207209begin
    208210  Output := '';
     
    211213  LoadSettingsFromCookies;
    212214
    213   if HandlerData.Request.Query.SearchKey('Action') <> -1 then begin
     215  if HandlerData.Request.Query.TryGetValue('Action', Action) then begin
    214216    // Show news customize menu
    215     if HandlerData.Request.Query.Values['Action'] = 'CustomizeNews' then begin
     217    if Action = 'CustomizeNews' then begin
    216218      Output := Output + ShowCustomizeMenu;
    217219    end;
     
    251253  with TNewsSettingItem(Settings[I]) do begin
    252254    Database.Select(DbRows, 'NewsCategory', '*', 'Id=' + IntToStr(CategoryId));
    253     Output := Output + '<tr><td>' + DbRows[0].Values['Caption'] +
     255    Output := Output + '<tr><td>' + DbRows[0].Items['Caption'] +
    254256      '</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex' +
    255257      IntToStr(I) + '" value="' + IntToStr(Index) + '" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled' + IntToStr(I) + '"';
Note: See TracChangeset for help on using the changeset viewer.