Changeset 138 for trunk/Modules


Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
Location:
trunk/Modules
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Base/UModuleBase.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, UModularSystem, SpecializedDictionary, UWebPage, UWebApp,
     6  Classes, SysUtils, UModularSystem, UGenerics, UWebPage, UWebApp,
    77  UWebSession, UHTTPServer;
    88
  • trunk/Modules/IS/UModuleIS.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase,
    7   UModuleBase;
     6  Classes, SysUtils, UModularSystem, USqlDatabase, UModuleBase, UGenerics;
    87
    98type
  • 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) + '"';
  • trunk/Modules/Portal/UModulePortal.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, UModularSystem, USqlDatabase,
    7   UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses,
    8   UModuleBase, UModuleUser, UModuleNews;
     6  Classes, SysUtils, UModularSystem, USqlDatabase, UUtils, UWebSession, UUser,
     7  UWebPage, UHtmlClasses, UModuleBase, UModuleUser, UModuleNews, UGenerics;
    98
    109type
     
    187186    //Navigation := '<a href="' + NavigationLink(PathTreePath) + '">' + PathTreeItem[0] + '</a> &gt; ';
    188187    ScriptName := Copy(ScriptName, Length(Core.BaseURL), Length(ScriptName));
    189     ScriptNameParts.Explode(ScriptName, '/', StrToStr);
     188    ScriptNameParts.Explode('/', ScriptName);
    190189    ScriptNameParts.Delete(0);
    191190    (*
  • 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;
  • trunk/Modules/System/UModuleSystem.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, UModularSystem, SpecializedDictionary;
     6  Classes, SysUtils, UModularSystem, UGenerics;
    77
    88type
     
    7575    for I := 0 to DbRows.Count - 1 do
    7676    with DbRows[I] do begin
    77       Module := Manager.FindModuleByName(Values['Name']);
     77      Module := Manager.FindModuleByName(Items['Name']);
    7878      if Assigned(Module) then
    79         if Values['Installed'] = '1' then Module.SetInstalledState(True)
     79        if Items['Installed'] = '1' then Module.SetInstalledState(True)
    8080          else Module.SetInstalledState(False);
    8181    end;
     
    165165
    166166      Index := 0;
    167       while (Index < DbRows.Count) and (DbRows[Index].Values['Name'] <> Identification) do Inc(Index);
     167      while (Index < DbRows.Count) and (DbRows[Index].Items['Name'] <> Identification) do Inc(Index);
    168168      if Index >= DbRows.Count then Core.CommonDatabase.Insert('SystemModule', Data)
    169169        else Core.CommonDatabase.Update('SystemModule', Data, 'Name="' + Identification + '"');
  • trunk/Modules/TV/UPageTV.pas

    r137 r138  
    5656  with TWebSession(HandlerData) do begin
    5757    ModuleUser.LoadUserInfo;
    58     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     58    with HtmlDocument.Body, SubItems.AddString do begin
    5959      Text := 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>' +
    6060    'Seznam všech kanálů do přehrávače: <a href="playlist/">Playlist</a><br/>' +
     
    7070        with DbRows[I] do begin
    7171          TuneUp := '&nbsp;';
    72           if Values['StreamWeb'] <> '' then
    73             TuneUp := MakeLink('Naladit', Values['StreamWeb']);
    74           if Values['Stream'] <> '' then
    75             TuneUp := MakeLink('Naladit', NavigationLink('/tv/playlist?id=' + Values['ShortName']));
    76           Text := Text + '<tr><td>' + MakeLink(Values['Name'], Values['Homepage']) +
     72          if Items['StreamWeb'] <> '' then
     73            TuneUp := MakeLink('Naladit', Items['StreamWeb']);
     74          if Items['Stream'] <> '' then
     75            TuneUp := MakeLink('Naladit', NavigationLink('/tv/playlist?id=' + Items['ShortName']));
     76          Text := Text + '<tr><td>' + MakeLink(Items['Name'], Items['Homepage']) +
    7777            '</td><td align="center">' +
    78             Values['Language'] + '</td><td align="center">' + Values['Category'] + '</td>' +
     78            Items['Language'] + '</td><td align="center">' + Items['Category'] + '</td>' +
    7979            '<td>' + TuneUp + '</td></tr>';
    8080        end;
     
    9999  I: Integer;
    100100  Text: string;
     101  Id: string;
    101102begin
    102103  with TWebSession(HandlerData) do begin
    103       Response.Headers.Add('Content-Type', 'audio/mpegurl');
    104       Response.Headers.Add('Content-Disposition', 'attachment; filename=playlist.m3u');
    105       try
    106         DbRows := TDbRows.Create;
     104    Response.Headers.Add('Content-Type', 'audio/mpegurl');
     105    Response.Headers.Add('Content-Disposition', 'attachment; filename=playlist.m3u');
     106    try
     107      DbRows := TDbRows.Create;
    107108
    108109      Text := '#EXTM3U' + LineEnding;
    109       if Request.Query.SearchKey('id') <> -1 then begin
    110         Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") AND (`ShortName`="' + Database.EscapeString(Request.Query.Values['id']) + '") ');
     110      if Request.Query.TryGetValue('id', Id) then begin
     111        Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") AND (`ShortName`="' + Database.EscapeString(Id) + '") ');
    111112        if DbRows.Count > 0 then begin
    112           Text := Text + '#EXTINF:0,' + DbRows[0].Values['Name'] + LineEnding
    113           + DbRows[0].Values['Stream'] + LineEnding;
     113          Text := Text + '#EXTINF:0,' + DbRows[0].Items['Name'] + LineEnding
     114          + DbRows[0].Items['Stream'] + LineEnding;
    114115        end;
    115116      end else begin
    116117        Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") ORDER BY `Name` ');
    117118        for I := 0 to DbRows.Count - 1 do begin
    118           Text := Text + '#EXTINF:0,' + DbRows[I].Values['Name'] + LineEnding
    119           + DbRows[I].Values['Stream'] + LineEnding;
     119          Text := Text + '#EXTINF:0,' + DbRows[I].Items['Name'] + LineEnding
     120          + DbRows[I].Items['Stream'] + LineEnding;
    120121        end;
    121122      end;
    122123      Response.Content.WriteString(Text);
    123124
    124       finally
    125         DbRows.Free;
    126       end
     125    finally
     126      DbRows.Free;
     127    end
    127128  end;
    128129end;
  • trunk/Modules/User/UUser.pas

    r137 r138  
    55uses
    66  Classes, SysUtils, synacode, USqlDatabase, UCommon, UHTTPServer,
    7   SpecializedDictionary;
     7  UGenerics;
    88
    99const
     
    6262  DbRows: TDbRows;
    6363  Id: Integer;
    64 begin
    65   try
    66     DbRows := TDbRows.Create;
    67     if HandlerData.Request.Cookies.SearchKey('SessionId') <> -1 then begin
     64  SessionId: string;
     65begin
     66  try
     67    DbRows := TDbRows.Create;
     68    if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then begin
    6869    Database.Query(DbRows, 'SELECT * FROM `UserOnline` WHERE `SessionId`="' +
    69       HandlerData.Request.Cookies.Values['SessionId'] + '"');
     70      SessionId + '"');
    7071    if DbRows.Count > 0 then begin
    7172      // Update exited
    72       Id := StrToInt(DbRows[0].Values['Id']);
    73       if DbRows[0].Values['User'] = '' then User := UnknownUser
    74         else User := StrToInt(DbRows[0].Values['User']);
     73      Id := StrToInt(DbRows[0].Items['Id']);
     74      if DbRows[0].Items['User'] = '' then User := UnknownUser
     75        else User := StrToInt(DbRows[0].Items['User']);
    7576      Database.Query(DbRows, 'UPDATE `UserOnline` SET `ActivityTime` = NOW() WHERE `Id`=' + IntToStr(Id));
    7677    end else begin
    7778      // Create new record
    7879      Database.Query(DbRows, 'INSERT INTO `UserOnline` (`User`, `ActivityTime`, `SessionId`, `ScriptName`) ' +
    79         'VALUES (NULL, NOW(), "' + HandlerData.Request.Cookies.Values['SessionId'] + '", "")');
     80        'VALUES (NULL, NOW(), "' + SessionId + '", "")');
    8081      Id := Database.LastInsertId;
    8182      User := UnknownUser;
     
    9091var
    9192  DbRows: TDbRows;
     93  SessionId: string;
    9294begin
    9395  Logout;
     96  if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then
    9497  try
    9598    DbRows := TDbRows.Create;
     
    97100    if DbRows.Count > 0 then begin
    98101      Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = ' + IntToStr(User) + ', `LoginTime` = NOW() WHERE `SessionId`="' +
    99         HandlerData.Request.Cookies.Values['SessionId'] + '"');
     102        SessionId + '"');
    100103      Self.User := User;
    101104    end else
     
    109112var
    110113  DbRows: TDbRows;
     114  SessionId: string;
    111115begin
    112116  if Id = UnknownUser then Update;
    113117  if User <> UnknownUser then begin
     118    if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then
    114119    try
    115120      DbRows := TDbRows.Create;
    116121      Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = NULL WHERE `SessionId`="' +
    117         HandlerData.Request.Cookies.Values['SessionId'] + '"');
     122        SessionId + '"');
    118123    finally
    119124      DbRows.Free;
     
    197202    DbRows := TDbRows.Create;
    198203    Database.Query(DbRows, 'SELECT `Id` FROM `User` WHERE `Name`="' + Name + '"');
    199     if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[0].Value)
     204    if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items['Id'])
    200205      else Result := UnknownUser;
    201206  finally
     
    212217    Database.Query(DbRows, 'SELECT `Id` FROM `User` WHERE `Name`="' + Name + '" AND ' +
    213218      '`Password` = SHA1(CONCAT("' + Password + '", Salt))');
    214     if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[0].Value)
     219    if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items['Id'])
    215220      else Result := UnknownUser;
    216221  finally
     
    228233    Database.Query(DbRows, 'SELECT * FROM `User` WHERE `Id`="' + IntToStr(Id) + '"');
    229234    if DbRows.Count = 1 then begin
    230       Name := DbRows[0].Values['Name'];
    231       FullName := DbRows[0].Values['FullName'];
    232       Email := DbRows[0].Values['Email'];
     235      Name := DbRows[0].Items['Name'];
     236      FullName := DbRows[0].Items['FullName'];
     237      Email := DbRows[0].Items['Email'];
    233238    end else
    234239      raise ENotFound.Create(Format(SUserNotFound, [IntToStr(Id)]));
     
    254259    try
    255260      DbRows2 := TDbRows.Create;
    256       OperationId := StrToInt(DbRows[0].Values['Id']);
     261      OperationId := StrToInt(DbRows[0].Items['Id']);
    257262
    258263      // Check user-operation relation
     
    268273        '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL');
    269274      if DbRows2.Count > 0 then begin
    270         if CheckGroupPermission(StrToInt(DbRows2[0].Values['AssignedGroup']), OperationId) then begin
     275        if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), OperationId) then begin
    271276          Result := True;
    272277          Exit;
     
    301306        '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL');
    302307      if DbRows2.Count > 0 then begin
    303         if CheckGroupPermission(StrToInt(DbRows2[0].Values['AssignedGroup']), Operation) then begin
     308        if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), Operation) then begin
    304309          Result := True;
    305310          Exit;
  • trunk/Modules/User/UUserControlPage.pas

    r137 r138  
    8787      AddNewAction('Přihlásit', 'Login');
    8888    end;
    89     if HandlerData.Request.Post.SearchKey('Login') <> -1 then begin
     89    if HandlerData.Request.Post.ContainsKey('Login') then begin
    9090      Form.Load(HandlerData.Request.Post);
    91       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     91      with SubItems.AddString do
    9292        Text := 'Přihlášení uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
    9393      UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,
    9494        TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value);
    9595      if UserId = -1 then begin
    96         with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     96        with SubItems.AddString do
    9797          Text := '<br/>Chybné jméno nebo heslo';
    9898      end else ModuleUser.UserOnline.Login(UserId);
    9999      Form.Free;
    100100    end else
    101       SubItems.AddNew(Form);
     101      SubItems.Add(Form);
    102102  end;
    103103end;
     
    144144      AddNewAction('Registrovat', 'Register');
    145145    end;
    146     if HandlerData.Request.Post.SearchKey('Register') <> -1 then
     146    if HandlerData.Request.Post.ContainsKey('Register') then
    147147    with HandlerData.Request do begin
    148148      Form.Load(HandlerData.Request.Post);
    149       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     149      with SubItems.AddString do
    150150        Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
    151151      ModuleUser.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,
     
    156156      if UserId <> -1 then ModuleUser.UserOnline.Login(UserId);
    157157      Form.Free;
    158     end else SubItems.AddNew(Form);
     158    end else SubItems.Add(Form);
    159159  end;
    160160end;
     
    164164  with TWebSession(HandlerData), Core, HtmlDocument.Body do begin
    165165    ModuleUser.UserOnline.Logout;
    166     with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     166    with SubItems.AddString do
    167167      Text := 'Uživatel odhlášen';
    168168  end;
     
    213213      AddNewAction('Uložit', 'Save');
    214214    end;
    215     if HandlerData.Request.Post.SearchKey('Save') <> -1 then
     215    if HandlerData.Request.Post.ContainsKey('Save') then
    216216    with HandlerData.Request do begin
    217217      Form.Load(HandlerData.Request.Post);
    218       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     218      with SubItems.AddString do
    219219        Text := 'Profil uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value + ' uložen';
    220220      ModuleUser.User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
     
    223223      ModuleUser.User.Save;
    224224      Form.Free;
    225     end else SubItems.AddNew(Form);
     225    end else SubItems.Add(Form);
    226226  end;
    227227end;
  • trunk/Modules/ZdechovNET/UAboutPage.lfm

    r97 r138  
    11object AboutPage: TAboutPage
    22  OldCreateOrder = False
     3  Raw = False
    34  Caption = 'Úvod'
    45  OnProduce = DataModuleProduce
    5   Height = 206
    6   HorizontalOffset = 259
    7   VerticalOffset = 250
    8   Width = 407
     6  Height = 309
     7  HorizontalOffset = 389
     8  VerticalOffset = 375
     9  Width = 611
     10  PPI = 144
    911end
  • trunk/Modules/ZdechovNET/UAboutPage.pas

    r137 r138  
    1212  TAboutPage = class(TWebPage)
    1313    procedure DataModuleProduce(HandlerData: THTTPHandlerData);
    14   private
    15     { private declarations }
    1614  public
    1715    ModuleUser: TModuleUser;
     
    3937  with TWebSession(HandlerData) do begin
    4038    ModuleUser.LoadUserInfo;
    41     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     39    with HtmlDocument.Body, SubItems.AddString do begin
    4240      Text := '<table><tr><td style="vertical-align: top;">' +
    4341        '<a href="' + NavigationLink('/images/pokryti.jpg') + '">' +
     
    8886        for I := 0 to DbRows.Count - 1 do begin
    8987          Text := Text + '<div>' +
    90             '<strong>' + DbRows[I].Values['Title'] + '</strong> ' +
    91             '<strong>(' + HumanDate(SQLToDateTime(DbRows[I].Values['Time'])) + ')</strong>' +
     88            '<strong>' + DbRows[I].Items['Title'] + '</strong> ' +
     89            '<strong>(' + HumanDate(SQLToDateTime(DbRows[I].Items['Time'])) + ')</strong>' +
    9290            '<br/>' +
    93             DbRows[I].Values['Text'] + '</div></br>';
     91            DbRows[I].Items['Text'] + '</div></br>';
    9492        end;
    9593      finally
  • trunk/Modules/ZdechovNET/UContactPage.lfm

    r97 r138  
    11object ContactPage: TContactPage
    22  OldCreateOrder = False
     3  Raw = False
    34  Caption = 'Kontakt'
    45  OnProduce = DataModuleProduce
    5   Height = 186
    6   HorizontalOffset = 295
    7   VerticalOffset = 245
    8   Width = 496
     6  Height = 279
     7  HorizontalOffset = 443
     8  VerticalOffset = 368
     9  Width = 744
     10  PPI = 144
    911end
  • trunk/Modules/ZdechovNET/UContactPage.pas

    r135 r138  
    3131procedure TContactPage.DataModuleProduce(HandlerData: THTTPHandlerData);
    3232begin
    33   with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     33  with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin
    3434    ModuleUser.LoadUserInfo;
    3535    Text := '<strong>Kontaktní informace</strong><br/>' +
  • trunk/Modules/ZdechovNET/UDocumentsPage.pas

    r135 r138  
    3535  with TWebSession(HandlerData) do begin
    3636    ModuleUser.LoadUserInfo;
    37     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     37    with HtmlDocument.Body, SubItems.AddString do begin
    3838      Text := Text + '<strong>Úřední dokumenty:</strong><br/>' +
    3939        IconedLink(NavigationLink('/docs/rozhrani.pdf'), 'Technická specifikace účastnických rozhraní') + ' ' +
  • trunk/Modules/ZdechovNET/UHistoryPage.pas

    r135 r138  
    3939  with TWebSession(HandlerData) do begin
    4040    ModuleUser.LoadUserInfo;
    41     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     41    with HtmlDocument.Body, SubItems.AddString do begin
    4242      Text := '<table>';
    4343      try
     
    4646        for I := 0 to DbRows.Count - 1 do begin
    4747          Text := Text + '<tr><td style="text-align: right; vertical-align: top;">' +
    48             HumanDate(SQLToDateTime(DbRows[I].Values['Date'])) + '&nbsp;- </td><td>' +
    49             DbRows[I].Values['Text'] + '</td></tr>';
     48            HumanDate(SQLToDateTime(DbRows[I].Items['Date'])) + '&nbsp;- </td><td>' +
     49            DbRows[I].Items['Text'] + '</td></tr>';
    5050        end;
    5151      finally
  • trunk/Modules/ZdechovNET/UHostingPage.pas

    r135 r138  
    3939  with TWebSession(HandlerData) do begin
    4040    ModuleUser.LoadUserInfo;
    41     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     41    with HtmlDocument.Body, SubItems.AddString do begin
    4242      Text := 'V nabídce je provoz virtualizovaných Linuxových serverů dle dohodnutých parameterů.<br/><br/>' +
    4343      '<strong>Standardní varianty:</strong><br/>' +
     
    4848        Database.Query(DbRows, 'SELECT * FROM VPSHosting ORDER BY Price DESC');
    4949        for I := 0 to DbRows.Count - 1 do
    50           Text := Text + '<tr><td>' + DbRows[I].Values['Name'] + '</td><td align="center">' +
    51             DbRows[I].Values['Internet'] + '</td><td align="center">' + DbRows[I].Values['Memory'] +
    52             '</td><td align="center">' + DbRows[I].Values['Space'] + '</td><td align="center">' +
    53             DbRows[I].Values['CPU'] + '</td><td align="center">' + DbRows[I].Values['Price'] + '</td></tr>';
     50          Text := Text + '<tr><td>' + DbRows[I].Items['Name'] + '</td><td align="center">' +
     51            DbRows[I].Items['Internet'] + '</td><td align="center">' + DbRows[I].Items['Memory'] +
     52            '</td><td align="center">' + DbRows[I].Items['Space'] + '</td><td align="center">' +
     53            DbRows[I].Items['CPU'] + '</td><td align="center">' + DbRows[I].Items['Price'] + '</td></tr>';
    5454      finally
    5555        DbRows.Free;
     
    6969        Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=0');
    7070        for I := 0 to DbRows.Count - 1 do
    71           if DbRows[I].Values['Homepage'] <> '' then
    72           Text := Text + '<li><a href="' + DbRows[I].Values['Homepage'] + '">' +
    73             DbRows[I].Values['Name'] + '</a></li>'
    74             else Text := Text + '<li>' + DbRows[I].Values['Name'] + '</li>';
     71          if DbRows[I].Items['Homepage'] <> '' then
     72          Text := Text + '<li><a href="' + DbRows[I].Items['Homepage'] + '">' +
     73            DbRows[I].Items['Name'] + '</a></li>'
     74            else Text := Text + '<li>' + DbRows[I].Items['Name'] + '</li>';
    7575        Text := Text + '</ul>';
    7676      finally
     
    8383        Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=1');
    8484        for I := 0 to DbRows.Count - 1 do
    85           Text := Text + '<li><a href="' + DbRows[I].Values['Homepage'] + '">' +
    86             DbRows[I].Values['Name'] + '</a></li>';
     85          Text := Text + '<li><a href="' + DbRows[I].Items['Homepage'] + '">' +
     86            DbRows[I].Items['Name'] + '</a></li>';
    8787        Text := Text + '</ul>';
    8888      finally
  • trunk/Modules/ZdechovNET/UIPTVPage.pas

    r137 r138  
    8989  with TWebSession(HandlerData) do begin
    9090    ModuleUser.LoadUserInfo;
    91     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     91    with HtmlDocument.Body, SubItems.AddString do begin
    9292      Channels := TChannels.Create;
    9393      with Channels do begin
  • trunk/Modules/ZdechovNET/UInternetPage.pas

    r135 r138  
    3535  with TWebSession(HandlerData) do begin
    3636    ModuleUser.LoadUserInfo;
    37     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     37    with HtmlDocument.Body, SubItems.AddString do begin
    3838      Text := Text + 'V síti je možné využít také doplňkovou nabídku výhodného připojení k internetu. ' +
    3939      'Tarify se liší v základu minimální a maximální rychlostí. U všech placených tarifů je také k dispozici bonusová sdílená rychlost z volné kapacity sítě.<br/><br/>' +
  • trunk/Modules/ZdechovNET/ULinksPage.pas

    r135 r138  
    3333procedure TLinksPage.DataModuleProduce(HandlerData: THTTPHandlerData);
    3434begin
    35   with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     35  with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin
    3636    ModuleUser.LoadUserInfo;
    3737    Text := '<strong>Odkazy související s obcí:</strong><br/>' +
    3838
    39     '<a href="http://www.zdechov.cz/">Obec Zděchov</a> - oficiální stránky  obce<br/>' +
    40     '<a href="http://zdechovskagrapa.sweb.cz/">Zděchovská grapa</a> - místní motokrosové závody<br/>' +
    41     '<a href="http://skiareal.zdechov.net/">Skiareál</a> - areál se sjezdovkou pro lyžaře i snowboardisty<br/>' +
    42     '<a href="http://sdh.zdechov.net/">SDH Zděchov</a> - Sbor Dobrovolných Hasičů Zděchov<br/>' +
    43     '<a href="http://fotbal.zdechov.net/">TJ Sokol Zděchov</a> - stránky věnované Zděchovskému fotbalovému týmu<br/>' +
    44     '<a href="http://farnost.zdechov.net/">Farnost Zděchov</a> - informace k místní farnosti<br/>' +
     39    '<a href="https://www.zdechov.cz/">Obec Zděchov</a> - oficiální stránky  obce<br/>' +
     40    '<a href="https://motokros.zdechov.net/">Zděchovská grapa</a> - místní motokrosové závody<br/>' +
     41    '<a href="https://skiareal.zdechov.net/">Skiareál</a> - areál se sjezdovkou pro lyžaře i snowboardisty<br/>' +
     42    '<a href="https://sdh.zdechov.net/">SDH Zděchov</a> - Sbor Dobrovolných Hasičů Zděchov<br/>' +
     43    '<a href="https://fotbal.zdechov.net/">TJ Sokol Zděchov</a> - stránky věnované Zděchovskému fotbalovému týmu<br/>' +
     44    '<a href="https://farnost.zdechov.net/">Farnost Zděchov</a> - informace k místní farnosti<br/>' +
    4545    '<br/>' +
    4646
    4747    '<strong>Odkazy související s okolím:</strong><br/>' +
    48     '<a href="http://www.valassko-hornovsacko.cz/">Valašsko - Horní Vsacko</a> - informační stránky oblasti<br/>' +
     48    '<a href="https://www.valassko-hornovsacko.cz/">Valašsko - Horní Vsacko</a> - informační stránky oblasti<br/>' +
    4949    '<br/>' +
    5050
     
    5757
    5858    '<strong>Komunitní sítě v okolí:</strong><br/>' +
    59     '<a href="http://www.hovnet.cz/">Hovnet</a> - síť v Hovězí, Janové, Huslenkách a dalších obcích<br/>' +
     59    '<a href="https://www.hovnet.cz/">Hovnet</a> - síť v Hovězí, Janové, Huslenkách a dalších obcích<br/>' +
    6060    //'<a href="http://czvk3.net/">czvk3net</a> - síť ve Valašských Kloboucích<br/>' +
    61     '<a href="http://hvfree.net/">HvFree.net</a> - síť v Tylovicích, Hážovicích, Viganticích a Hutisku<br/>' +
     61    '<a href="https://hvfree.net/">HvFree.net</a> - síť v Tylovicích, Hážovicích, Viganticích a Hutisku<br/>' +
    6262    '<a href="http://www.ustinet.cz/">Ústí.Net</a> - síť v Ústí u Vsetína<br/>' +
    6363    '<br/>';
  • trunk/Modules/ZdechovNET/UModuleZdechovNET.pas

    r137 r138  
    264264procedure TModuleZdechovNET.Upgrade;
    265265begin
    266   inherited Upgrade;
     266  inherited;
    267267end;
    268268
     
    277277begin
    278278  with Session do
    279   with TXmlTag(HtmlDocument.Body.SubItems.AddNew(TXmlTag.Create)) do begin
    280     Name := 'ul';
    281     Attributes.Values['class'] := 'Footer';
    282     with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin
    283       Name := 'li';
    284       with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin
    285         Text := TCore(MainModule).Admin;
     279  with HtmlDocument.Body.SubItems.AddList do begin
     280    ClassId := 'Footer';
     281    with SubItems.AddString do begin
     282      Text := TCore(MainModule).Admin;
     283    end;
     284    with SubItems.AddString do begin
     285      Text := TCore(MainModule).AdminEmail;
     286    end;
     287    if TCore(MainModule).ShowRuntimeInfo then begin
     288      with SubItems.AddString do begin
     289        Text := 'Doba generování: ' +
     290          FloatToStr(Round(((Now - TimeStart) / OneMillisecond) * 100) / 100) + ' s / '; // + ini_get('max_execution_time') + ' s';
     291      end;
     292      with SubItems.AddString do begin
     293        //Text := 'Použitá paměť: '  + System.PrefixMultiplier.AddPrefixMultipliers(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B';
    286294      end;
    287295    end;
    288     with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin
    289       Name := 'li';
    290       with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin
    291         Text := TCore(MainModule).AdminEmail;
    292       end;
    293     end;
    294     if TCore(MainModule).ShowRuntimeInfo then begin
    295       with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin
    296         Name := 'li';
    297         with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin
    298           Text := 'Doba generování: ' +
    299             FloatToStr(Round(((Now - TimeStart) / OneMillisecond) * 100) / 100) + ' s / '; // + ini_get('max_execution_time') + ' s';
    300         end;
    301       end;
    302       with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin
    303         Name := 'li';
    304         with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin
    305           //Text := 'Použitá paměť: '  + System.PrefixMultiplier.AddPrefixMultipliers(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B';
    306         end;
    307       end;
    308     end;
    309296  end;
    310297end;
    311298
    312299procedure TModuleZdechovNET.TopMenu(Session: TWebSession);
    313 begin
    314   with Session, THtmlString(HtmlDocument.Body.SubItems.InsertNew(1, THtmlString.Create)) do begin
     300var
     301  Output: THtmlString;
     302begin
     303  Output := THtmlString.Create;
     304  Session.HtmlDocument.Body.SubItems.Insert(1, Output);
     305  with Output do begin
    315306    Text := '<div class="Navigation">';
    316307    // Visitor
     
    326317      '<li>' + MakeLink('Kamery', NavigationLink('/kamery/')) + '</li>' +
    327318      '<li><a href="https://mail.zdechov.net/">Pošta</a></li>' +
    328       '<li><a href="http://wiki.zdechov.net/">Wiki</a></li>' +
     319      '<li><a href="https://wiki.zdechov.net/">Wiki</a></li>' +
    329320      '</ul><ul class="MenuItem2">'; //<li>&nbsp;</li>';
    330321    if False and Assigned(ModuleBase.Pages.FindByName('uzivatel')) then begin
     
    356347  with ASession do begin
    357348    if Page.Raw then begin
    358       Response.Content.WriteString(THtmlString(HtmlDocument.Body.SubItems[0]).Text);
     349      Response.Content.WriteString(HtmlDocument.Body.AsXmlElement.AsString);
    359350    end else begin
    360351      HtmlDocument.ContentLanguage := 'cs';
  • trunk/Modules/ZdechovNET/UNetworkPage.pas

    r135 r138  
    3737  with TWebSession(HandlerData) do begin
    3838    ModuleUser.LoadUserInfo;
    39     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     39    with HtmlDocument.Body, SubItems.AddString do begin
    4040      Text := MakeLink('Dokumenty', NavigationLink('/dokumenty/')) + '<br/>' +
    4141        MakeLink('Historie', NavigationLink('/historie/')) + '<br/>' +
  • trunk/Modules/ZdechovNET/UPlansPage.pas

    r135 r138  
    3939  with TWebSession(HandlerData) do begin
    4040    ModuleUser.LoadUserInfo;
    41     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     41    with HtmlDocument.Body, SubItems.AddString do begin
    4242      Text := '<table>';
    4343      try
     
    4747        Database.Query(DbRows, 'SELECT * FROM `Plans` WHERE (`TimeFinished` IS NULL) AND (`Public`=1) ORDER BY `TimeCreate`');
    4848        for I := 0 to DbRows.Count - 1 do begin
    49           Text := Text + '<li>' + DbRows[I].Values['Description'] + '</li>';
     49          Text := Text + '<li>' + DbRows[I].Items['Description'] + '</li>';
    5050        end;
    5151        Text := Text + '</ul></div><br/>';
     
    5555        Database.Query(DbRows, 'SELECT * FROM `Plans` WHERE (`TimeFinished` IS NOT NULL) AND (`Public`=1) ORDER BY `TimeCreate`');
    5656        for I := 0 to DbRows.Count - 1 do begin
    57           Text := Text + '<li>' + DbRows[I].Values['Description'] + '<br/>' +
    58             '<i style="padding-left: 30px;">' + DbRows[I].Values['Conclusion'] + '</i></li>';
     57          Text := Text + '<li>' + DbRows[I].Items['Description'] + '<br/>' +
     58            '<i style="padding-left: 30px;">' + DbRows[I].Items['Conclusion'] + '</i></li>';
    5959        end;
    6060        Text := Text + '</ul></div><br/>';
  • trunk/Modules/ZdechovNET/UProjectsPage.pas

    r135 r138  
    3939  with TWebSession(HandlerData) do begin
    4040    ModuleUser.LoadUserInfo;
    41     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     41    with HtmlDocument.Body, SubItems.AddString do begin
    4242      try
    4343        DbRows := TDbRows.Create;
     
    4747        Database.Query(DbRows, 'SELECT * FROM `Plans` ORDER BY `TimeCreate` DESC');
    4848        for I := 0 to DbRows.Count - 1 do begin
    49           Text := Text + '<tr><td>' + DbRows[I].Values['TimeCreate'] + '</td>' +
    50             '<td>' + DbRows[I].Values['TimeFinished'] + '</td>' +
    51             '<td>' + DbRows[I].Values['Description'] + '</td>' +
    52             '<td>' + DbRows[I].Values['Public'] + '</td></tr>';
     49          Text := Text + '<tr><td>' + DbRows[I].Items['TimeCreate'] + '</td>' +
     50            '<td>' + DbRows[I].Items['TimeFinished'] + '</td>' +
     51            '<td>' + DbRows[I].Items['Description'] + '</td>' +
     52            '<td>' + DbRows[I].Items['Public'] + '</td></tr>';
    5353        end;
    5454        Text := Text + '</table>';
  • trunk/Modules/ZdechovNET/URobotsPage.pas

    r137 r138  
    3737  with TWebSession(HandlerData) do begin
    3838    ModuleUser.LoadUserInfo;
    39     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     39    with HtmlDocument.Body, SubItems.AddString do begin
    4040      Text := 'User-agent: *' + LineEnding +
    4141        'Disallow: /*?';
  • trunk/Modules/ZdechovNET/UVoIPPage.pas

    r135 r138  
    3535  with TWebSession(HandlerData) do begin
    3636    ModuleUser.LoadUserInfo;
    37     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     37    with HtmlDocument.Body, SubItems.AddString do begin
    3838      Text := 'Volejte levněji do pevných a mobilních sítí s sekundovou tarifikací a bez měsíčního paušálu.' +
    3939      ' A v rámci sítě a těch co mají v obci VoIP od stejného operátora dokonce zdarma. <br/>' +
  • trunk/Modules/ZdechovNET/UWebCamPage.pas

    r137 r138  
    4545  Value: Integer;
    4646  NotFound: Boolean;
     47  WidthValue: string;
    4748begin
    4849  with TWebSession(HandlerData) do begin
    4950    ModuleUser.LoadUserInfo;
    50     with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin
     51    with HtmlDocument.Body, SubItems.AddString do begin
    5152      Text := '';
    5253      CameraId := -1;
     
    6465      //HandlerData.Request.Query.Values['W'] := 'dsd';
    6566      //HandlerData.Request.Query.Values['H'] := 'dsd';
    66       if (HandlerData.Request.Query.SearchKey('W') = -1) then begin
    67         ImageWidth := 640;
    68       end else begin
    69         ImageWidth := StrToInt(HandlerData.Request.Query.Values['W']);
    70       end;
     67      if HandlerData.Request.Query.TryGetValue('W', WidthValue) then
     68        ImageWidth := StrToInt(WidthValue)
     69        else ImageWidth := 640;
    7170
    7271      Text := Text + '<table style="width: 100%"><tr><td style="width: 20%" valign="top">' +
     
    8483        Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1');
    8584        for I := 0 to DbRows.Count - 1 do begin
    86           Text := Text + MakeLink(DbRows[I].Values['Name'], NavigationLink(
    87             '/kamery/' + DbRows[I].Values['Id'] + '/?W=' + IntToStr(ImageWidth))) + '<br/>';
     85          Text := Text + MakeLink(DbRows[I].Items['Name'], NavigationLink(
     86            '/kamery/' + DbRows[I].Items['Id'] + '/?W=' + IntToStr(ImageWidth))) + '<br/>';
    8887        end;
    8988      finally
     
    125124    ImageWidthThumb := 160;
    126125    for I := 0 to DbRows.Count - 1 do begin
    127       ImageHeightThumb := Round(ImageWidthThumb * StrToInt(DbRows[I].Values['Height']) / StrToInt(DbRows[I].Values['Width']));
    128       WebCamImage := 'images/webcam/' + DbRows[I].Values['ImageName'];
     126      ImageHeightThumb := Round(ImageWidthThumb * StrToInt(DbRows[I].Items['Height']) / StrToInt(DbRows[I].Items['Width']));
     127      WebCamImage := 'images/webcam/' + DbRows[I].Items['ImageName'];
    129128      Result := Result + '<span align="center" valign="middle" style="vertical-align: middle;">' + //DbRows[I].Values['Name'] + '<br/>' +
    130         '<a href="' + NavigationLink('/kamery/' + DbRows[I].Values['Id'] + '/?W=' + IntToStr(ImageWidth)) + '">' +
     129        '<a href="' + NavigationLink('/kamery/' + DbRows[I].Items['Id'] + '/?W=' + IntToStr(ImageWidth)) + '">' +
    131130        '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' +
    132131        IntToStr(ImageWidthThumb) + '" height="' + IntToStr(ImageHeightThumb) + '" alt="' +
    133         DbRows[I].Values['Name'] + '"/></a></span> ';
     132        DbRows[I].Items['Name'] + '"/></a></span> ';
    134133    end;
    135134  finally
     
    153152      IntToStr(Id) + ') AND (`Enabled`=1)');
    154153    if DbRows.Count > 0 then begin
    155       WebCamImage := 'images/webcam/' + DbRows[0].Values['ImageName'];
    156       RefreshInterval := StrToInt(DbRows[0].Values['ImagePeriod']);
    157       ImageHeight := Round(ImageWidth * StrToInt(DbRows[0].Values['Height']) / StrToInt(DbRows[0].Values['Width']));
     154      WebCamImage := 'images/webcam/' + DbRows[0].Items['ImageName'];
     155      RefreshInterval := StrToInt(DbRows[0].Items['ImagePeriod']);
     156      ImageHeight := Round(ImageWidth * StrToInt(DbRows[0].Items['Height']) / StrToInt(DbRows[0].Items['Width']));
    158157
    159158      if FileExists(WebCamImage) then begin
     
    181180          '</script>' + #13#10 +
    182181
    183           '<br /><div align="center">' + DbRows[0].Values['Name'] + '<br/>' +
     182          '<br /><div align="center">' + DbRows[0].Items['Name'] + '<br/>' +
    184183          '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' +
    185184          '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) +
    186185          '" height="' + IntToStr(ImageHeight) + '" alt="' +
    187           DbRows[0].Values['Name'] + '"/></div>';
     186          DbRows[0].Items['Name'] + '"/></div>';
    188187      end else Result := Result + '<br />Obrázek nenalezen.<br /><br />';
    189188      Result := Result + '<br/><div align="center">';
    190189      if LastFileDate <> '' then Result := Result + 'Aktualizace: <span id="lasttime">' +
    191190        LastFileDate + '</span>, ';
    192       Result := Result + 'Perioda: ' + IntToStr(RefreshInterval) + ' sekund, Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' +
    193         '<br/>' + DbRows[0].Values['Description'];
    194       Result := Result + GetVideoArchive(DbRows[0].Values['Id']) + '</div>';
     191      Result := Result + 'Perioda: ' + IntToStr(RefreshInterval) + ' sekund, Typ: ' +
     192        DbRows[0].Items['DeviceType'] + '<br />' +
     193        '<br/>' + DbRows[0].Items['Description'];
     194      Result := Result + GetVideoArchive(DbRows[0].Items['Id']) + '</div>';
    195195    end else Result := Result + '<br />Id kamery nenalezeno.<br/><br>';
    196196  finally
Note: See TracChangeset for help on using the changeset viewer.