Changeset 138 for trunk/Modules
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- Location:
- trunk/Modules
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.