Changeset 138
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 deleted
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UWebObjects.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UHtmlClasses, UXmlClasses, SpecializedDictionary, 7 Generics.Collections; 6 Classes, SysUtils, UHtmlClasses, UXmlClasses, Generics.Collections; 8 7 9 8 type … … 42 41 Title: string; 43 42 Rows: TQueryFormItemList; 44 procedure Load(Items: TDictionary StringString);43 procedure Load(Items: TDictionary<string, string>); 45 44 function AddNewItem: TQueryFormItem; 46 45 constructor Create; … … 69 68 function AddNewGroup: TQueryFormGroup; 70 69 function AddNewAction(Caption, Action: string): TQueryAction; 71 procedure Load(Items: TDictionary StringString);70 procedure Load(Items: TDictionary<string, string>); 72 71 constructor Create; 73 72 destructor Destroy; override; … … 84 83 begin 85 84 I := 0; 86 while (I < Count) and ( TQueryFormItem(Items[I]).Value.ItemName <> AValue) do Inc(I);87 if I < Count then Result := TQueryFormItem(Items[I])85 while (I < Count) and (Items[I].Value.ItemName <> AValue) do Inc(I); 86 if I < Count then Result := Items[I] 88 87 else Result := nil; 89 88 end; … … 141 140 Table := THtmlTable.Create; 142 141 Table.ClassId := ClassId; 143 Row := T HtmlRow(Table.Rows.AddNew(THtmlRow.Create));144 with THtmlCell(Row.Cells.AddNew(THtmlCell.Create))do begin142 Row := Table.Rows.AddRow; 143 with Row.Cells.AddCell do begin 145 144 ColSpan := 2; 146 145 Value := THtmlString.Create; … … 149 148 with Table do 150 149 for G := 0 to Groups.Count - 1 do 151 with TQueryFormGroup(Groups[G])do begin150 with Groups[G] do begin 152 151 if Title <> '' then begin 153 Row := T HtmlRow(Table.Rows.AddNew(THtmlRow.Create));154 with THtmlCell(Row.Cells.AddNew(THtmlCell.Create))do begin152 Row := Table.Rows.AddRow; 153 with Row.Cells.AddCell do begin 155 154 ColSpan := 2; 156 155 Value := THtmlString.Create; … … 159 158 end; 160 159 for I := 0 to Rows.Count - 1 do 161 with TQueryFormItem(Rows[I])do begin162 Row := T HtmlRow(Table.Rows.AddNew(THtmlRow.Create));163 with THtmlCell(Row.Cells.AddNew(THtmlCell.Create))do begin160 with Rows[I] do begin 161 Row := Table.Rows.AddRow; 162 with Row.Cells.AddCell do begin 164 163 Value := THtmlString.Create; 165 164 THtmlString(Value).Text := Caption; … … 167 166 THtmlString(Value).Text := THtmlString(Value).Text + ': '; 168 167 end; 169 with THtmlCell(Row.Cells.AddNew(THtmlCell.Create))do begin168 with Row.Cells.AddCell do begin 170 169 Value := THtmlInput.Create; 171 THtmlInput(Value).Assign( TQueryFormItem(Rows[I]).Value);170 THtmlInput(Value).Assign(Rows[I].Value); 172 171 end; 173 172 end; 174 173 end; 175 Row := T HtmlRow(Table.Rows.AddNew(THtmlRow.Create));176 with THtmlCell(Row.Cells.AddNew(THtmlCell.Create))do begin174 Row := Table.Rows.AddRow; 175 with Row.Cells.AddCell do begin 177 176 ColSpan := 2; 178 177 Value := THtmlBlock.Create; 179 178 for I := 0 to Actions.Count - 1 do 180 with THtml Input(THtmlBlock(Value).SubItems.AddNew(THtmlInput.Create))do begin181 Value := TQueryAction(Actions[I]).Caption;179 with THtmlBlock(Value).SubItems.AddInput do begin 180 Value := Actions[I].Caption; 182 181 InputType := itSubmit; 183 ItemName := TQueryAction(Actions[I]).Action;182 ItemName := Actions[I].Action; 184 183 end; 185 184 end; … … 203 202 end; 204 203 205 procedure TQueryForm.Load(Items: TDictionary StringString);204 procedure TQueryForm.Load(Items: TDictionary<string, string>); 206 205 var 207 206 I: Integer; 208 207 begin 209 208 for I := 0 to Groups.Count - 1 do 210 TQueryFormGroup(Groups[I]).Load(Items);209 Groups[I].Load(Items); 211 210 end; 212 211 … … 229 228 { TQueryFormGroup } 230 229 231 procedure TQueryFormGroup.Load(Items: TDictionaryStringString); 232 var 233 I: Integer; 230 procedure TQueryFormGroup.Load(Items: TDictionary<string, string>); 231 var 232 I: Integer; 233 Item: string; 234 234 begin 235 235 for I := 0 to Rows.Count - 1 do 236 with TQueryFormItem(Rows[I])do begin237 if Items. SearchKey(Value.ItemName) <> -1then238 Value.Value := Item s.Values[Value.ItemName];236 with Rows[I] do begin 237 if Items.TryGetValue(Value.ItemName, Item) then 238 Value.Value := Item; 239 239 end; 240 240 end; -
trunk/Application/UWebSession.pas
r137 r138 6 6 Classes, SysUtils, UHTTPServer, USqlDatabase, UHTTPSessionMySQL, UUser, 7 7 UHtmlClasses, UWebPage, UUtils, UXmlClasses, DateUtils, UModularSystem, 8 UPageList, UWebApp, SpecializedList;8 UPageList, UWebApp, UGenerics; 9 9 10 10 type … … 86 86 try 87 87 BaseUrlParts := TListString.Create; 88 BaseUrlParts.Explode( BaseURL, '/', StrToStr);88 BaseUrlParts.Explode('/', BaseURL); 89 89 while (BaseUrlParts.Count > 0) and (Request.Path.Count > 0) and 90 90 (BaseUrlParts[0] = Request.Path[0]) do begin … … 104 104 except 105 105 on E: Exception do begin 106 THTMLString(Self.HtmlDocument.Body.SubItems.AddNew(THtmlString.Create)). 107 Text := Format(SError, [E.Message]); 106 Self.HtmlDocument.Body.SubItems.AddString.Text := Format(SError, [E.Message]); 108 107 GeneratePage(Page.Page); 109 108 end; -
trunk/Modules/Base/UModuleBase.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UModularSystem, SpecializedDictionary, UWebPage, UWebApp,6 Classes, SysUtils, UModularSystem, UGenerics, UWebPage, UWebApp, 7 7 UWebSession, UHTTPServer; 8 8 -
trunk/Modules/IS/UModuleIS.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 7 UModuleBase; 6 Classes, SysUtils, UModularSystem, USqlDatabase, UModuleBase, UGenerics; 8 7 9 8 type -
trunk/Modules/News/UNews.pas
r137 r138 97 97 DbRows := TDbRows.Create; 98 98 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']; 100 100 Output := Output + '<div class="Action"><a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit</a>'; 101 101 if ModuleUser.User.CheckPermission('News', 'Insert', 'Group', Category) then … … 113 113 Output := Output + '<table class="NewsTable">'; 114 114 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']; 117 117 Output := Output + '<tr><td onclick="window.location=''aktuality/index.php?action=view&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'] + 120 121 '</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 begin122 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 126 127 Output := Output + '<br />Přílohy: '; 127 Enclosures := Explode(';', DbRows[I]. Values['Enclosure']);128 Enclosures := Explode(';', DbRows[I].Items['Enclosure']); 128 129 for J := 0 to Length(Enclosures) - 1 do begin 129 130 if FileExists(UploadedFilesFolder + Enclosures[J]) then … … 173 174 NewSetting := TNewsSettingItem.Create; 174 175 with NewSetting do begin 175 CategoryId := StrToInt(DbRows[I]. Values['Id']);176 CategoryId := StrToInt(DbRows[I].Items['Id']); 176 177 Index := I; 177 178 Enabled := True; 178 179 ItemCount := 6; // System->Config['Web']['News']['Count'] 179 180 DaysAgo := 30; // System->Config['Web']['News']['DaysAgo'] 180 Group := StrToInt(DbRows[I]. Values['Group']);181 Group := StrToInt(DbRows[I].Items['Group']); 181 182 end; 182 183 Settings.Add(NewSetting); … … 205 206 Column: Integer; 206 207 I: Integer; 208 Action: string; 207 209 begin 208 210 Output := ''; … … 211 213 LoadSettingsFromCookies; 212 214 213 if HandlerData.Request.Query. SearchKey('Action') <> -1then begin215 if HandlerData.Request.Query.TryGetValue('Action', Action) then begin 214 216 // Show news customize menu 215 if HandlerData.Request.Query.Values['Action']= 'CustomizeNews' then begin217 if Action = 'CustomizeNews' then begin 216 218 Output := Output + ShowCustomizeMenu; 217 219 end; … … 251 253 with TNewsSettingItem(Settings[I]) do begin 252 254 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'] + 254 256 '</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex' + 255 257 IntToStr(I) + '" value="' + IntToStr(Index) + '" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled' + IntToStr(I) + '"'; -
trunk/Modules/Portal/UModulePortal.pas
r137 r138 4 4 5 5 uses 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; 9 8 10 9 type … … 187 186 //Navigation := '<a href="' + NavigationLink(PathTreePath) + '">' + PathTreeItem[0] + '</a> > '; 188 187 ScriptName := Copy(ScriptName, Length(Core.BaseURL), Length(ScriptName)); 189 ScriptNameParts.Explode( ScriptName, '/', StrToStr);188 ScriptNameParts.Explode('/', ScriptName); 190 189 ScriptNameParts.Delete(0); 191 190 (* -
trunk/Modules/Portal/UPagePortal.pas
r137 r138 5 5 uses 6 6 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils, 7 SpecializedDictionary, UWebSession, UHtmlClasses, UModularSystem, UModuleUser,7 UGenerics, UWebSession, UHtmlClasses, UModularSystem, UModuleUser, 8 8 UModuleNews; 9 9 … … 70 70 for I := 0 to HyperLinks.Count - 1 do begin 71 71 HyperLink := Hyperlinks[I]; 72 if HyperLink. Values['IconFile'] = '' then73 HyperLink. Values['IconFile'] := 'clear.png';74 if Copy(HyperLink. Values['URL'], 1, 4) <> 'http' then75 HyperLink. Values['URL'] := NavigationLink(HyperLink.Values['URL']);76 if ((HyperLink. Values['PermissionModule'] = '') or77 ((HyperLink. Values['PermissionModule'] <> '') and78 ModuleUser.User.CheckPermission(HyperLink. Values['PermissionModule'], HyperLink.Values['PermissionOperation']))) then79 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 />'; 80 80 end; 81 Result := ShowPanel(HyperlinkGroups[0]. Values['Name'], Result);81 Result := ShowPanel(HyperlinkGroups[0].Items['Name'], Result); 82 82 83 83 finally … … 98 98 DbRows2: TDbRows; 99 99 I, J: Integer; 100 Action: string; 100 101 begin 101 102 try … … 104 105 Output := ''; 105 106 with Session.Request do 106 if Query. SearchKey('Action') <> -1then begin107 if Query.Values['Action']= 'CustomizeNewsSave' then begin107 if Query.TryGetValue('Action', Action) then begin 108 if Action = 'CustomizeNewsSave' then begin 108 109 //Output := $this->System->Modules['News']->CustomizeSave(); 109 110 end else 110 if Query.Values['Action']= 'LoginForm' then begin111 if Action = 'LoginForm' then begin 111 112 Form := TQueryForm.Create; // UserLogin 112 113 Form.AddNewAction('Přihlásit', '?Action=Login'); … … 115 116 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 116 117 end else 117 if Query.Values['Action']= 'Login' then begin118 if Action = 'Login' then begin 118 119 Form := TQueryForm.Create; // UserLogin 119 120 Form.Load(Session.Request.Post); … … 131 132 end; 132 133 end else 133 if Query.Values['Action']= 'Logout' then begin134 if Action = 'Logout' then begin 134 135 ModuleUser.UserOnline.Logout; 135 136 Output := Output + SystemMessage('Odhlášení', 'Uživatel odhlášen'); 136 137 end else 137 if Query.Values['Action']= 'UserOptions' then begin138 if Action = 'UserOptions' then begin 138 139 UserOptions := TQueryForm.Create; // UserOptions 139 140 //UserOptions.LoadValuesFromDatabase(Session.User.Id); … … 141 142 Output := Output + UserOptions.AsXmlElement.AsString; 142 143 end else 143 if Query.Values['Action']= 'UserOptionsSave' then begin144 if Action = 'UserOptionsSave' then begin 144 145 UserOptions := TQueryForm.Create; // UserOptions 145 146 UserOptions.Load(Session.Request.Post); … … 151 152 Output := Output + UserOptions.AsXmlElement.AsString; 152 153 end else 153 if Query.Values['Action']= 'UserRegister' then begin154 if Action = 'UserRegister' then begin 154 155 Form := TQueryForm.Create; //'UserRegister'); 155 156 Form.Load(Session.Request.Post); … … 157 158 Output := Output + Form.AsXmlElement.AsString; 158 159 end else 159 if Query.Values['Action']= 'UserRegisterConfirm' then begin160 if Action = 'UserRegisterConfirm' then begin 160 161 //Session.User.RegisterConfirm($_GET['User'], $_GET['H']); 161 162 Output := Output + SystemMessage('Potvrzení registrace', 'Registrace potvrzena'); 162 163 end else 163 if Query.Values['Action']= 'PasswordRecovery' then begin164 if Action = 'PasswordRecovery' then begin 164 165 Form := TQueryForm.Create; // PasswordRecovery 165 166 Form.AddNewAction('Obnovit', '?Action=PasswordRecovery2'); 166 167 Output := Output + Form.AsXmlElement.AsString; 167 168 end else 168 if Query.Values['Action']= 'PasswordRecovery2' then begin169 if Action = 'PasswordRecovery2' then begin 169 170 Form := TQueryForm.Create; // PasswordRecovery 170 171 Form.Load(Session.Request.Post); … … 175 176 //end; 176 177 end else 177 if Query.Values['Action']= 'PasswordRecoveryConfirm' then begin178 if Action = 'PasswordRecoveryConfirm' then begin 178 179 //Session.User.PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']); 179 180 Output := Output + SystemMessage('Obnova hesla', 'Potvrzení obnovení hesla'); 180 181 end (*else 181 if Query.Values['Action']= 'UserRegisterSave' then begin182 if Action = 'UserRegisterSave' then begin 182 183 Form := TQueryForm.Create; // UserRegister 183 184 Form.Load(Session.Request.Post); … … 189 190 end; 190 191 end else 191 if Query.Values['Action']= 'MemberOptions' then begin192 if Action = 'MemberOptions' then begin 192 193 $UserOptions = new Form('MemberOptions'); 193 194 $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']); … … 200 201 $Output .= $UserOptions->ShowEditForm(); 201 202 end else 202 if Query.Values['Action']= 'MemberOptionsSave' then begin203 if Action = 'MemberOptionsSave' then begin 203 204 $UserOptions = new Form('MemberOptions'); 204 205 $UserOptions->LoadValuesFromForm(); … … 235 236 for I := 0 to DbRows.Count - 1 do begin 236 237 PanelColumn := DbRows[I]; 237 if PanelColumn. Values['Width'] <> '' then238 Width := ' width="' + PanelColumn. Values['Width'] + '"'238 if PanelColumn.Items['Width'] <> '' then 239 Width := ' width="' + PanelColumn.Items['Width'] + '"' 239 240 else Width := ''; 240 241 Output := Output + '<td valign="top"' + Width + '>'; 241 242 Session.Database.Query(DbRows2, 'SELECT * FROM `Panel` WHERE `PanelColumn`=' + 242 PanelColumn. Values['Id'] + ' ORDER BY `Order`');243 PanelColumn.Items['Id'] + ' ORDER BY `Order`'); 243 244 for J := 0 to DbRows2.Count - 1 do begin 244 245 Panel := DbRows2[J]; 245 if Panel. Values['Module'] = 'HyperlinkGroup' then246 Output := Output + ShowLinks(StrToInt(Panel. Values['Parameters']))247 else if Panel. Values['Module'] = 'OnlineHostList' then246 if Panel.Items['Module'] = 'HyperlinkGroup' then 247 Output := Output + ShowLinks(StrToInt(Panel.Items['Parameters'])) 248 else if Panel.Items['Module'] = 'OnlineHostList' then 248 249 Output := Output + ShowPanel('Online počítače', OnlineHostList) 249 else if Panel. Values['Module'] = 'UserOptions' then250 else if Panel.Items['Module'] = 'UserOptions' then 250 251 begin 251 252 if ModuleUser.User.Id <> UnknownUser then 252 253 Output := Output + ShowPanel('Přihlášený uživatel', UserPanel); 253 254 end else 254 if Panel. Values['Module'] = 'Webcam' then255 if Panel.Items['Module'] = 'Webcam' then 255 256 Output := Output + ShowPanel('Kamery', WebcamPanel) 256 else if Panel. Values['Module'] = 'NewsGroupList' then257 else if Panel.Items['Module'] = 'NewsGroupList' then 257 258 Output := Output + ShowPanel('Aktuality', 258 259 ModuleNews.Show(HandlerData)); //, … … 263 264 Output := Output + '</tr></table>'; 264 265 with TWebSession(HandlerData) do begin 265 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do266 with HtmlDocument.Body, SubItems.AddString do 266 267 Text := Text + Output; 267 268 end; -
trunk/Modules/System/UModuleSystem.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UModularSystem, SpecializedDictionary;6 Classes, SysUtils, UModularSystem, UGenerics; 7 7 8 8 type … … 75 75 for I := 0 to DbRows.Count - 1 do 76 76 with DbRows[I] do begin 77 Module := Manager.FindModuleByName( Values['Name']);77 Module := Manager.FindModuleByName(Items['Name']); 78 78 if Assigned(Module) then 79 if Values['Installed'] = '1' then Module.SetInstalledState(True)79 if Items['Installed'] = '1' then Module.SetInstalledState(True) 80 80 else Module.SetInstalledState(False); 81 81 end; … … 165 165 166 166 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); 168 168 if Index >= DbRows.Count then Core.CommonDatabase.Insert('SystemModule', Data) 169 169 else Core.CommonDatabase.Update('SystemModule', Data, 'Name="' + Identification + '"'); -
trunk/Modules/TV/UPageTV.pas
r137 r138 56 56 with TWebSession(HandlerData) do begin 57 57 ModuleUser.LoadUserInfo; 58 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin58 with HtmlDocument.Body, SubItems.AddString do begin 59 59 Text := 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>' + 60 60 'Seznam všech kanálů do přehrávače: <a href="playlist/">Playlist</a><br/>' + … … 70 70 with DbRows[I] do begin 71 71 TuneUp := ' '; 72 if Values['StreamWeb'] <> '' then73 TuneUp := MakeLink('Naladit', Values['StreamWeb']);74 if Values['Stream'] <> '' then75 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']) + 77 77 '</td><td align="center">' + 78 Values['Language'] + '</td><td align="center">' + Values['Category'] + '</td>' +78 Items['Language'] + '</td><td align="center">' + Items['Category'] + '</td>' + 79 79 '<td>' + TuneUp + '</td></tr>'; 80 80 end; … … 99 99 I: Integer; 100 100 Text: string; 101 Id: string; 101 102 begin 102 103 with TWebSession(HandlerData) do begin 103 104 105 106 104 Response.Headers.Add('Content-Type', 'audio/mpegurl'); 105 Response.Headers.Add('Content-Disposition', 'attachment; filename=playlist.m3u'); 106 try 107 DbRows := TDbRows.Create; 107 108 108 109 Text := '#EXTM3U' + LineEnding; 109 if Request.Query. SearchKey('id') <> -1then begin110 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) + '") '); 111 112 if DbRows.Count > 0 then begin 112 Text := Text + '#EXTINF:0,' + DbRows[0]. Values['Name'] + LineEnding113 + DbRows[0]. Values['Stream'] + LineEnding;113 Text := Text + '#EXTINF:0,' + DbRows[0].Items['Name'] + LineEnding 114 + DbRows[0].Items['Stream'] + LineEnding; 114 115 end; 115 116 end else begin 116 117 Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") ORDER BY `Name` '); 117 118 for I := 0 to DbRows.Count - 1 do begin 118 Text := Text + '#EXTINF:0,' + DbRows[I]. Values['Name'] + LineEnding119 + DbRows[I]. Values['Stream'] + LineEnding;119 Text := Text + '#EXTINF:0,' + DbRows[I].Items['Name'] + LineEnding 120 + DbRows[I].Items['Stream'] + LineEnding; 120 121 end; 121 122 end; 122 123 Response.Content.WriteString(Text); 123 124 124 125 126 125 finally 126 DbRows.Free; 127 end 127 128 end; 128 129 end; -
trunk/Modules/User/UUser.pas
r137 r138 5 5 uses 6 6 Classes, SysUtils, synacode, USqlDatabase, UCommon, UHTTPServer, 7 SpecializedDictionary;7 UGenerics; 8 8 9 9 const … … 62 62 DbRows: TDbRows; 63 63 Id: Integer; 64 begin 65 try 66 DbRows := TDbRows.Create; 67 if HandlerData.Request.Cookies.SearchKey('SessionId') <> -1 then begin 64 SessionId: string; 65 begin 66 try 67 DbRows := TDbRows.Create; 68 if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then begin 68 69 Database.Query(DbRows, 'SELECT * FROM `UserOnline` WHERE `SessionId`="' + 69 HandlerData.Request.Cookies.Values['SessionId']+ '"');70 SessionId + '"'); 70 71 if DbRows.Count > 0 then begin 71 72 // Update exited 72 Id := StrToInt(DbRows[0]. Values['Id']);73 if DbRows[0]. Values['User'] = '' then User := UnknownUser74 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']); 75 76 Database.Query(DbRows, 'UPDATE `UserOnline` SET `ActivityTime` = NOW() WHERE `Id`=' + IntToStr(Id)); 76 77 end else begin 77 78 // Create new record 78 79 Database.Query(DbRows, 'INSERT INTO `UserOnline` (`User`, `ActivityTime`, `SessionId`, `ScriptName`) ' + 79 'VALUES (NULL, NOW(), "' + HandlerData.Request.Cookies.Values['SessionId']+ '", "")');80 'VALUES (NULL, NOW(), "' + SessionId + '", "")'); 80 81 Id := Database.LastInsertId; 81 82 User := UnknownUser; … … 90 91 var 91 92 DbRows: TDbRows; 93 SessionId: string; 92 94 begin 93 95 Logout; 96 if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then 94 97 try 95 98 DbRows := TDbRows.Create; … … 97 100 if DbRows.Count > 0 then begin 98 101 Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = ' + IntToStr(User) + ', `LoginTime` = NOW() WHERE `SessionId`="' + 99 HandlerData.Request.Cookies.Values['SessionId']+ '"');102 SessionId + '"'); 100 103 Self.User := User; 101 104 end else … … 109 112 var 110 113 DbRows: TDbRows; 114 SessionId: string; 111 115 begin 112 116 if Id = UnknownUser then Update; 113 117 if User <> UnknownUser then begin 118 if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then 114 119 try 115 120 DbRows := TDbRows.Create; 116 121 Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = NULL WHERE `SessionId`="' + 117 HandlerData.Request.Cookies.Values['SessionId']+ '"');122 SessionId + '"'); 118 123 finally 119 124 DbRows.Free; … … 197 202 DbRows := TDbRows.Create; 198 203 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']) 200 205 else Result := UnknownUser; 201 206 finally … … 212 217 Database.Query(DbRows, 'SELECT `Id` FROM `User` WHERE `Name`="' + Name + '" AND ' + 213 218 '`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']) 215 220 else Result := UnknownUser; 216 221 finally … … 228 233 Database.Query(DbRows, 'SELECT * FROM `User` WHERE `Id`="' + IntToStr(Id) + '"'); 229 234 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']; 233 238 end else 234 239 raise ENotFound.Create(Format(SUserNotFound, [IntToStr(Id)])); … … 254 259 try 255 260 DbRows2 := TDbRows.Create; 256 OperationId := StrToInt(DbRows[0]. Values['Id']);261 OperationId := StrToInt(DbRows[0].Items['Id']); 257 262 258 263 // Check user-operation relation … … 268 273 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 269 274 if DbRows2.Count > 0 then begin 270 if CheckGroupPermission(StrToInt(DbRows2[0]. Values['AssignedGroup']), OperationId) then begin275 if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), OperationId) then begin 271 276 Result := True; 272 277 Exit; … … 301 306 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 302 307 if DbRows2.Count > 0 then begin 303 if CheckGroupPermission(StrToInt(DbRows2[0]. Values['AssignedGroup']), Operation) then begin308 if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), Operation) then begin 304 309 Result := True; 305 310 Exit; -
trunk/Modules/User/UUserControlPage.pas
r137 r138 87 87 AddNewAction('Přihlásit', 'Login'); 88 88 end; 89 if HandlerData.Request.Post. SearchKey('Login') <> -1then begin89 if HandlerData.Request.Post.ContainsKey('Login') then begin 90 90 Form.Load(HandlerData.Request.Post); 91 with THtmlString(SubItems.AddNew(THtmlString.Create))do91 with SubItems.AddString do 92 92 Text := 'Přihlášení uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 93 93 UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 94 94 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 95 95 if UserId = -1 then begin 96 with THtmlString(SubItems.AddNew(THtmlString.Create))do96 with SubItems.AddString do 97 97 Text := '<br/>Chybné jméno nebo heslo'; 98 98 end else ModuleUser.UserOnline.Login(UserId); 99 99 Form.Free; 100 100 end else 101 SubItems.Add New(Form);101 SubItems.Add(Form); 102 102 end; 103 103 end; … … 144 144 AddNewAction('Registrovat', 'Register'); 145 145 end; 146 if HandlerData.Request.Post. SearchKey('Register') <> -1then146 if HandlerData.Request.Post.ContainsKey('Register') then 147 147 with HandlerData.Request do begin 148 148 Form.Load(HandlerData.Request.Post); 149 with THtmlString(SubItems.AddNew(THtmlString.Create))do149 with SubItems.AddString do 150 150 Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 151 151 ModuleUser.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, … … 156 156 if UserId <> -1 then ModuleUser.UserOnline.Login(UserId); 157 157 Form.Free; 158 end else SubItems.Add New(Form);158 end else SubItems.Add(Form); 159 159 end; 160 160 end; … … 164 164 with TWebSession(HandlerData), Core, HtmlDocument.Body do begin 165 165 ModuleUser.UserOnline.Logout; 166 with THtmlString(SubItems.AddNew(THtmlString.Create))do166 with SubItems.AddString do 167 167 Text := 'Uživatel odhlášen'; 168 168 end; … … 213 213 AddNewAction('Uložit', 'Save'); 214 214 end; 215 if HandlerData.Request.Post. SearchKey('Save') <> -1then215 if HandlerData.Request.Post.ContainsKey('Save') then 216 216 with HandlerData.Request do begin 217 217 Form.Load(HandlerData.Request.Post); 218 with THtmlString(SubItems.AddNew(THtmlString.Create))do218 with SubItems.AddString do 219 219 Text := 'Profil uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value + ' uložen'; 220 220 ModuleUser.User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; … … 223 223 ModuleUser.User.Save; 224 224 Form.Free; 225 end else SubItems.Add New(Form);225 end else SubItems.Add(Form); 226 226 end; 227 227 end; -
trunk/Modules/ZdechovNET/UAboutPage.lfm
r97 r138 1 1 object AboutPage: TAboutPage 2 2 OldCreateOrder = False 3 Raw = False 3 4 Caption = 'Úvod' 4 5 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 9 11 end -
trunk/Modules/ZdechovNET/UAboutPage.pas
r137 r138 12 12 TAboutPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 39 37 with TWebSession(HandlerData) do begin 40 38 ModuleUser.LoadUserInfo; 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin39 with HtmlDocument.Body, SubItems.AddString do begin 42 40 Text := '<table><tr><td style="vertical-align: top;">' + 43 41 '<a href="' + NavigationLink('/images/pokryti.jpg') + '">' + … … 88 86 for I := 0 to DbRows.Count - 1 do begin 89 87 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>' + 92 90 '<br/>' + 93 DbRows[I]. Values['Text'] + '</div></br>';91 DbRows[I].Items['Text'] + '</div></br>'; 94 92 end; 95 93 finally -
trunk/Modules/ZdechovNET/UContactPage.lfm
r97 r138 1 1 object ContactPage: TContactPage 2 2 OldCreateOrder = False 3 Raw = False 3 4 Caption = 'Kontakt' 4 5 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 9 11 end -
trunk/Modules/ZdechovNET/UContactPage.pas
r135 r138 31 31 procedure TContactPage.DataModuleProduce(HandlerData: THTTPHandlerData); 32 32 begin 33 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin33 with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin 34 34 ModuleUser.LoadUserInfo; 35 35 Text := '<strong>Kontaktní informace</strong><br/>' + -
trunk/Modules/ZdechovNET/UDocumentsPage.pas
r135 r138 35 35 with TWebSession(HandlerData) do begin 36 36 ModuleUser.LoadUserInfo; 37 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin37 with HtmlDocument.Body, SubItems.AddString do begin 38 38 Text := Text + '<strong>Úřední dokumenty:</strong><br/>' + 39 39 IconedLink(NavigationLink('/docs/rozhrani.pdf'), 'Technická specifikace účastnických rozhraní') + ' ' + -
trunk/Modules/ZdechovNET/UHistoryPage.pas
r135 r138 39 39 with TWebSession(HandlerData) do begin 40 40 ModuleUser.LoadUserInfo; 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin41 with HtmlDocument.Body, SubItems.AddString do begin 42 42 Text := '<table>'; 43 43 try … … 46 46 for I := 0 to DbRows.Count - 1 do begin 47 47 Text := Text + '<tr><td style="text-align: right; vertical-align: top;">' + 48 HumanDate(SQLToDateTime(DbRows[I]. Values['Date'])) + ' - </td><td>' +49 DbRows[I]. Values['Text'] + '</td></tr>';48 HumanDate(SQLToDateTime(DbRows[I].Items['Date'])) + ' - </td><td>' + 49 DbRows[I].Items['Text'] + '</td></tr>'; 50 50 end; 51 51 finally -
trunk/Modules/ZdechovNET/UHostingPage.pas
r135 r138 39 39 with TWebSession(HandlerData) do begin 40 40 ModuleUser.LoadUserInfo; 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin41 with HtmlDocument.Body, SubItems.AddString do begin 42 42 Text := 'V nabídce je provoz virtualizovaných Linuxových serverů dle dohodnutých parameterů.<br/><br/>' + 43 43 '<strong>Standardní varianty:</strong><br/>' + … … 48 48 Database.Query(DbRows, 'SELECT * FROM VPSHosting ORDER BY Price DESC'); 49 49 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>'; 54 54 finally 55 55 DbRows.Free; … … 69 69 Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=0'); 70 70 for I := 0 to DbRows.Count - 1 do 71 if DbRows[I]. Values['Homepage'] <> '' then72 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>'; 75 75 Text := Text + '</ul>'; 76 76 finally … … 83 83 Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=1'); 84 84 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>'; 87 87 Text := Text + '</ul>'; 88 88 finally -
trunk/Modules/ZdechovNET/UIPTVPage.pas
r137 r138 89 89 with TWebSession(HandlerData) do begin 90 90 ModuleUser.LoadUserInfo; 91 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin91 with HtmlDocument.Body, SubItems.AddString do begin 92 92 Channels := TChannels.Create; 93 93 with Channels do begin -
trunk/Modules/ZdechovNET/UInternetPage.pas
r135 r138 35 35 with TWebSession(HandlerData) do begin 36 36 ModuleUser.LoadUserInfo; 37 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin37 with HtmlDocument.Body, SubItems.AddString do begin 38 38 Text := Text + 'V síti je možné využít také doplňkovou nabídku výhodného připojení k internetu. ' + 39 39 '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 33 33 procedure TLinksPage.DataModuleProduce(HandlerData: THTTPHandlerData); 34 34 begin 35 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin35 with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin 36 36 ModuleUser.LoadUserInfo; 37 37 Text := '<strong>Odkazy související s obcí:</strong><br/>' + 38 38 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/>' + 45 45 '<br/>' + 46 46 47 47 '<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/>' + 49 49 '<br/>' + 50 50 … … 57 57 58 58 '<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/>' + 60 60 //'<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/>' + 62 62 '<a href="http://www.ustinet.cz/">Ústí.Net</a> - síť v Ústí u Vsetína<br/>' + 63 63 '<br/>'; -
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r137 r138 264 264 procedure TModuleZdechovNET.Upgrade; 265 265 begin 266 inherited Upgrade;266 inherited; 267 267 end; 268 268 … … 277 277 begin 278 278 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'; 286 294 end; 287 295 end; 288 with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin289 Name := 'li';290 with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin291 Text := TCore(MainModule).AdminEmail;292 end;293 end;294 if TCore(MainModule).ShowRuntimeInfo then begin295 with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin296 Name := 'li';297 with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin298 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 begin303 Name := 'li';304 with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin305 //Text := 'Použitá paměť: ' + System.PrefixMultiplier.AddPrefixMultipliers(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B';306 end;307 end;308 end;309 296 end; 310 297 end; 311 298 312 299 procedure TModuleZdechovNET.TopMenu(Session: TWebSession); 313 begin 314 with Session, THtmlString(HtmlDocument.Body.SubItems.InsertNew(1, THtmlString.Create)) do begin 300 var 301 Output: THtmlString; 302 begin 303 Output := THtmlString.Create; 304 Session.HtmlDocument.Body.SubItems.Insert(1, Output); 305 with Output do begin 315 306 Text := '<div class="Navigation">'; 316 307 // Visitor … … 326 317 '<li>' + MakeLink('Kamery', NavigationLink('/kamery/')) + '</li>' + 327 318 '<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>' + 329 320 '</ul><ul class="MenuItem2">'; //<li> </li>'; 330 321 if False and Assigned(ModuleBase.Pages.FindByName('uzivatel')) then begin … … 356 347 with ASession do begin 357 348 if Page.Raw then begin 358 Response.Content.WriteString( THtmlString(HtmlDocument.Body.SubItems[0]).Text);349 Response.Content.WriteString(HtmlDocument.Body.AsXmlElement.AsString); 359 350 end else begin 360 351 HtmlDocument.ContentLanguage := 'cs'; -
trunk/Modules/ZdechovNET/UNetworkPage.pas
r135 r138 37 37 with TWebSession(HandlerData) do begin 38 38 ModuleUser.LoadUserInfo; 39 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin39 with HtmlDocument.Body, SubItems.AddString do begin 40 40 Text := MakeLink('Dokumenty', NavigationLink('/dokumenty/')) + '<br/>' + 41 41 MakeLink('Historie', NavigationLink('/historie/')) + '<br/>' + -
trunk/Modules/ZdechovNET/UPlansPage.pas
r135 r138 39 39 with TWebSession(HandlerData) do begin 40 40 ModuleUser.LoadUserInfo; 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin41 with HtmlDocument.Body, SubItems.AddString do begin 42 42 Text := '<table>'; 43 43 try … … 47 47 Database.Query(DbRows, 'SELECT * FROM `Plans` WHERE (`TimeFinished` IS NULL) AND (`Public`=1) ORDER BY `TimeCreate`'); 48 48 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>'; 50 50 end; 51 51 Text := Text + '</ul></div><br/>'; … … 55 55 Database.Query(DbRows, 'SELECT * FROM `Plans` WHERE (`TimeFinished` IS NOT NULL) AND (`Public`=1) ORDER BY `TimeCreate`'); 56 56 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>'; 59 59 end; 60 60 Text := Text + '</ul></div><br/>'; -
trunk/Modules/ZdechovNET/UProjectsPage.pas
r135 r138 39 39 with TWebSession(HandlerData) do begin 40 40 ModuleUser.LoadUserInfo; 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin41 with HtmlDocument.Body, SubItems.AddString do begin 42 42 try 43 43 DbRows := TDbRows.Create; … … 47 47 Database.Query(DbRows, 'SELECT * FROM `Plans` ORDER BY `TimeCreate` DESC'); 48 48 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>'; 53 53 end; 54 54 Text := Text + '</table>'; -
trunk/Modules/ZdechovNET/URobotsPage.pas
r137 r138 37 37 with TWebSession(HandlerData) do begin 38 38 ModuleUser.LoadUserInfo; 39 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin39 with HtmlDocument.Body, SubItems.AddString do begin 40 40 Text := 'User-agent: *' + LineEnding + 41 41 'Disallow: /*?'; -
trunk/Modules/ZdechovNET/UVoIPPage.pas
r135 r138 35 35 with TWebSession(HandlerData) do begin 36 36 ModuleUser.LoadUserInfo; 37 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin37 with HtmlDocument.Body, SubItems.AddString do begin 38 38 Text := 'Volejte levněji do pevných a mobilních sítí s sekundovou tarifikací a bez měsíčního paušálu.' + 39 39 ' 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 45 45 Value: Integer; 46 46 NotFound: Boolean; 47 WidthValue: string; 47 48 begin 48 49 with TWebSession(HandlerData) do begin 49 50 ModuleUser.LoadUserInfo; 50 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin51 with HtmlDocument.Body, SubItems.AddString do begin 51 52 Text := ''; 52 53 CameraId := -1; … … 64 65 //HandlerData.Request.Query.Values['W'] := 'dsd'; 65 66 //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; 71 70 72 71 Text := Text + '<table style="width: 100%"><tr><td style="width: 20%" valign="top">' + … … 84 83 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1'); 85 84 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/>'; 88 87 end; 89 88 finally … … 125 124 ImageWidthThumb := 160; 126 125 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']; 129 128 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)) + '">' + 131 130 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + 132 131 IntToStr(ImageWidthThumb) + '" height="' + IntToStr(ImageHeightThumb) + '" alt="' + 133 DbRows[I]. Values['Name'] + '"/></a></span> ';132 DbRows[I].Items['Name'] + '"/></a></span> '; 134 133 end; 135 134 finally … … 153 152 IntToStr(Id) + ') AND (`Enabled`=1)'); 154 153 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'])); 158 157 159 158 if FileExists(WebCamImage) then begin … … 181 180 '</script>' + #13#10 + 182 181 183 '<br /><div align="center">' + DbRows[0]. Values['Name'] + '<br/>' +182 '<br /><div align="center">' + DbRows[0].Items['Name'] + '<br/>' + 184 183 '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' + 185 184 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) + 186 185 '" height="' + IntToStr(ImageHeight) + '" alt="' + 187 DbRows[0]. Values['Name'] + '"/></div>';186 DbRows[0].Items['Name'] + '"/></div>'; 188 187 end else Result := Result + '<br />Obrázek nenalezen.<br /><br />'; 189 188 Result := Result + '<br/><div align="center">'; 190 189 if LastFileDate <> '' then Result := Result + 'Aktualizace: <span id="lasttime">' + 191 190 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>'; 195 195 end else Result := Result + '<br />Id kamery nenalezeno.<br/><br>'; 196 196 finally -
trunk/Packages/Common/Common.lpk
r137 r138 42 42 <License Value="Copy left."/> 43 43 <Version Minor="10"/> 44 <Files Count="3 1">44 <Files Count="32"> 45 45 <Item1> 46 46 <Filename Value="StopWatch.pas"/> … … 179 179 <UnitName Value="UTestCase"/> 180 180 </Item31> 181 <Item32> 182 <Filename Value="UGenerics.pas"/> 183 <UnitName Value="UGenerics"/> 184 </Item32> 181 185 </Files> 182 186 <CompatibilityMode Value="True"/> -
trunk/Packages/Common/Common.pas
r137 r138 14 14 UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, UMetaCanvas, 15 15 UGeometric, UTranslator, ULanguages, UFormAbout, UAboutDialog, 16 UPixelPointer, UDataFile, UTestCase, LazarusPackageIntf;16 UPixelPointer, UDataFile, UTestCase, UGenerics, LazarusPackageIntf; 17 17 18 18 implementation -
trunk/Packages/Common/UCommon.pas
r137 r138 7 7 {$IFDEF UNIX}baseunix,{$ENDIF} 8 8 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics, 9 FileUtil ; //, ShFolder, ShellAPI;9 FileUtil, Generics.Collections; //, ShFolder, ShellAPI; 10 10 11 11 type … … 65 65 function GetFileFilterItemExt(Filter: string; Index: Integer): string; 66 66 function IntToBin(Data: Int64; Count: Byte): string; 67 function Implode(Separator: Char; List: TList<string>): string; 67 68 function LastPos(const SubStr: String; const S: String): Integer; 68 69 function LoadFileToStr(const FileName: TFileName): AnsiString; … … 313 314 end; 314 315 316 function Implode(Separator: Char; List: TList<string>): string; 317 var 318 I: Integer; 319 begin 320 Result := ''; 321 for I := 0 to List.Count - 1 do begin 322 Result := Result + List[I]; 323 if I > 0 then Result := Result + Separator; 324 end; 325 end; 326 315 327 {$IFDEF WINDOWS} 316 328 function GetUserName: string; -
trunk/Packages/CoolWeb/Common/UHtmlClasses.pas
r137 r138 4 4 5 5 uses 6 UXmlClasses, Classes, SysUtils, SpecializedList;6 UXmlClasses, Classes, SysUtils, Generics.Collections, UGenerics, UIpAddress; 7 7 8 8 type 9 10 { TDomainAddress } 11 12 TDomainAddress = class(TPersistent) 13 private 14 function GetAsString: string; 15 procedure SetAsString(const Value: string); 16 public 17 Levels: TListString; 18 constructor Create; 19 destructor Destroy; override; 20 property AsString: string read GetAsString write SetAsString; 21 end; 22 23 TAddrClass = (acA, acB, acC, acD, acE); 24 25 { TIpAddress } 26 27 TIpAddress = class(TPersistent) 28 private 29 function GetAddrClass: TAddrClass; 30 function GetAsCardinal: Cardinal; 31 function GetAsString: string; 32 function GetBroadcast: Boolean; 33 procedure SetBroadcast(const Value: Boolean); 34 procedure SetAsCardinal(const Value: Cardinal); 35 procedure SetAsString(const Value: string); 36 public 37 Octets: array[0..3] of Byte; 38 procedure Assign(Source: TPersistent); override; 39 function IsAddressString(Value: string): Boolean; 40 property AsCardinal: Cardinal read GetAsCardinal write SetAsCardinal; 41 property AsString: string read GetAsString write SetAsString; 42 property AddrClass: TAddrClass read GetAddrClass; 43 property Broadcast: Boolean read GetBroadcast write SetBroadcast; 44 end; 45 46 THostAddressState = (asDomainName, asIpAddress); 47 THostAddress = class(TPersistent) 48 private 49 function GetAsString: string; 50 procedure SetAsString(const Value: string); 51 public 52 State: THostAddressState; 53 DomainName: TDomainAddress; 54 IpAddress: TIpAddress; 55 constructor Create; 56 destructor Destroy; override; 57 property AsString: string read GetAsString write SetAsString; 58 end; 9 { TURL } 59 10 60 11 TURL = class(TPersistent) … … 90 41 end; 91 42 43 THtmlString = class; 44 THtmlBlock = class; 45 THtmlList = class; 46 THtmlInput = class; 47 48 { THtmlElements } 49 50 THtmlElements = class(TObjectList<THtmlElement>) 51 function AddString(Text: string = ''): THtmlString; 52 function AddBlock: THtmlBlock; 53 function AddList: THtmlList; 54 function AddInput: THtmlInput; 55 end; 56 92 57 TBlockType = (btNoTag, btBlockLevel, btInline); 93 58 … … 95 60 96 61 THtmlString = class(THtmlElement) 97 pr ivate62 protected 98 63 function GetAsXmlElement: TXmlElement; override; 99 64 public … … 105 70 106 71 THtmlLineBreak = class(THtmlElement) 107 pr ivate72 protected 108 73 function GetAsXmlElement: TXmlElement; override; 109 74 public … … 116 81 public 117 82 BlockType: TBlockType; 118 SubItems: TListObject; // TListObject<THtmlElement>; 83 SubItems: THtmlElements; 84 constructor Create; 85 destructor Destroy; override; 86 end; 87 88 TListType = (ltUnordered, ltOrdered); 89 90 { THtmlList } 91 92 THtmlList = class(THtmlElement) 93 protected 94 function GetAsXmlElement: TXmlElement; override; 95 public 96 ListType: TListType; 97 SubItems: THtmlElements; 119 98 constructor Create; 120 99 destructor Destroy; override; … … 122 101 123 102 THtmlLink = class(THtmlElement) 124 pr ivate103 protected 125 104 function GetAsXmlElement: TXmlElement; override; 126 105 public … … 140 119 141 120 THtmlImage = class(THtmlElement) 142 pr ivate121 protected 143 122 function GetAsXmlElement: TXmlElement; override; 144 123 public … … 156 135 157 136 THtmlInput = class(THtmlElement) 158 pr ivate137 protected 159 138 function GetAsXmlElement: TXmlElement; override; 160 139 public … … 197 176 198 177 THtmlCell = class(THtmlElement) 199 pr ivate178 protected 200 179 function GetAsXmlElement: TXmlElement; override; 201 180 public … … 207 186 end; 208 187 188 { THtmlCells } 189 190 THtmlCells = class(TObjectList<THtmlCell>) 191 function AddCell: THtmlCell; 192 end; 193 209 194 { THtmlRow } 210 195 211 196 THtmlRow = class(THtmlElement) 212 private 213 function GetAsXmlElement: TXmlElement; override; 214 public 215 Cells: TListObject; // TListObject<THtmlCell> 216 constructor Create; 217 destructor Destroy; override; 197 protected 198 function GetAsXmlElement: TXmlElement; override; 199 public 200 Cells: THtmlCells; 201 constructor Create; 202 destructor Destroy; override; 203 end; 204 205 { THtmlRows } 206 207 THtmlRows = class(TObjectList<THtmlRow>) 208 function AddRow: THtmlRow; 218 209 end; 219 210 … … 224 215 function GetAsXmlElement: TXmlElement; override; 225 216 public 226 Rows: T ListObject; // TListObject<THtmlRow>217 Rows: THtmlRows; 227 218 constructor Create; 228 219 destructor Destroy; override; … … 242 233 243 234 implementation 244 245 resourcestring246 SStringToIPConversionError = 'String to IP address conversion error';247 235 248 236 function LeftCutString(var Source, Output: string; Delimiter: string; Allowed: string = ''): Boolean; … … 298 286 end; 299 287 288 { THtmlCells } 289 290 function THtmlCells.AddCell: THtmlCell; 291 begin 292 Result := THtmlCell.Create; 293 Add(Result); 294 end; 295 296 { THtmlRows } 297 298 function THtmlRows.AddRow: THtmlRow; 299 begin 300 Result := THtmlRow.Create; 301 Add(Result); 302 end; 303 304 { THtmlList } 305 306 function THtmlList.GetAsXmlElement: TXmlElement; 307 var 308 I: Integer; 309 begin 310 Result := TXmlTag.Create; 311 with TXmlTag(Result) do begin 312 case ListType of 313 ltOrdered: Name := 'ol'; 314 ltUnordered: Name := 'ul'; 315 end; 316 for I := 0 to SubItems.Count - 1 do begin 317 with SubElements.AddTag('li') do 318 SubElements.Add(SubItems[I].AsXmlElement); 319 end; 320 end; 321 end; 322 323 constructor THtmlList.Create; 324 begin 325 inherited; 326 SubItems := THtmlElements.Create; 327 end; 328 329 destructor THtmlList.Destroy; 330 begin 331 FreeAndNil(SubItems); 332 inherited; 333 end; 334 335 { THtmlElements } 336 337 function THtmlElements.AddString(Text: string = ''): THtmlString; 338 begin 339 Result := THtmlString.Create; 340 Result.Text := Text; 341 Add(Result); 342 end; 343 344 function THtmlElements.AddBlock: THtmlBlock; 345 begin 346 Result := THtmlBlock.Create; 347 Add(Result); 348 end; 349 350 function THtmlElements.AddList: THtmlList; 351 begin 352 Result := THtmlList.Create; 353 Add(Result); 354 end; 355 356 function THtmlElements.AddInput: THtmlInput; 357 begin 358 Result := THtmlInput.Create; 359 Add(Result); 360 end; 361 300 362 { THtmlCell } 301 363 … … 319 381 destructor THtmlCell.Destroy; 320 382 begin 321 Value.Free;383 FreeAndNil(Value); 322 384 inherited; 323 385 end; … … 332 394 TXmlTag(Result).Name := 'tr'; 333 395 for Column := 0 to Cells.Count - 1 do 334 TXmlTag(Result).SubElements.Add New(THtmlCell(Cells[Column]).AsXmlElement);396 TXmlTag(Result).SubElements.Add(Cells[Column].AsXmlElement); 335 397 end; 336 398 337 399 constructor THtmlRow.Create; 338 400 begin 339 Cells := T ListObject.Create;401 Cells := THtmlCells.Create; 340 402 end; 341 403 342 404 destructor THtmlRow.Destroy; 343 405 begin 344 Cells.Free;406 FreeAndNil(Cells); 345 407 inherited; 346 408 end; … … 350 412 function THtmlTable.GetAsXmlElement: TXmlElement; 351 413 var 352 Row , Column: Integer;414 Row: Integer; 353 415 begin 354 416 Result := inherited; … … 356 418 Name := 'table'; 357 419 for Row := 0 to Rows.Count - 1 do 358 SubElements.Add New(THtmlRow(Rows[Row]).AsXmlElement);420 SubElements.Add(Rows[Row].AsXmlElement); 359 421 end; 360 422 end; … … 362 424 constructor THtmlTable.Create; 363 425 begin 364 Rows := T ListObject.Create;426 Rows := THtmlRows.Create; 365 427 end; 366 428 367 429 destructor THtmlTable.Destroy; 368 430 begin 369 Rows.Free;431 FreeAndNil(Rows); 370 432 inherited; 371 433 end; … … 448 510 destructor THtmlForm.Destroy; 449 511 begin 450 Action.Free;512 FreeAndNil(Action); 451 513 inherited; 452 514 end; … … 465 527 destructor THtmlDocument.Destroy; 466 528 begin 467 Body.Free;468 Styles.Free;469 Scripts.Free;529 FreeAndNil(Body); 530 FreeAndNil(Styles); 531 FreeAndNil(Scripts); 470 532 inherited; 471 533 end; … … 473 535 function THtmlDocument.GetAsXmlDocument: TXmlDocument; 474 536 var 475 DocType: TXMLTag;476 HTMLTag: TXMLTag;477 537 I: Integer; 478 538 begin 479 539 Result := TXmlDocument.Create; 480 540 with Result, Content do begin 481 DocType := TXMlTag.Create; 482 DocType.Name := '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"'; 483 Doctype.EndTagSymbol := ''; 484 SubElements.Add(DocType); 485 HTMLTag := TXMLTag.Create; 486 with HTMLTag do begin 487 Name := 'html'; 488 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 489 Name := 'head'; 490 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 491 Name := 'title'; 492 with TXmlString(SubElements[SubElements.Add(TXmlString.Create)]) do begin 493 Text := Title; 494 end; 541 with SubElements.AddTag('!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"') do begin 542 EndTagSymbol := ''; 543 end; 544 with SubElements.AddTag('html') do begin 545 with SubElements.AddTag('head') do begin 546 with SubElements.AddTag('title') do begin 547 SubElements.AddString(Title); 495 548 end; 496 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 497 Name := 'meta'; 549 with SubElements.AddTag('meta') do begin 498 550 Attributes.Add('http-equiv', 'Content-Language'); 499 551 Attributes.Add('content', ContentLanguage); 500 552 end; 501 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 502 Name := 'meta'; 553 with SubElements.AddTag('meta') do begin 503 554 Attributes.Add('http-equiv', 'Content-Type'); 504 555 Attributes.Add('content', 'text/html; charset=' + ContentEncoding); 505 556 end; 506 557 for I := 0 to Styles.Count - 1 do 507 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 508 Name := 'link'; 558 with SubElements.AddTag('link') do begin 509 559 Attributes.Add('rel', 'stylesheet'); 510 560 Attributes.Add('href', Styles[I]); … … 513 563 end; 514 564 for I := 0 to Scripts.Count - 1 do 515 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 516 Name := 'script'; 565 with SubElements.AddTag('script') do begin 517 566 ShringEmpty := False; 518 567 Attributes.Add('type', 'text/javascript'); … … 520 569 end; 521 570 end; 522 with TXmlTag(SubElements[SubElements.Add(TXmlTag.Create)]) do begin 523 Name := 'body'; 571 with SubElements.AddTag('body') do begin 524 572 SubElements.Add(Body.AsXmlElement); 525 573 end; 526 574 end; 527 SubElements.Add(HTMLTag);528 575 end; 529 576 end; … … 534 581 begin 535 582 inherited; 536 SubItems := T ListObject.Create;583 SubItems := THtmlElements.Create; 537 584 end; 538 585 539 586 destructor THtmlBlock.Destroy; 540 587 begin 541 SubItems.Free;588 FreeAndNil(SubItems); 542 589 inherited; 543 590 end; … … 555 602 end; 556 603 for I := 0 to SubItems.Count - 1 do 557 SubElements.Add( THtmlElement(SubItems[I]).AsXmlElement);604 SubElements.Add(SubItems[I].AsXmlElement); 558 605 end; 559 606 end; … … 580 627 end; 581 628 582 { TIpAddress } 583 584 procedure TIpAddress.Assign(Source: TPersistent); 585 var 586 I: Integer; 587 begin 588 if Assigned(Source) then begin 589 if Source is TIpAddress then begin 590 for I := 0 to High(Octets) do 591 Octets[I] := TIpAddress(Source).Octets[I]; 592 end else inherited; 593 end else inherited; 594 end; 595 596 function TIpAddress.IsAddressString(Value: string): Boolean; 597 var 598 Parts: TListString; 599 begin 600 Result := True; 601 try 602 Parts := TListString.Create; 603 Parts.Explode(Value, '.', StrToStr); 604 if Parts.Count = 4 then begin 605 if (StrToInt(Parts[3]) < 0) or (StrToInt(Parts[3]) > 255) then Result := False; 606 if (StrToInt(Parts[2]) < 0) or (StrToInt(Parts[2]) > 255) then Result := False; 607 if (StrToInt(Parts[1]) < 0) or (StrToInt(Parts[1]) > 255) then Result := False; 608 if (StrToInt(Parts[0]) < 0) or (StrToInt(Parts[0]) > 255) then Result := False; 609 end else Result := False; 610 finally 611 Parts.Free; 612 end; 613 end; 614 615 function TIpAddress.GetAddrClass: TAddrClass; 616 begin 617 if (Octets[3] and $80) = 0 then Result := acA 618 else begin 619 if (Octets[3] and $40) = 0 then Result := acB 620 else begin 621 if (Octets[3] and $20) = 0 then Result := acC 622 else begin 623 if (Octets[3] and $10) = 0 then Result := acD 624 else Result := acE; 625 end; 626 end; 627 end; 628 end; 629 630 function TIpAddress.GetAsCardinal: Cardinal; 631 begin 632 Result := Octets[0] or (Octets[1] shl 8) or (Octets[2] shl 16) or (Octets[3] shl 24); 633 end; 634 635 function TIpAddress.GetAsString: string; 636 begin 637 Result := IntToStr(Octets[3]) + '.' + IntToStr(Octets[2]) + '.' + 638 IntToStr(Octets[1]) + '.' + IntToStr(Octets[0]); 639 end; 640 641 function TIpAddress.GetBroadcast: Boolean; 642 begin 643 Result := AsCardinal = High(Cardinal); 644 end; 645 646 procedure TIpAddress.SetAsCardinal(const Value: Cardinal); 647 begin 648 Octets[0] := Byte(Value); 649 Octets[1] := Byte(Value shr 8); 650 Octets[2] := Byte(Value shr 16); 651 Octets[3] := Byte(Value shr 24); 652 end; 653 654 procedure TIpAddress.SetAsString(const Value: string); 655 var 656 Parts: TListString; 657 begin 658 try 659 Parts := TListString.Create; 660 Parts.Explode(Value, '.', StrToStr); 661 try 662 // if Length(Parts) = 4 then begin 663 Octets[0] := StrToInt(Parts[3]); 664 Octets[1] := StrToInt(Parts[2]); 665 Octets[2] := StrToInt(Parts[1]); 666 Octets[3] := StrToInt(Parts[0]); 667 // end else raise EConvertError.Create('String to IP address conversion error'); 668 except 669 raise EConvertError.Create(SStringToIPConversionError); 670 end; 671 finally 672 Parts.Free; 673 end; 674 end; 675 676 procedure TIpAddress.SetBroadcast(const Value: Boolean); 677 begin 678 AsCardinal := High(Cardinal); 679 end; 629 { TURL } 680 630 681 631 constructor TURL.Create; … … 686 636 destructor TURL.Destroy; 687 637 begin 688 Host.Free;638 FreeAndNil(Host); 689 639 inherited; 690 640 end; … … 724 674 end; 725 675 726 727 { TDomainAddress }728 729 function TDomainAddress.GetAsString: string;730 begin731 try732 Levels.Reverse;733 Result := Levels.Implode('.', StrToStr);734 finally735 Levels.Reverse;736 end;737 end;738 739 procedure TDomainAddress.SetAsString(const Value: string);740 begin741 Levels.Explode(Value, '.', StrToStr);742 Levels.Reverse;743 end;744 745 constructor TDomainAddress.Create;746 begin747 Levels := TListString.Create;748 end;749 750 destructor TDomainAddress.Destroy;751 begin752 Levels.Free;753 inherited;754 end;755 756 676 { THtmlLink } 757 677 … … 763 683 destructor THtmlLink.Destroy; 764 684 begin 765 Target.Free;685 FreeAndNil(Target); 766 686 inherited; 767 687 end; … … 791 711 end; 792 712 793 { THostAddress }794 795 constructor THostAddress.Create;796 begin797 DomainName := TDomainAddress.Create;798 IpAddress := TIpAddress.Create;799 State := asDomainName;800 DomainName.AsString := 'localhost';801 end;802 803 destructor THostAddress.Destroy;804 begin805 DomainName.Free;806 IpAddress.Free;807 inherited;808 end;809 810 function THostAddress.GetAsString: string;811 begin812 case State of813 asDomainName: Result := DomainName.AsString;814 asIpAddress: Result := IpAddress.AsString;815 end;816 end;817 818 procedure THostAddress.SetAsString(const Value: string);819 begin820 if IpAddress.IsAddressString(Value) then begin821 State := asIpAddress;822 IpAddress.AsString := Value;823 end else begin824 State := asDomainName;825 DomainName.AsString := Value;826 end;827 end;828 829 713 { THtmlImage } 830 714 … … 836 720 destructor THtmlImage.Destroy; 837 721 begin 838 Source.Free;722 FreeAndNil(Source); 839 723 inherited; 840 724 end; … … 889 773 destructor TQueryString.Destroy; 890 774 begin 891 Data.Free;775 FreeAndNil(Data); 892 776 inherited; 893 777 end; -
trunk/Packages/CoolWeb/Common/UXmlClasses.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, StrUtils, SpecializedList, SpecializedDictionary;6 Classes, SysUtils, StrUtils, Generics.Collections, UGenerics; 7 7 8 8 type … … 12 12 public 13 13 property AsString: string read GetAsString; 14 end; 15 16 TXmlTag = class; 17 TXmlString = class; 18 19 { TXmlElements } 20 21 TXmlElements = class(TObjectList<TXmlElement>) 22 function AddTag(Name: string): TXmlTag; 23 function AddString(Text: string): TXmlString; 14 24 end; 15 25 … … 29 39 Name: string; 30 40 Attributes: TDictionaryStringString; 31 SubElements: T ListObject; // TListObject<TXmlElement>;41 SubElements: TXmlElements; 32 42 constructor Create; 33 43 destructor Destroy; override; … … 52 62 implementation 53 63 64 { TXmlElements } 65 66 function TXmlElements.AddTag(Name: string): TXmlTag; 67 begin 68 Result := TXmlTag.Create; 69 Result.Name := Name; 70 Add(Result); 71 end; 72 73 function TXmlElements.AddString(Text: string): TXmlString; 74 begin 75 Result := TXmlString.Create; 76 Result.Text := Text; 77 Add(Result); 78 end; 79 54 80 { THtmlElement } 55 81 … … 58 84 ShringEmpty := True; 59 85 Attributes := TDictionaryStringString.Create; 60 SubElements := T ListObject.Create;86 SubElements := TXmlElements.Create; 61 87 EndTagSymbol := '/'; 62 88 end; … … 64 90 destructor TXmlTag.Destroy; 65 91 begin 66 Attributes.Free;67 SubElements.Free;92 FreeAndNil(Attributes); 93 FreeAndNil(SubElements); 68 94 inherited; 69 95 end; … … 74 100 I: Integer; 75 101 Content: string; 102 Attribute: TPair<string, string>; 76 103 begin 77 104 Content := ''; … … 80 107 81 108 AttributesText := ''; 82 for I := 0 to Attributes.Count - 1do83 AttributesText := AttributesText + ' ' + Attribute s.Keys[I] + '="' + Attributes[I].Value + '"';109 for Attribute in Attributes do 110 AttributesText := AttributesText + ' ' + Attribute.Key + '="' + Attribute.Value + '"'; 84 111 85 112 if Name <> '' then begin … … 123 150 destructor TXmlDocument.Destroy; 124 151 begin 125 Content.Free;126 MainTag.Free;152 FreeAndNil(Content); 153 FreeAndNil(MainTag); 127 154 inherited; 128 155 end; -
trunk/Packages/CoolWeb/CoolWeb.lpk
r132 r138 40 40 <License Value="GNU/GPL"/> 41 41 <Version Minor="3"/> 42 <Files Count="1 8">42 <Files Count="19"> 43 43 <Item1> 44 44 <Filename Value="WebServer/UHTTPServer.pas"/> … … 121 121 <UnitName Value="UWebUser"/> 122 122 </Item18> 123 <Item19> 124 <Filename Value="Common/UIpAddress.pas"/> 125 <UnitName Value="UIpAddress"/> 126 </Item19> 123 127 </Files> 124 128 <CompatibilityMode Value="True"/> 125 <RequiredPkgs Count=" 8">129 <RequiredPkgs Count="7"> 126 130 <Item1> 127 131 <PackageName Value="TurboPowerIProDsgn"/> … … 140 144 </Item5> 141 145 <Item6> 142 <PackageName Value="TemplateGenerics"/> 143 <MaxVersion Minor="3"/> 144 <MinVersion Minor="3" Valid="True"/> 146 <PackageName Value="synapse"/> 145 147 </Item6> 146 148 <Item7> 147 <PackageName Value="synapse"/>148 </Item7>149 <Item8>150 149 <PackageName Value="FCL"/> 151 150 <MinVersion Major="1" Valid="True"/> 152 </Item 8>151 </Item7> 153 152 </RequiredPkgs> 154 153 <UsageOptions> -
trunk/Packages/CoolWeb/CoolWeb.pas
r115 r138 5 5 unit CoolWeb; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9 … … 11 12 UTurboPowerForm, UHTTPSessionFile, UHTTPSessionMySQL, USqlDatabase, 12 13 UTCPServer, UPageList, UHtmlClasses, UMemoryStreamEx, UMIMEType, 13 UXmlClasses, UWebPage, UWebApp, LazIDEReg, UWebUser, LazarusPackageIntf; 14 UXmlClasses, UWebPage, UWebApp, LazIDEReg, UWebUser, UIpAddress, 15 LazarusPackageIntf; 14 16 15 17 implementation -
trunk/Packages/CoolWeb/Modules/UPageList.pas
r137 r138 7 7 8 8 type 9 10 { TPageList } 11 9 12 TPageList = class 10 13 TotalCount: Integer; … … 19 22 Around: Integer; 20 23 constructor Create; 24 destructor Destroy; override; 21 25 function Hyperlink: string; 22 26 function Process: string; … … 33 37 QueryItems.SetStringServer; 34 38 HTMLId := ''; 39 end; 40 41 destructor TPageList.Destroy; 42 begin 43 FreeAndNil(QueryItems); 44 inherited; 35 45 end; 36 46 -
trunk/Packages/CoolWeb/Modules/UWebUser.pas
r137 r138 5 5 uses 6 6 Classes, SysUtils, synacode, USqlDatabase, UCommon, UHTTPServer, 7 SpecializedDictionary;7 UGenerics; 8 8 9 9 const … … 60 60 DbRows: TDbRows; 61 61 Id: Integer; 62 begin 63 try 64 DbRows := TDbRows.Create; 65 if HandlerData.Request.Cookies.SearchKey('SessionId') <> -1 then begin 62 Value: string; 63 begin 64 try 65 DbRows := TDbRows.Create; 66 if HandlerData.Request.Cookies.TryGetValue('SessionId', Value) then begin 66 67 Database.Query(DbRows, 'SELECT * FROM `UserOnline` WHERE `SessionId`="' + 67 HandlerData.Request.Cookies.Values['SessionId']+ '"');68 Value + '"'); 68 69 if DbRows.Count > 0 then begin 69 70 // Update exited 70 Id := StrToInt(DbRows[0]. Values['Id']);71 User := StrToInt(DbRows[0]. Values['User']);71 Id := StrToInt(DbRows[0].Items['Id']); 72 User := StrToInt(DbRows[0].Items['User']); 72 73 Database.Query(DbRows, 'UPDATE `UserOnline` SET `ActivityTime` = NOW() WHERE `Id`=' + IntToStr(Id)); 73 74 end else begin 74 75 // Create new record 75 76 Database.Query(DbRows, 'INSERT INTO `UserOnline` (`User`, `ActivityTime`, `SessionId`, `ScriptName`) ' + 76 'VALUES (1, NOW(), "' + HandlerData.Request.Cookies.Values['SessionId']+ '", "")');77 'VALUES (1, NOW(), "' + Value + '", "")'); 77 78 Id := Database.LastInsertId; 78 79 User := 1; … … 88 89 var 89 90 DbRows: TDbRows; 91 SessionId: string; 90 92 begin 91 93 Logout; 94 if HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then 92 95 try 93 96 DbRows := TDbRows.Create; 94 97 Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = ' + IntToStr(User) + ', `LoginTime` = NOW() WHERE `SessionId`="' + 95 HandlerData.Request.Cookies.Values['SessionId']+ '"');98 SessionId + '"'); 96 99 finally 97 100 DbRows.Free; … … 103 106 var 104 107 DbRows: TDbRows; 108 SessionId: string; 105 109 begin 106 110 if Id = AnonymousUserId then Update; 107 if User <> AnonymousUserId then begin 111 if (User <> AnonymousUserId) and 112 HandlerData.Request.Cookies.TryGetValue('SessionId', SessionId) then begin 108 113 try 109 114 DbRows := TDbRows.Create; 110 115 Database.Query(DbRows, 'UPDATE `UserOnline` SET `User` = ' + IntToStr(AnonymousUserId) + ' WHERE `SessionId`="' + 111 HandlerData.Request.Cookies.Values['SessionId']+ '"');116 SessionId + '"'); 112 117 finally 113 118 DbRows.Free; … … 178 183 DbRows := TDbRows.Create; 179 184 Database.Query(DbRows, 'SELECT `Id` FROM `User` WHERE `Name`="' + Name + '"'); 180 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[ 0].Value)185 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items['Id']) 181 186 else Result := -1; 182 187 finally … … 193 198 Database.Query(DbRows, 'SELECT `Id` FROM `User` WHERE `Name`="' + Name + '" AND ' + 194 199 '`Password` = SHA1(CONCAT("' + Password + '", Salt))'); 195 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[ 0].Value)200 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items['Id']) 196 201 else Result := -1; 197 202 finally … … 208 213 Database.Query(DbRows, 'SELECT * FROM `User` WHERE `Id`="' + IntToStr(Id) + '"'); 209 214 if DbRows.Count = 1 then begin 210 Name := DbRows[0]. Values['Name'];211 FullName := DbRows[0]. Values['FullName'];212 Email := DbRows[0]. Values['Email'];215 Name := DbRows[0].Items['Name']; 216 FullName := DbRows[0].Items['FullName']; 217 Email := DbRows[0].Items['Email']; 213 218 end; // else raise ENotFound.Create(Format(SUserNotFound, [IntToStr(Id)])); 214 219 finally … … 233 238 try 234 239 DbRows2 := TDbRows.Create; 235 OperationId := StrToInt(DbRows[0]. Values['Id']);240 OperationId := StrToInt(DbRows[0].Items['Id']); 236 241 237 242 // Check user-operation relation … … 247 252 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 248 253 if DbRows2.Count > 0 then begin 249 if CheckGroupPermission(StrToInt(DbRows2[0]. Values['AssignedGroup']), OperationId) then begin254 if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), OperationId) then begin 250 255 Result := True; 251 256 Exit; … … 280 285 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 281 286 if DbRows2.Count > 0 then begin 282 if CheckGroupPermission(StrToInt(DbRows2[0]. Values['AssignedGroup']), Operation) then begin287 if CheckGroupPermission(StrToInt(DbRows2[0].Items['AssignedGroup']), Operation) then begin 283 288 Result := True; 284 289 Exit; -
trunk/Packages/CoolWeb/Persistence/USqlDatabase.pas
r137 r138 6 6 7 7 uses 8 SysUtils, Classes, Dialogs, mysql50, TypInfo, SpecializedDictionary, 9 SpecializedList; 8 SysUtils, Classes, Dialogs, mysql50, TypInfo, UGenerics, Generics.Collections; 10 9 11 10 type … … 21 20 TLogEvent = procedure(Sender: TObject; Text: string) of object; 22 21 23 TDbRows = class(TList Object)22 TDbRows = class(TList<TDictionaryStringString>) 24 23 private 25 24 function GetData(Index: Integer): TDictionaryStringString; … … 155 154 TimeParts := TListString.Create; 156 155 157 Parts.Explode( Value, ' ', StrToStr);158 DateParts.Explode( Parts[0], '-', StrToStr);156 Parts.Explode(' ', Value); 157 DateParts.Explode('-', Parts[0]); 159 158 Result := EncodeDate(StrToInt(DateParts[0]), StrToInt(DateParts[1]), 160 159 StrToInt(DateParts[2])); 161 160 if Parts.Count > 1 then begin 162 TimeParts.Explode( Parts[1], ':', StrToStr);161 TimeParts.Explode(':', Parts[1]); 163 162 Result := Result + EncodeTime(StrToInt(TimeParts[0]), StrToInt(TimeParts[1]), 164 163 StrToInt(TimeParts[2]), 0); … … 210 209 Value: string; 211 210 DbResult: TDbRows; 211 Item: TPair<string, string>; 212 212 begin 213 213 LastUsedTable := ATable; 214 214 DbNames := ''; 215 215 DbValues := ''; 216 for I := 0 to Data.Count - 1do begin217 Value := Data.Items[I].Value;216 for Item in Data do begin 217 Value := Item.Value; 218 218 StringReplace(Value, '"', '\"', [rfReplaceAll]); 219 219 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 220 220 else DbValues := DbValues + ',"' + Value + '"'; 221 DbNames := DbNames + ',`' + Data.Keys[I]+ '`';221 DbNames := DbNames + ',`' + Item.Key + '`'; 222 222 end; 223 223 System.Delete(DbNames, 1, 1); … … 274 274 I: Integer; 275 275 DbResult: TDbRows; 276 Item: TPair<string, string>; 276 277 begin 277 278 LastUsedTable := ATable; 278 279 DbNames := ''; 279 280 DbValues := ''; 280 for I := 0 to Data.Count - 1do begin281 Value := Data.Items[I].Value;281 for Item in Data do begin 282 Value := Item.Value; 282 283 StringReplace(Value, '"', '\"', [rfReplaceAll]); 283 284 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 284 285 else DbValues := DbValues + ',"' + Value + '"'; 285 DbNames := DbNames + ',`' + Data.Keys[I]+ '`';286 DbNames := DbNames + ',`' + Item.Key + '`'; 286 287 end; 287 288 System.Delete(DbNames, 1, 1); … … 314 315 I: Integer; 315 316 DbResult: TDbRows; 317 Item: TPair<string, string>; 316 318 begin 317 319 LastUsedTable := ATable; 318 320 DbValues := ''; 319 for I := 0 to Data.Count - 1do begin320 Value := Data.Items[I].Value;321 for Item in Data do begin 322 Value := Item.Value; 321 323 StringReplace(Value, '"', '\"', [rfReplaceAll]); 322 324 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 323 else DbValues := DbValues + ',`' + Data.Keys[I]+ '` =' + '"' + Value + '"';325 else DbValues := DbValues + ',`' + Item.Key + '` =' + '"' + Value + '"'; 324 326 end; 325 327 System.Delete(DbValues, 1, 1); -
trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UCommon, UMemoryStreamEx, UMIMEType, 7 Synautil, SpecializedList, SpecializedDictionary, Syncobjs;6 Classes, SysUtils, UCommon, UMemoryStreamEx, UMIMEType, Synautil, Syncobjs, 7 Generics.Collections, UGenerics; 8 8 9 9 type … … 75 75 { TRequestHandlerList } 76 76 77 TRequestHandlerList = class(T ListObject)77 TRequestHandlerList = class(TObjectList<TRequestHandler>) 78 78 procedure Add(AName: string; AHandler: TRequestEvent); 79 79 function IndexOfName(AName: string): TRequestHandler; … … 131 131 var 132 132 I: Integer; 133 Item: TPair<string, string>; 133 134 begin 134 135 with HandlerData, Response.Content do begin … … 145 146 146 147 WriteString('<h5>Request HTTP headers</h5>'); 147 for I := 0 to Request.Headers.Count - 1 do begin; 148 with Request.Headers.Items[I] do 149 WriteString(Key + ': ' + Value + '<br/>'); 148 for Item in Request.Headers do begin; 149 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 150 150 end; 151 151 152 152 WriteString('<h5>Request HTTP GET</h5>'); 153 for I := 0 to Request.Query.Count - 1 do begin 154 with Request.Query.Items[I] do 155 WriteString(Key + ': ' + Value + '<br/>'); 153 for Item in Request.Query do begin 154 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 156 155 end; 157 156 158 157 WriteString('<h5>Request HTTP cookies</h5>'); 159 158 for I := 0 to Request.Cookies.Count - 1 do begin 160 with Request.Cookies.Items[I] do 161 WriteString(Key + ': ' + Value + '<br/>'); 159 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 162 160 end; 163 161 … … 170 168 171 169 WriteString('<h5>Request HTTP POST</h5>'); 172 for I := 0 to Request.Post.Count - 1 do begin 173 with Request.Post.Items[I] do 174 WriteString(Key + ': ' + Value + '<br/>'); 170 for Item in Request.Post do begin 171 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 175 172 end; 176 173 … … 181 178 WriteString('<h5>Response HTTP headers</h5>'); 182 179 with Response.Content do 183 for I := 0 to Response.Headers.Count - 1 do begin 184 with Response.Headers.Items[I] do 185 WriteString(Key + ': ' + Value + '<br/>'); 180 for Item in Response.Headers do begin 181 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 186 182 end; 187 183 188 184 WriteString('<h5>Response HTTP cookies</h5>'); 189 for I := 0 to Response.Cookies.Count - 1 do begin; 190 with Response.Cookies.Items[I] do 191 WriteString(Key + ': ' + Value + '<br/>'); 185 for Item in Response.Cookies do begin; 186 WriteString(Item.Key + ': ' + Item.Value + '<br/>'); 192 187 end; 193 188 end; … … 197 192 begin 198 193 with HandlerData, Response.Content do begin 199 WriteString('<html><body>' + Format(SPageNotFound, [ Request.Path.Implode('/', StrToStr)]) + '</body></html>');194 WriteString('<html><body>' + Format(SPageNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 200 195 end; 201 196 end; … … 218 213 begin 219 214 with HandlerData do begin 220 FileName := DocumentRoot + DirectorySeparator + Request.Path.Implode('/', StrToStr);215 FileName := DocumentRoot + DirectorySeparator + Implode('/', Request.Path); 221 216 if FileExists(FileName) then begin 222 Response.Headers. Values['Content-Type'] := GetMIMEType(Copy(ExtractFileExt(FileName), 2, 255));217 Response.Headers.Items['Content-Type'] := GetMIMEType(Copy(ExtractFileExt(FileName), 2, 255)); 223 218 try 224 219 BinaryFile := TFileStream.Create(FileName, fmOpenRead); … … 230 225 with Response.Content do begin 231 226 //WriteLn(Format(SFileNotFound, [Request.Path.Implode('/', StrToStr)])); 232 WriteString('<html><body>' + Format(SFileNotFound, [ Request.Path.Implode('/', StrToStr)]) + '</body></html>');227 WriteString('<html><body>' + Format(SFileNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 233 228 end; 234 229 end; … … 357 352 Pair := TListString.Create; 358 353 Clear; 359 Parts.Explode( Text, '&', StrToStr);354 Parts.Explode('&', Text); 360 355 for I := 0 to Parts.Count - 1 do begin 361 Pair.Explode( Parts[I], '=', StrToStr);356 Pair.Explode('=', Parts[I]); 362 357 if Pair.Count >= 2 then 363 358 Add(Pair[0], Pair[1]); … … 371 366 function TQueryParameterList.Syntetize: string; 372 367 var 373 I : Integer;368 Item: TPair<string, string>; 374 369 begin 375 370 Result := ''; 376 for I := 0 to Count - 1do377 Result := Result + '&' + Keys[I] + '=' + Items[I].Value;371 for Item in Self do 372 Result := Result + '&' + Item.Key + '=' + Item.Value; 378 373 Result := Copy(Result, 6, Length(Result)); 379 374 end; … … 391 386 Pair := TListString.Create; 392 387 Clear; 393 Parts.Explode( Text, ';', StrToStr);388 Parts.Explode(';', Text); 394 389 for I := 0 to Parts.Count - 1 do begin 395 Pair.Explode( Parts[I], '=', StrToStr);390 Pair.Explode('=', Parts[I]); 396 391 if Pair.Count >= 2 then 397 392 Add(Trim(Pair[0]), Trim(Pair[1])); … … 405 400 function TCookieList.Syntetize: string; 406 401 var 407 I : Integer;402 Item: TPair<string, string>; 408 403 begin 409 404 Result := ''; 410 for I := 0 to Count - 1do411 Result := Result + '; ' + Keys[I] + '=' + Items[I].Value;405 for Item in Self do 406 Result := Result + '; ' + Item.Key + '=' + Item.Value; 412 407 Result := Copy(Result, 2, Length(Result)); 413 408 end; -
trunk/Packages/CoolWeb/WebServer/UHTTPServerCGI.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UHTTPServer, SpecializedList, IOStream;6 Classes, SysUtils, UHTTPServer, IOStream, Generics.Collections; 7 7 8 8 type … … 54 54 Buffer: string; 55 55 Count: Integer; 56 Item: TPair<string, string>; 56 57 begin 57 58 HandlerData := THTTPHandlerData.Create; … … 96 97 EnvVars.Values['QUERY_STRING'] := Copy(EnvVars.Values['QUERY_STRING'], 1, 97 98 Length(EnvVars.Values['QUERY_STRING']) - 1); 98 Request.Path.Explode( EnvVars.Values['QUERY_STRING'], '/', StrToStr);99 Request.Path.Explode('/', EnvVars.Values['QUERY_STRING']); 99 100 if Pos('?', EnvVars.Values['REQUEST_URI']) > 0 then begin 100 101 Request.Query.Parse(Copy(EnvVars.Values['REQUEST_URI'], … … 129 130 with Response do begin 130 131 // Generate cookies 131 for I := 0 to Cookies.Count - 1do132 Headers.Add('Set-Cookie', Cookies.Keys[I] + '=' + Cookies.Items[I].Value);132 for Item in Cookies do 133 Headers.Add('Set-Cookie', Item.Key + '=' + Item.Value); 133 134 // + ';path=/;expires=' + RFC822DateTime(Now); 134 135 135 136 // Generate headers 136 for I := 0 to Headers.Count - 1do begin137 WriteLn( Headers.Keys[I] + ': ' + Headers.Items[I].Value);137 for Item in Headers do begin 138 WriteLn(Item.Key + ': ' + Item.Value); 138 139 end; 139 140 -
trunk/Packages/CoolWeb/WebServer/UHTTPServerTCP.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UHTTPServer, UTCPServer, SpecializedList, SynaUtil; 6 Classes, SysUtils, UHTTPServer, UTCPServer, SynaUtil, Generics.Collections, 7 UGenerics; 7 8 8 9 type … … 42 43 I: Integer; 43 44 ContentLength: Integer; 45 Value: string; 46 Item: TPair<string, string>; 44 47 begin 45 48 with TTCPClientThread(Sender), Socket do begin … … 60 63 WriteLn(IntToStr(Id) + ' ' + Line); 61 64 if (LineIndex = 0) then begin 62 LineParts.Explode( Line, ' ', StrToStr);65 LineParts.Explode(' ', Line); 63 66 if (LineParts.Count >= 3) then begin 64 67 Request.Method := LineParts[0]; 65 68 if Pos('?', LineParts[1]) > 0 then begin 66 69 Request.Query.Parse(Copy(LineParts[1], Pos('?', LineParts[1]) + 1, Length(LineParts[1]))); 67 Request.Path.Explode( Copy(LineParts[1], 1, Pos('?', LineParts[1]) - 1), '/', StrToStr);70 Request.Path.Explode('/', Copy(LineParts[1], 1, Pos('?', LineParts[1]) - 1)); 68 71 end else begin 69 Request.Path.Explode( LineParts[1], '/', StrToStr);72 Request.Path.Explode('/', LineParts[1]); 70 73 Request.Query.Clear; 71 74 end; … … 75 78 end; 76 79 end else begin 77 LineParts.Explode( Line, ' ', StrToStr, 2);80 LineParts.Explode(' ', Line, 2); 78 81 if (LineParts.Count = 2) and (LineParts[0][Length(LineParts[0])] = ':') then begin 79 82 LineParts[0] := Copy(LineParts[0], 1, Length(LineParts[0]) - 1); 80 83 Request.Headers.Add(LineParts[0], LineParts[1]); 81 //WriteLn(Line);82 84 end; 83 85 end; … … 86 88 87 89 if Request.Method = 'POST' then begin 88 ContentLength := StrToInt(Request.Headers.Values['Content-Length']); 90 if Request.Headers.TryGetValue('Content-Length', Value) then 91 ContentLength := StrToInt(Value); 89 92 SetLength(Line, ContentLength); 90 93 RecvBufferEx(PByte(Line), ContentLength, 1000); … … 96 99 97 100 // Process cookies 98 if Request.Headers. SearchKey('Cookie') <> -1then99 Request.Cookies.Parse( Request.Headers.Values['Cookie']);101 if Request.Headers.TryGetValue('Cookie', Value) then 102 Request.Cookies.Parse(Value); 100 103 101 104 // Load session variables … … 120 123 121 124 // Handle cookies 122 for I := 0 to Cookies.Count - 1do123 Headers.Add('Set-Cookie', Cookies.Keys[I] + '=' + Cookies.Items[I].Value);125 for Item in Cookies do 126 Headers.Add('Set-Cookie', Item.Key + '=' + Item.Value); 124 127 // + ';path=/;expires=' + RFC822DateTime(Now); 125 128 126 129 // Send headers 127 for I := 0 to Headers.Count - 1do begin130 for Item in Headers do begin 128 131 //WriteLn(Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10); 129 SendString( Headers.Keys[I] + ': ' + Headers.Items[I].Value + #13#10);132 SendString(Item.Key + ': ' + Item.Value + #13#10); 130 133 end; 131 134 SendString(#13#10); -
trunk/Packages/CoolWeb/WebServer/UHTTPSessionFile.pas
r137 r138 55 55 56 56 procedure THTTPSessionStorageFile.GetSessionId(HandlerData: THTTPHandlerData); 57 var 58 Value: string; 57 59 begin 58 60 with HandlerData do begin 59 if Request.Cookies. SearchKey(SessionIdCookieName) <> -1then begin60 SessionId := Request.Cookies.Values[SessionIdCookieName];61 if Request.Cookies.TryGetValue(SessionIdCookieName, Value) then begin 62 SessionId := Value; 61 63 end else begin 62 64 SessionId := GetNewSessionId; 63 Response.Cookies. Values[SessionIdCookieName] := SessionId;65 Response.Cookies.Items[SessionIdCookieName] := SessionId; 64 66 end; 65 67 end; … … 96 98 end else raise Exception.Create(SCantCreateSessionStorageDirectory); 97 99 98 HandlerData.Response.Cookies. Values[SessionIdCookieName] := HandlerData.SessionId;100 HandlerData.Response.Cookies.Items[SessionIdCookieName] := HandlerData.SessionId; 99 101 finally 100 102 Lock.Release; -
trunk/Packages/CoolWeb/WebServer/UHTTPSessionMySQL.pas
r137 r138 64 64 65 65 procedure THTTPSessionStorageMySQL.GetSessionId(HandlerData: THTTPHandlerData); 66 var 67 Value: string; 66 68 begin 67 69 with HandlerData do begin 68 if Request.Cookies. SearchKey(SessionIdCookieName) <> -1then begin69 SessionId := Request.Cookies.Values[SessionIdCookieName];70 if Request.Cookies.TryGetValue(SessionIdCookieName, Value) then begin 71 SessionId := Value; 70 72 end else begin 71 73 SessionId := GetNewSessionId; … … 87 89 HandlerData.SessionId + '"'); 88 90 if DbRows.Count > 0 then begin 89 HandlerData.Session.Text := DbRows[0]. Values['Variables'];91 HandlerData.Session.Text := DbRows[0].Items['Variables']; 90 92 end else begin 91 93 HandlerData.SessionId := GetNewSessionId; … … 114 116 else Database.Query(DbRows2, 'INSERT INTO `HTTPSession` (`Time`, `Variables`, `Identification`) VALUES (' + 115 117 'NOW(), "' + HandlerData.Session.Text + '", "' + HandlerData.SessionId + '")'); 116 HandlerData.Response.Cookies. Values[SessionIdCookieName] := HandlerData.SessionId;118 HandlerData.Response.Cookies.Items[SessionIdCookieName] := HandlerData.SessionId; 117 119 finally 118 120 DbRows2.Free; -
trunk/Packages/PersistentData/Backend/UPDClientMemory.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UPDClient, SpecializedList;6 Classes, SysUtils, UPDClient, Generics.Collections; 7 7 8 8 type … … 19 19 function SearchObject(Id: Integer): TObjectProxy; 20 20 public 21 Objects: T ListObject;21 Objects: TObjectList<TObjectProxy>; 22 22 procedure ObjectLoad(AObject: TObjectProxy); override; 23 23 procedure ObjectSave(AObject: TObjectProxy); override; … … 96 96 else begin 97 97 AObject.Id := GetNewObjectId; 98 Obj := TObjectProxy(Objects.Add New(TObjectProxy.Create));98 Obj := TObjectProxy(Objects.Add(TObjectProxy.Create)); 99 99 Obj.Assign(AObject); 100 100 end; … … 118 118 NewObject: TObjectProxy; 119 119 Table: string; 120 Item: TPair<string, string>; 120 121 begin 121 122 AList.Objects.Clear; … … 131 132 132 133 if AList.ColummsFilterUse then begin 133 for P := 0 to Properties.Count - 1do134 if AList.ColumnsFilter.IndexOf( Properties.Keys[I]) <> -1 then135 NewObject.Properties.Add( Properties.Keys[I], Properties[I].Value);134 for Item in Properties do 135 if AList.ColumnsFilter.IndexOf(Item.Key) <> -1 then 136 NewObject.Properties.Add(Item.Key, Item.Value); 136 137 end else NewObject.Properties.Assign(Properties); 137 138 end; … … 172 173 begin 173 174 inherited; 174 Objects := T ListObject.Create;175 Objects := TObjectList<TObjectProxy>.Create; 175 176 BackendName := 'Memory'; 176 177 end; -
trunk/Packages/PersistentData/Backend/UPDClientMySQL.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, USqlDatabase, UPDClient, SpecializedDictionary;6 Classes, SysUtils, USqlDatabase, UPDClient, UGenerics; 7 7 8 8 type -
trunk/Packages/PersistentData/PersistentData.lpk
r87 r138 1 <?xml version="1.0" ?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="PersistentData"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <Author Value="Chronos"/> 7 8 <CompilerOptions> … … 12 13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 13 14 </SearchPaths> 15 <Parsing> 16 <SyntaxOptions> 17 <SyntaxMode Value="Delphi"/> 18 <CStyleOperator Value="False"/> 19 <AllowLabel Value="False"/> 20 <CPPInline Value="False"/> 21 </SyntaxOptions> 22 </Parsing> 14 23 <CodeGeneration> 15 24 <Checks> … … 20 29 </Checks> 21 30 </CodeGeneration> 22 <Other>23 <CompilerMessages>24 <MsgFileName Value=""/>25 </CompilerMessages>26 <CompilerPath Value="$(CompPath)"/>27 </Other>28 31 </CompilerOptions> 29 32 <Description Value="Generic data persistence layer"/> … … 65 68 </Item8> 66 69 </Files> 67 < Type Value="RunAndDesignTime"/>70 <CompatibilityMode Value="True"/> 68 71 <RequiredPkgs Count="2"> 69 72 <Item1> -
trunk/Packages/PersistentData/UPDClient.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, SpecializedList, SpecializedDictionary;6 Classes, SysUtils, Generics.Collections, UGenerics; 7 7 8 8 const … … 57 57 ObjectName: string; 58 58 Path: string; 59 Objects: T ListObject; // TListObject<TObjectProxy>59 Objects: TObjectList<TObjectProxy>; 60 60 procedure Clear; 61 61 constructor Create; … … 74 74 { TPDTypePropertyList } 75 75 76 TPDTypePropertyList = class(T ListObject)76 TPDTypePropertyList = class(TObjectList<TPDTypeProperty>) 77 77 Client: TPDClient; 78 78 procedure AddSimple(Name: string; TypeName: string; Unique: Boolean = False; … … 100 100 { TPDTypeList } 101 101 102 TPDTypeList = class(T ListObject)102 TPDTypeList = class(TObjectList<TPDType>) 103 103 Client: TPDClient; 104 104 function AddType(Name: string; DbType: string = ''): TPDType; … … 147 147 TPDClientClass = class of TPDClient; 148 148 149 150 151 152 153 149 resourcestring 150 SClientNotSet = 'Client not set'; 151 SNotSupported = 'Not supported'; 152 SVersionMismatch = 'Version mismatch, client: %0:s, server: %1:s. Please upgrade database.'; 153 SCantLoadObjectWithoutId = 'Can''t load object without id'; 154 154 155 155 … … 163 163 NewProperty: TPDTypeProperty; 164 164 begin 165 NewProperty := TPDTypeProperty(Add New(TPDTypeProperty.Create));165 NewProperty := TPDTypeProperty(Add(TPDTypeProperty.Create)); 166 166 NewProperty.Name := Name; 167 167 NewProperty.DbType := Client.Types.SearchByName(TypeName); … … 175 175 function TPDTypeList.AddType(Name: string; DbType: string = ''): TPDType; 176 176 begin 177 Result := TPDType(Add New(TPDType.Create));177 Result := TPDType(Add(TPDType.Create)); 178 178 Result.Client := Client; 179 179 Result.Name := Name; … … 280 280 begin 281 281 ColumnsFilter := TListString.Create; 282 Objects := T ListObject.Create;282 Objects := TObjectList<TObjectProxy>.Create; 283 283 end; 284 284 … … 345 345 NewObject.Load; 346 346 347 DbVersion := NewObject.Properties. Values['Version'];347 DbVersion := NewObject.Properties.Items['Version']; 348 348 if Version <> DbVersion then 349 349 raise Exception.Create(Format(SVersionMismatch, [Version, DbVersion])); … … 395 395 Tables.Count := NewProxy.Objects.Count; 396 396 for I := 0 to NewProxy.Objects.Count - 1 do 397 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties. Values['TABLE_NAME'];397 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Items['TABLE_NAME']; 398 398 399 399 for I := 0 to Types.Count - 1 do -
trunk/Packages/PersistentData/UPersistentData.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UPDClient, SpecializedList;6 Classes, SysUtils, UPDClient, Generics.Collections; 7 7 8 8 type … … 16 16 TPDManager = class(TComponent) 17 17 public 18 Items: T ListObject;18 Items: TObjectList<TPDManagerItem>; 19 19 procedure Register(ClientClass: TPDClientClass); 20 20 procedure LoadToStrings(Strings: TStrings); … … 76 76 begin 77 77 inherited; 78 Items := T ListObject.Create;78 Items := TObjectList<TPDManagerItem>.Create; 79 79 end; 80 80 -
trunk/Pages/UPageAdmin.pas
r137 r138 61 61 begin 62 62 with TWebSession(HandlerData) do begin 63 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin63 with HtmlDocument.Body, SubItems.AddString do begin 64 64 TModuleSystem(ModuleManager.FindModuleByName('System')).UpdateModuleList; 65 65 Text := 'Seznam modulů synchronizován'; … … 76 76 begin 77 77 with TWebSession(HandlerData) do begin 78 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin78 with HtmlDocument.Body, SubItems.AddString do begin 79 79 Text := Text + '<strong>Registred modules:</strong><br/>' + 80 80 '<table class="WideTable"><tr><th>Name</th><th>Installed</th><th>Title</th><th>Version</th>' + … … 99 99 ModuleName: string; 100 100 Module: TModule; 101 Name: string; 101 102 begin 102 103 with TWebSession(HandlerData) do begin 103 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin104 if Request.Query. SearchKey('name') <> -1then begin105 ModuleName := Request.Query.Values['name'];104 with HtmlDocument.Body, SubItems.AddString do begin 105 if Request.Query.TryGetValue('name', Name) then begin 106 ModuleName := Name; 106 107 Module := ModuleManager.FindModuleByName(ModuleName); 107 108 if Assigned(Module) then begin … … 121 122 ModuleName: string; 122 123 Module: TModule; 124 Name: string; 123 125 begin 124 126 with TWebSession(HandlerData) do begin 125 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin126 if Request.Query. SearchKey('name') <> -1then begin127 ModuleName := Request.Query.Values['name'];127 with HtmlDocument.Body, SubItems.AddString do begin 128 if Request.Query.TryGetValue('name', Name) then begin 129 ModuleName := Name; 128 130 Module := ModuleManager.FindModuleByName(ModuleName); 129 131 if Assigned(Module) then begin -
trunk/ZdechovNET.lpi
r137 r138 93 93 </Modes> 94 94 </RunParams> 95 <RequiredPackages Count=" 7">95 <RequiredPackages Count="6"> 96 96 <Item1> 97 97 <PackageName Value="ModularSystem"/> … … 103 103 </Item2> 104 104 <Item3> 105 <PackageName Value=" TemplateGenerics"/>106 <DefaultFilename Value="Packages/ TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>105 <PackageName Value="CoolWeb"/> 106 <DefaultFilename Value="Packages/CoolWeb/CoolWeb.lpk" Prefer="True"/> 107 107 </Item3> 108 108 <Item4> 109 <PackageName Value="Co olWeb"/>110 <DefaultFilename Value="Packages/Co olWeb/CoolWeb.lpk" Prefer="True"/>109 <PackageName Value="Common"/> 110 <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/> 111 111 </Item4> 112 112 <Item5> 113 <PackageName Value=" Common"/>114 <DefaultFilename Value="Packages/ Common/Common.lpk" Prefer="True"/>113 <PackageName Value="synapse"/> 114 <DefaultFilename Value="Packages/synapse/synapse.lpk" Prefer="True"/> 115 115 </Item5> 116 116 <Item6> 117 <PackageName Value="synapse"/> 118 <DefaultFilename Value="Packages/synapse/synapse.lpk" Prefer="True"/> 117 <PackageName Value="LCL"/> 119 118 </Item6> 120 <Item7>121 <PackageName Value="LCL"/>122 </Item7>123 119 </RequiredPackages> 124 120 <Units Count="40">
Note:
See TracChangeset
for help on using the changeset viewer.