Changeset 132
- Timestamp:
- Mar 18, 2022, 3:47:27 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UWebObjects.pas
r130 r132 6 6 7 7 uses 8 Classes, SysUtils, UHtmlClasses, UXmlClasses, Specialized List, SpecializedDictionary;8 Classes, SysUtils, UHtmlClasses, UXmlClasses, SpecializedDictionary, fgl; 9 9 10 10 type 11 TListView = class12 13 end;14 15 11 TQueryFormItemType = (fitText, fitComboBox, fitRadioButton, fitSelect, fitPassword, 16 12 fitSubmit, fitReset, fitHidden, fitFileSelect, fitButton, fitCheckBox, fitTextArea); … … 38 34 { TQueryFormItemList } 39 35 40 TQueryFormItemList = class(T ListObject)36 TQueryFormItemList = class(TFPGObjectList<TQueryFormItem>) 41 37 function FindByName(AValue: string): TQueryFormItem; 42 38 end; … … 53 49 end; 54 50 51 TQueryFormGroups = class(TFPGObjectList<TQueryFormGroup>) 52 end; 53 55 54 TQueryAction = class 56 55 Caption: string; 57 56 Action: string; 57 end; 58 59 TQueryActions = class(TFPGObjectList<TQueryAction>) 58 60 end; 59 61 … … 63 65 public 64 66 Title: string; 65 Groups: T ListObject; // TListObject<TQueryFormGroup>66 Actions: T ListObject; // TListObject<TQueryAction>67 Groups: TQueryFormGroups; 68 Actions: TQueryActions; 67 69 ClassId: string; 68 70 function AddNewGroup: TQueryFormGroup; … … 72 74 destructor Destroy; override; 73 75 end; 76 74 77 75 78 implementation … … 122 125 destructor TQueryFormItem.Destroy; 123 126 begin 124 Value.Free;125 inherited Destroy;127 FreeAndNil(Value); 128 inherited; 126 129 end; 127 130 … … 189 192 function TQueryForm.AddNewGroup: TQueryFormGroup; 190 193 begin 191 Result := TQueryFormGroup(Groups.AddNew(TQueryFormGroup.Create)); 194 Result := TQueryFormGroup.Create; 195 Groups.Add(Result); 192 196 end; 193 197 194 198 function TQueryForm.AddNewAction(Caption, Action: string): TQueryAction; 195 199 begin 196 Result := TQueryAction (Actions.AddNew(TQueryAction.Create));200 Result := TQueryAction.Create; 197 201 Result.Caption := Caption; 198 202 Result.Action := Action; 203 Actions.Add(Result); 199 204 end; 200 205 … … 210 215 begin 211 216 inherited; 212 Actions := T ListObject.Create;213 Groups := T ListObject.Create;217 Actions := TQueryActions.Create; 218 Groups := TQueryFormGroups.Create; 214 219 Method := 'post'; 215 220 Action.AsString := ''; … … 218 223 destructor TQueryForm.Destroy; 219 224 begin 220 Actions.Free;221 Groups.Free;222 inherited Destroy;225 FreeAndNil(Actions); 226 FreeAndNil(Groups); 227 inherited; 223 228 end; 224 229 … … 238 243 function TQueryFormGroup.AddNewItem: TQueryFormItem; 239 244 begin 240 Result := TQueryFormItem(Rows.AddNew(TQueryFormItem.Create)); 245 Result := TQueryFormItem.Create; 246 Rows.Add(Result); 241 247 end; 242 248 … … 248 254 destructor TQueryFormGroup.Destroy; 249 255 begin 250 Rows.Free;251 inherited Destroy;256 FreeAndNil(Rows); 257 inherited; 252 258 end; 253 259 -
trunk/Modules/Finance/UModuleFinance.pas
r105 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary,UModuleBase,8 Classes, SysUtils, UModularSystem, UModuleBase, 9 9 UWebPage; 10 10 … … 73 73 var 74 74 DbRows: TDbRows; 75 Data: TDictionaryStringString;76 75 begin 77 76 try 78 77 DbRows := TDbRows.Create; 79 Data := TDictionaryStringString.Create;80 78 81 79 Core.CommonDatabase.Query(DbRows, … … 144 142 145 143 finally 146 Data.Free;147 144 DbRows.Free; 148 145 end; -
trunk/Modules/Network/UModuleNetwork.pas
r105 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary,UModuleBase,8 Classes, SysUtils, UModularSystem, UModuleBase, 9 9 UWebPage; 10 10 … … 73 73 var 74 74 DbRows: TDbRows; 75 Data: TDictionaryStringString;76 75 begin 77 76 try 78 77 DbRows := TDbRows.Create; 79 Data := TDictionaryStringString.Create;80 78 81 79 Core.CommonDatabase.Query(DbRows, … … 151 149 152 150 finally 153 Data.Free;154 151 DbRows.Free; 155 152 end; 156 inherited Install;153 inherited; 157 154 end; 158 155 -
trunk/Modules/News/UNews.pas
r107 r132 6 6 7 7 uses 8 Classes, SysUtils, SpecializedList, USqlDatabase, UModuleUser, UUtils,9 U WebSession, UHTTPServer, UModuleBase;8 Classes, SysUtils, USqlDatabase, UModuleUser, UUtils, fgl, UWebSession, 9 UHTTPServer, UModuleBase, SpecializedList; 10 10 11 11 type … … 19 19 end; 20 20 21 TNewsSettingItems = class(TFPGObjectList<TNewsSettingItem>) 22 end; 23 21 24 { TNews } 22 25 … … 26 29 UploadedFilesFolder: string; // = 'aktuality/uploads/'; 27 30 public 28 Settings: T ListObject; // TListObject<TNewsSettingItem>31 Settings: TNewsSettingItems; 29 32 Database: TSqlDatabase; 30 33 ModuleUser: TModuleUser; … … 152 155 constructor TNews.Create; 153 156 begin 154 inherited Create;155 Settings := T ListObject.Create;157 inherited; 158 Settings := TNewsSettingItems.Create; 156 159 end; 157 160 … … 159 162 begin 160 163 FreeAndNil(Settings); 161 inherited Destroy;164 inherited; 162 165 end; 163 166 -
trunk/Modules/Portal/UModulePortal.pas
r130 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary,USqlDatabase,8 Classes, SysUtils, UModularSystem, USqlDatabase, 9 9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses, 10 10 UModuleBase, UModuleUser, UModuleNews; … … 85 85 var 86 86 DbRows: TDbRows; 87 Data: TDictionaryStringString;88 87 begin 89 88 try 90 89 DbRows := TDbRows.Create; 91 Data := TDictionaryStringString.Create;92 90 93 91 Core.CommonDatabase.Query(DbRows, … … 140 138 141 139 finally 142 Data.Free;143 140 DbRows.Free; 144 141 end; 145 inherited Install;142 inherited; 146 143 end; 147 144 -
trunk/Modules/Portal/UPagePortal.pas
r114 r132 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils, 9 SpecializedDictionary, UWebSession, SpecializedList, UHtmlClasses,10 UModul arSystem, UModuleUser, UModuleNews;9 SpecializedDictionary, UWebSession, UHtmlClasses, UModularSystem, UModuleUser, 10 UModuleNews; 11 11 12 12 type … … 18 18 private 19 19 Session: TWebSession; 20 function ShowPanel(Title, Content: string; Menu: T ListString= nil): string;20 function ShowPanel(Title, Content: string; Menu: TStrings = nil): string; 21 21 function SystemMessage(Title, Text: string): string; 22 22 function ShowLinks(GroupId: Integer): string; … … 283 283 end; 284 284 285 function TWebPagePortal.ShowPanel(Title, Content: string; Menu: T ListString): string;285 function TWebPagePortal.ShowPanel(Title, Content: string; Menu: TStrings): string; 286 286 var 287 287 I: Integer; -
trunk/Modules/TV/UModuleTV.pas
r105 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, 9 UWebPage; 8 Classes, SysUtils, UModularSystem, UModuleBase, UWebPage; 10 9 11 10 type … … 72 71 var 73 72 DbRows: TDbRows; 74 Data: TDictionaryStringString;75 73 begin 76 74 try 77 75 DbRows := TDbRows.Create; 78 Data := TDictionaryStringString.Create;79 76 80 77 Core.CommonDatabase.Query(DbRows, … … 95 92 96 93 finally 97 Data.Free;98 94 DbRows.Free; 99 95 end; -
trunk/Modules/User/UModuleUser.pas
r108 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UUser, 9 UModuleBase, UWebPage; 8 Classes, SysUtils, UModularSystem, UUser, UModuleBase, UWebPage; 10 9 11 10 type … … 83 82 var 84 83 DbRows: TDbRows; 85 Data: TDictionaryStringString;86 84 begin 87 85 try 88 86 DbRows := TDbRows.Create; 89 Data := TDictionaryStringString.Create;90 87 91 88 Core.CommonDatabase.Query(DbRows, … … 171 168 ' ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `permissiongroup` (`Id`),' + 172 169 ' ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `permissionoperation` (`Id`);'); 173 174 175 170 finally 176 Data.Free;177 171 DbRows.Free; 178 172 end; 179 inherited Install;173 inherited; 180 174 end; 181 175 … … 184 178 DbRows: TDbRows; 185 179 begin 186 inherited Uninstall;180 inherited; 187 181 try 188 182 DbRows := TDbRows.Create; -
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r119 r132 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary,UWebPage,8 Classes, SysUtils, UModularSystem, UWebPage, 9 9 UWebSession, DateUtils, UModuleBase, UModuleUser, UIPTVPage, 10 10 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, … … 69 69 destructor TModuleZdechovNET.Destroy; 70 70 begin 71 inherited Destroy;71 inherited; 72 72 end; 73 73 … … 167 167 var 168 168 DbRows: TDbRows; 169 Data: TDictionaryStringString;170 169 begin 171 170 try 172 171 DbRows := TDbRows.Create; 173 Data := TDictionaryStringString.Create;174 172 175 173 Core.CommonDatabase.Query(DbRows, … … 235 233 236 234 finally 237 Data.Free;238 235 DbRows.Free; 239 236 end; 240 237 241 inherited Install;238 inherited; 242 239 end; 243 240 … … 246 243 DbRows: TDbRows; 247 244 begin 248 inherited Uninstall;245 inherited; 249 246 ModuleBase.GeneratePage := nil; 250 247 try … … 377 374 end; 378 375 379 380 376 end. 381 377 -
trunk/Packages/CoolWeb/CoolWeb.lpk
r114 r132 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 <Package Version=" 4">3 <Package Version="5"> 4 4 <Name Value="CoolWeb"/> 5 5 <Type Value="RunAndDesignTime"/> … … 11 11 <IncludeFiles Value="WebServer"/> 12 12 <OtherUnitFiles Value="WebServer;Persistence;Network;Modules;Common;/usr/lib/mysql/;/usr/lib64/mysql/"/> 13 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS) "/>13 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 14 14 </SearchPaths> 15 15 <Parsing> 16 16 <SyntaxOptions> 17 17 <SyntaxMode Value="Delphi"/> 18 <CStyleOperator Value="False"/> 19 <AllowLabel Value="False"/> 20 <CPPInline Value="False"/> 18 21 </SyntaxOptions> 19 22 </Parsing> 23 <CodeGeneration> 24 <Optimizations> 25 <OptimizationLevel Value="0"/> 26 </Optimizations> 27 </CodeGeneration> 28 <Linking> 29 <Debugging> 30 <GenerateDebugInfo Value="False"/> 31 </Debugging> 32 </Linking> 33 <Other> 34 <CompilerMessages> 35 <IgnoredMessages idx6058="True" idx3124="True" idx3123="True"/> 36 </CompilerMessages> 37 </Other> 20 38 </CompilerOptions> 21 39 <Description Value="Unit set for generating CGI or server web application."/> … … 104 122 </Item18> 105 123 </Files> 124 <CompatibilityMode Value="True"/> 106 125 <RequiredPkgs Count="8"> 107 126 <Item1> -
trunk/Packages/CoolWeb/LazIDEReg.pas
r84 r132 39 39 CGIAppDescriptor: TCGIApplicationDescriptor; 40 40 41 procedure Register; 41 42 42 procedure Register;43 43 44 44 implementation … … 100 100 function TCGIApplicationDescriptor.InitProject(AProject: TLazProject): TModalResult; 101 101 var 102 le: string;103 102 NewSource: TStringList; 104 103 MainFile: TLazProjectFile; -
trunk/Packages/CoolWeb/Modules/UWebUser.pas
r114 r132 267 267 Result := False; 268 268 try 269 DbRows2 := TDbRows.Create; 270 271 // Check group-operation relation 272 Database.Select(DbRows2, 'PermissionGroupAssignment', 'Id', 273 '`User` = ' + IntToStr(Id) + ' AND `AssignedOperation` = ' + IntToStr(Operation)); 274 if DbRows2.Count > 0 then begin 269 DbRows2 := TDbRows.Create; 270 271 // Check group-operation relation 272 Database.Select(DbRows2, 'PermissionGroupAssignment', 'Id', 273 '`User` = ' + IntToStr(Id) + ' AND `AssignedOperation` = ' + IntToStr(Operation)); 274 if DbRows2.Count > 0 then begin 275 Result := True; 276 Exit; 277 end; 278 279 // Check group-group relation 280 Database.Select(DbRows2, 'PermissionGroupAssignment', 'AssignedGroup', 281 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 282 if DbRows2.Count > 0 then begin 283 if CheckGroupPermission(StrToInt(DbRows2[0].Values['AssignedGroup']), Operation) then begin 275 284 Result := True; 276 285 Exit; 277 286 end; 278 279 // Check group-group relation 280 Database.Select(DbRows2, 'PermissionGroupAssignment', 'AssignedGroup', 281 '`User` = ' + IntToStr(Id) + ' AND `AssignedGroup` IS NOT NULL'); 282 if DbRows2.Count > 0 then begin 283 if CheckGroupPermission(StrToInt(DbRows2[0].Values['AssignedGroup']), Operation) then begin 284 Result := True; 285 Exit; 286 end; 287 end; 288 finally 289 DbRows2.Free; 290 end; 287 end; 288 finally 289 DbRows2.Free; 290 end; 291 291 end; 292 292 -
trunk/Packages/CoolWeb/WebServer/UWebApp.pas
r108 r132 6 6 7 7 uses 8 Classes, SysUtils, CustApp, SpecializedList,UWebPage, UHTTPSessionFile,9 UHTTPServer, Forms, FileUtil ;8 Classes, SysUtils, UWebPage, UHTTPSessionFile, 9 UHTTPServer, Forms, FileUtil, fgl; 10 10 11 11 type … … 22 22 { TPageList } 23 23 24 TPageList = class(T ListObject)24 TPageList = class(TFPGObjectList<TRegistredPage>) 25 25 RootDir: string; 26 26 function FindByPage(Page: TWebPage): TRegistredPage; … … 29 29 procedure UnregisterPage(Page: TWebPage); 30 30 function ProducePage(HandlerData: THTTPHandlerData): Boolean; 31 constructor Create ; override;31 constructor Create(FreeObjects: Boolean = True); 32 32 end; 33 33 … … 64 64 UHTTPServerCGI, UHTTPServerTCP, UHTTPServerTurboPower; 65 65 66 67 66 procedure Register; 68 67 begin … … 77 76 end; 78 77 79 80 78 { TPageList } 81 79 … … 85 83 begin 86 84 I := 0; 87 while (I < Count) and ( TRegistredPage(Items[I]).Page <> Page) do Inc(I);88 if I < Count then Result := TRegistredPage(Items[I])85 while (I < Count) and (Items[I].Page <> Page) do Inc(I); 86 if I < Count then Result := Items[I] 89 87 else Result := nil; 90 88 end; … … 95 93 begin 96 94 I := 0; 97 while (I < Count) and ( TRegistredPage(Items[I]).Name <> Name) do Inc(I);98 if I < Count then Result := TRegistredPage(Items[I])95 while (I < Count) and (Items[I].Name <> Name) do Inc(I); 96 if I < Count then Result := Items[I] 99 97 else Result := nil; 100 98 end; … … 132 130 var 133 131 NewPage: TRegistredPage; 134 Instance: TWebPage; 135 begin 136 NewPage := TRegistredPage(AddNew(TRegistredPage.Create)); 132 begin 133 NewPage := TRegistredPage.Create; 137 134 // NewPage.Page := PageClass.Create(Self); 138 135 NewPage.Page := Page; 139 136 NewPage.Name := Path; 137 Add(NewPage); 140 138 end; 141 139 … … 166 164 constructor TPageList.Create; 167 165 begin 168 inherited Create;169 OwnsObjects := False;166 inherited; 167 FreeObjects := False; 170 168 end; 171 169 … … 212 210 constructor TWebApp.Create(AOwner: TComponent); 213 211 begin 214 inherited Create(AOwner);212 inherited; 215 213 HTTPServer := THTTPServerCGI.Create(nil); 216 214 HTTPServer.OnRequest := HTTPServerRequest; … … 219 217 destructor TWebApp.Destroy; 220 218 begin 221 HTTPServer.Free;222 inherited Destroy;219 FreeAndNil(HTTPServer); 220 inherited; 223 221 end; 224 222 -
trunk/Packages/ModularSystem/ModularSystem.lpk
r105 r132 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="ModularSystem"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <Author Value="Chronos (robie@centrum.cz)"/> 7 8 <CompilerOptions> … … 9 10 <PathDelim Value="\"/> 10 11 <SearchPaths> 11 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) "/>12 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 12 13 </SearchPaths> 14 <Parsing> 15 <SyntaxOptions> 16 <CStyleOperator Value="False"/> 17 <AllowLabel Value="False"/> 18 <CPPInline Value="False"/> 19 </SyntaxOptions> 20 </Parsing> 21 <CodeGeneration> 22 <Optimizations> 23 <OptimizationLevel Value="0"/> 24 </Optimizations> 25 </CodeGeneration> 26 <Linking> 27 <Debugging> 28 <GenerateDebugInfo Value="False"/> 29 </Debugging> 30 </Linking> 13 31 <Other> 14 32 <CompilerMessages> 15 < MsgFileName Value=""/>33 <IgnoredMessages idx6058="True" idx3124="True" idx3123="True"/> 16 34 </CompilerMessages> 17 <CompilerPath Value="$(CompPath)"/>18 35 </Other> 19 36 </CompilerOptions> … … 28 45 </Item1> 29 46 </Files> 47 <CompatibilityMode Value="True"/> 30 48 <i18n> 31 49 <EnableI18N Value="True"/> … … 33 51 <EnableI18NForLFM Value="True"/> 34 52 </i18n> 35 <Type Value="RunAndDesignTime"/>36 53 <RequiredPkgs Count="2"> 37 54 <Item1> -
trunk/Packages/ModularSystem/UModularSystem.pas
r105 r132 6 6 7 7 uses 8 Classes, SysUtils, Contnrs, URegistry;8 Classes, SysUtils, fgl, URegistry; 9 9 10 10 type … … 12 12 13 13 TAPI = class(TComponent) 14 15 14 end; 16 15 … … 66 65 end; 67 66 67 TModules = class(TFPGObjectList<TModule>) 68 end; 69 68 70 TModuleEvent = procedure (Sender: TObject; Module: TModule) of object; 69 71 … … 76 78 procedure SetAPI(AValue: TAPI); 77 79 public 78 Modules: T ObjectList; // TObjectList<TModule>80 Modules: TModules; 79 81 function FindModuleByName(Name: string): TModule; 80 82 function ModuleRunning(Name: string): Boolean; … … 310 312 begin 311 313 inherited; 312 Modules := T ObjectList.Create;314 Modules := TModules.Create; 313 315 //Modules.OwnsObjects := False; 314 316 end; -
trunk/UCore.pas
r123 r132 9 9 UHTTPServer, USqlDatabase, INIFiles, DateUtils, UWebPage, UWebApp, 10 10 UXmlClasses, UHtmlClasses, UUtils, UApplicationInfo, UHTTPServerTCP, 11 UHTTPSessionFile, UUser, SpecializedList, Registry, 12 UModularSystem, UWebSession, LazUTF8; 11 UHTTPSessionFile, UUser, Registry, UModularSystem, UWebSession, LazUTF8; 13 12 14 13 const -
trunk/ZdechovNET.lpi
r130 r132 73 73 <SharedMatrixOptions Count="3"> 74 74 <Item1 ID="999041476570" Modes="Release,Debug" Type="IDEMacro" MacroName="LCLWidgetType" Value="nogui"/> 75 <Item2 ID="896442313085" Targets="Common " Modes="Debug" Value="-g -gl -gh -CirotR -O1"/>76 <Item3 ID="926538202016" Targets="Common " Modes="Release" Value="-CX -XX -O3"/>75 <Item2 ID="896442313085" Targets="Common,CoolWeb,ModularSystem" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/> 76 <Item3 ID="926538202016" Targets="Common,CoolWeb,ModularSystem" Modes="Release" Value="-CX -XX -O3"/> 77 77 </SharedMatrixOptions> 78 78 </BuildModes> -
trunk/ZdechovNET.lpr
r123 r132 7 7 cthreads, clocale, 8 8 {$ENDIF} 9 UUtils, USqlDatabase, SysUtils, Contnrs,Forms,9 UUtils, USqlDatabase, SysUtils, Forms, 10 10 UUser, UHTTPSessionMySQL, UHTTPSessionFile, Printers, 11 11 UCommon, UHTTPServer, UHTTPServerTCP, UHTTPServerCGI, UTCPServer, UPool,
Note:
See TracChangeset
for help on using the changeset viewer.