Changeset 105 for trunk/Modules
- Timestamp:
- Oct 9, 2012, 1:58:45 PM (12 years ago)
- Location:
- trunk/Modules
- Files:
-
- 4 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/UModuleFinance.pas
r101 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, 9 UWebPage; 9 10 10 11 type … … 13 14 14 15 TModuleFinance = class(TModule) 16 private 17 WebPageFinance: TWebPage; 15 18 public 19 ModuleBase: TModuleBase; 16 20 constructor Create(Owner: TComponent); override; 17 21 destructor Destroy; override; … … 39 43 License := 'GNU/LGPL v3'; 40 44 Author := 'Chronosoft'; 45 Dependencies.Add('Base'); 41 46 end; 42 47 … … 48 53 procedure TModuleFinance.Start; 49 54 begin 50 Core.Pages.RegisterPage(TWebPageFinance, WebPageFinance, 'finance'); 55 BeforeStart; 56 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 57 WebPageFinance := TWebPageFinance.Create(nil); 58 ModuleBase.Pages.RegisterPage(WebPageFinance, 'finance'); 51 59 //RegisterPage(TUserControlPage, UserControlPage, ''); 52 inherited;60 AfterStart; 53 61 end; 54 62 55 63 procedure TModuleFinance.Stop; 56 64 begin 57 inherited; 58 Core.Pages.UnregisterPage('finance'); 65 BeforeStop; 66 ModuleBase.Pages.UnregisterPage(WebPageFinance); 67 FreeAndNil(WebPageFinance); 68 ModuleBase := nil; 69 AfterStop; 59 70 end; 60 71 -
trunk/Modules/IS/UModuleIS.pas
r102 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 9 UModuleBase; 9 10 10 11 type … … 15 16 private 16 17 public 18 ModuleBase: TModuleBase; 17 19 constructor Create(Owner: TComponent); override; 18 20 destructor Destroy; override; … … 40 42 License := 'GNU/LGPL v3'; 41 43 Author := 'Chronosoft'; 44 Dependencies.Add('Base'); 42 45 end; 43 46 … … 49 52 procedure TModuleIS.Start; 50 53 begin 51 Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 52 inherited; 54 BeforeStart; 55 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 56 //ModuleBase.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 57 AfterStart; 53 58 end; 54 59 55 60 procedure TModuleIS.Stop; 56 61 begin 57 inherited; 58 Core.Pages.UnregisterPage('portal'); 62 BeforeStop; 63 //ModuleBase.Pages.UnregisterPage('portal'); 64 ModuleBase := nil; 65 AfterStop; 59 66 end; 60 67 -
trunk/Modules/Network/UModuleNetwork.pas
r102 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, 9 UWebPage; 9 10 10 11 type … … 13 14 14 15 TModuleNetwork = class(TModule) 16 private 17 WebPageNetwork: TWebPage; 15 18 public 19 ModuleBase: TModuleBase; 16 20 constructor Create(Owner: TComponent); override; 17 21 destructor Destroy; override; … … 39 43 License := 'GNU/LGPL v3'; 40 44 Author := 'Chronosoft'; 45 Dependencies.Add('Base'); 41 46 end; 42 47 … … 48 53 procedure TModuleNetwork.Start; 49 54 begin 50 Core.Pages.RegisterPage(TWebPageNetwork, WebPageNetwork, 'sit'); 55 BeforeStart; 56 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 57 WebPageNetwork := TWebPageNetwork.Create(nil); 58 ModuleBase.Pages.RegisterPage(WebPageNetwork, 'sit'); 51 59 //RegisterPage(TUserControlPage, UserControlPage, ''); 52 inherited;60 AfterStart; 53 61 end; 54 62 55 63 procedure TModuleNetwork.Stop; 56 64 begin 57 inherited; 58 Core.Pages.UnregisterPage('sit'); 65 BeforeStop; 66 ModuleBase.Pages.UnregisterPage(WebPageNetwork); 67 FreeAndNil(WebPageNetwork); 68 ModuleBase := nil; 69 AfterStop; 59 70 end; 60 71 -
trunk/Modules/Portal/UModulePortal.pas
r104 r105 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses; 9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses, 10 UModuleBase, UModuleUser; 10 11 11 12 type … … 16 17 private 17 18 Time: TDateTime; 19 WebPagePortal: TWebPage; 18 20 function ShowFooter(Session: TWebSession): string; 19 21 function ShowHeader(Session: TWebSession): string; 20 22 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 21 23 public 24 ModuleBase: TModuleBase; 25 ModuleUser: TModuleUser; 22 26 constructor Create(Owner: TComponent); override; 23 27 destructor Destroy; override; … … 46 50 Author := 'Chronosoft'; 47 51 Dependencies.Add('User'); 52 Dependencies.Add('Finance'); 53 Dependencies.Add('News'); 48 54 end; 49 55 … … 55 61 procedure TModulePortal.Start; 56 62 begin 57 Core.GeneratePage := GeneratePage; 58 Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 59 inherited; 63 BeforeStart; 64 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 65 ModuleBase.GeneratePage := GeneratePage; 66 WebPagePortal := TWebPagePortal.Create(nil); 67 ModuleBase.Pages.RegisterPage(WebPagePortal, ''); 68 TWebPagePortal(WebPagePortal).ModuleUser := TModuleUser(Manager.FindModuleByName('User')); 69 AfterStart; 60 70 end; 61 71 62 72 procedure TModulePortal.Stop; 63 73 begin 64 inherited; 65 Core.Pages.UnregisterPage('portal'); 74 BeforeStop; 75 ModuleBase.Pages.UnregisterPage(WebPagePortal); 76 FreeAndNil(WebPagePortal); 77 ModuleBase := nil; 78 AfterStop; 66 79 end; 67 80 … … 208 221 '<div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '; 209 222 Output := Output + Navigation + '</span><div class="MenuItem2">'; 210 if Session.User.Id = UnknownUser then223 if ModuleUser.User.Id = UnknownUser then 211 224 Output := Output + '<a href="' + MakeLink('Přihlášení', 212 225 NavigationLink('/?Action=LoginForm')) + ' ' + 213 226 MakeLink('Registrace', NavigationLink('/?Action=UserRegister')) 214 else Output := Output + Session.User.Name + ' ' + MakeLink('Odhlásit',227 else Output := Output + ModuleUser.User.Name + ' ' + MakeLink('Odhlásit', 215 228 NavigationLink('/?Action=Logout')); 216 229 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; -
trunk/Modules/Portal/UPagePortal.pas
r104 r105 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils, 9 9 SpecializedDictionary, UWebSession, SpecializedList, UHtmlClasses, 10 UModularSystem ;10 UModularSystem, UModuleUser, UModuleNews; 11 11 12 12 type … … 26 26 function WebcamPanel: string; 27 27 public 28 { public declarations } 28 ModuleUser: TModuleUser; 29 ModuleNews: TModuleNews; 29 30 end; 30 31 … … 37 38 38 39 uses 39 UCore, U ModuleUser, UWebObjects, UUser;40 UCore, UWebObjects, UUser; 40 41 41 42 function TWebPagePortal.SystemMessage(Title, Text: string): string; … … 76 77 if ((HyperLink.Values['PermissionModule'] = '') or 77 78 ((HyperLink.Values['PermissionModule'] <> '') and 78 Session.User.CheckPermission(HyperLink.Values['PermissionModule'], HyperLink.Values['PermissionOperation']))) then79 ModuleUser.User.CheckPermission(HyperLink.Values['PermissionModule'], HyperLink.Values['PermissionOperation']))) then 79 80 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 />'; 80 81 end; … … 118 119 Form := TQueryForm.Create; // UserLogin 119 120 Form.Load(Session.Request.Post); 120 Session.UserOnline.Login(121 Session.User.GetIdByNamePassword(121 ModuleUser.UserOnline.Login( 122 ModuleUser.User.GetIdByNamePassword( 122 123 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Username').Value.Value, 123 124 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value)); 124 125 Output := Output + SystemMessage('Přihlášení', 'Přihlášení provedeno'); 125 if Session.User.Id <> UnknownUser then begin126 if ModuleUser.User.Id <> UnknownUser then begin 126 127 //Form.LoadValuesFromForm; 127 128 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value := ''; … … 132 133 end else 133 134 if Query.Values['Action'] = 'Logout' then begin 134 Session.UserOnline.Logout;135 ModuleUser.UserOnline.Logout; 135 136 Output := Output + SystemMessage('Odhlášení', 'Uživatel odhlášen'); 136 137 end else … … 249 250 else if Panel.Values['Module'] = 'UserOptions' then 250 251 begin 251 if Session.User.Id <> UnknownUser then252 if ModuleUser.User.Id <> UnknownUser then 252 253 Output := Output + ShowPanel('Přihlášený uživatel', UserPanel); 253 254 end else … … 255 256 Output := Output + ShowPanel('Kamery', WebcamPanel) 256 257 else if Panel.Values['Module'] = 'NewsGroupList' then 257 // Output := Output + Panel('Aktuality', $this->System->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>')); 258 //Output := Output + ShowPanel('Aktuality', 259 //ModuleNews.Show, 260 //['<a href="?Action=CustomizeNews">Upravit</a>']); 258 261 end; 259 262 Output := Output + '</td>'; -
trunk/Modules/System/UModuleSystem.pas
r97 r105 77 77 for I := 0 to DbRows.Count - 1 do 78 78 with DbRows[I] do begin 79 Module := Core.ModuleManager.FindModuleByName(Values['Name']);79 Module := Manager.FindModuleByName(Values['Name']); 80 80 if Assigned(Module) then 81 81 if Values['Installed'] = '1' then Module.SetInstalledState(True) … … 85 85 DbRows.Free; 86 86 end; 87 Core.ModuleManager.OnModuleChange := ModuleChange;87 Manager.OnModuleChange := ModuleChange; 88 88 inherited; 89 89 end; … … 91 91 procedure TModuleSystem.Stop; 92 92 begin 93 inherited Stop; 94 Core.ModuleManager.OnModuleChange := nil; 93 BeforeStop; 94 Manager.OnModuleChange := nil; 95 AfterStop; 95 96 end; 96 97 … … 152 153 Core.CommonDatabase.Select(DbRows, 'SystemModule', 'Name'); 153 154 154 for I := 0 to Core.ModuleManager.Modules.Count - 1 do155 with TModule( Core.ModuleManager.Modules[I]) do begin155 for I := 0 to Manager.Modules.Count - 1 do 156 with TModule(Manager.Modules[I]) do begin 156 157 Data.Clear; 157 158 Data.Add('Name', Identification); -
trunk/Modules/TV/UModuleTV.pas
r99 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, 9 UWebPage; 9 10 10 11 type … … 13 14 14 15 TModuleTV = class(TModule) 16 private 17 WebPageTV: TWebPage; 15 18 public 19 ModuleBase: TModuleBase; 16 20 constructor Create(Owner: TComponent); override; 17 21 destructor Destroy; override; … … 39 43 License := 'GNU/LGPL v3'; 40 44 Author := 'Chronosoft'; 45 Dependencies.Add('Base'); 41 46 end; 42 47 … … 48 53 procedure TModuleTV.Start; 49 54 begin 50 Core.Pages.RegisterPage(TWebPageTV, WebPageTV, 'tv'); 51 inherited; 55 BeforeStart; 56 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 57 WebPageTV := TWebPageTV.Create(nil); 58 ModuleBase.Pages.RegisterPage(WebPageTV, 'tv'); 59 AfterStart; 52 60 end; 53 61 54 62 procedure TModuleTV.Stop; 55 63 begin 56 inherited; 57 Core.Pages.UnregisterPage('tv'); 64 BeforeStop; 65 ModuleBase.Pages.UnregisterPage(WebPageTV); 66 FreeAndNil(WebPageTV); 67 ModuleBase := nil; 68 AfterStop; 58 69 end; 59 70 -
trunk/Modules/TV/UPageTV.pas
r103 r105 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UHtmlClasses, 9 UUtils ;9 UUtils, UModuleUser; 10 10 11 11 type … … 19 19 procedure HandlePlaylist(HandlerData: THTTPHandlerData); 20 20 public 21 { public declarations }21 ModuleUser: TModuleUser; 22 22 end; 23 23 … … 56 56 begin 57 57 with TWebSession(HandlerData) do begin 58 LoadUserInfo;58 ModuleUser.LoadUserInfo; 59 59 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 60 60 Text := 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>' + -
trunk/Modules/User/UModuleUser.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary; 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UUser, 9 UModuleBase, UWebPage; 9 10 10 11 type 11 12 12 { TModuleUser } 13 13 14 14 TModuleUser = class(TModule) 15 private 16 UserControlPage: TWebPage; //TUserControlPage; 15 17 public 18 User: TWebUser; 19 UserOnline: TWebOnlineUser; 20 ModuleBase: TModuleBase; 16 21 constructor Create(Owner: TComponent); override; 17 22 destructor Destroy; override; … … 21 26 procedure Uninstall; override; 22 27 procedure Upgrade; override; 28 procedure LoadUserInfo; 23 29 end; 24 30 … … 27 33 28 34 uses 29 UCore, U UserControlPage, USqlDatabase;35 UCore, USqlDatabase, UUserControlPage; 30 36 31 37 { TModuleUser } … … 39 45 License := 'GNU/LGPL v3'; 40 46 Author := 'Chronosoft'; 47 Dependencies.Add('Base'); 41 48 end; 42 49 … … 48 55 procedure TModuleUser.Start; 49 56 begin 50 Core.Pages.RegisterPage(TUserControlPage, UserControlPage, 'uzivatel'); 57 BeforeStart; 58 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 59 UserControlPage := TUserControlPage.Create(nil); 60 ModuleBase.Pages.RegisterPage(UserControlPage, 'uzivatel'); 51 61 //RegisterPage(TUserControlPage, UserControlPage, ''); 52 inherited; 62 User := TWebUser.Create; 63 //User.Database := Database; 64 UserOnline := TWebOnlineUser.Create; 65 //UserOnline.Database := Database; 66 AfterStart; 53 67 end; 54 68 55 69 procedure TModuleUser.Stop; 56 70 begin 57 inherited; 58 Core.Pages.UnregisterPage('uzivatel'); 71 BeforeStop; 72 FreeAndNil(User); 73 FreeAndNil(UserOnline); 74 ModuleBase.Pages.UnregisterPage(UserControlPage); 75 FreeAndNil(UserControlPage); 76 ModuleBase := nil; 77 AfterStop; 59 78 end; 60 79 … … 183 202 end; 184 203 204 procedure TModuleUser.LoadUserInfo; 205 begin 206 User.HandlerData := ModuleBase.HandlerData; 207 UserOnline.HandlerData := ModuleBase.HandlerData; 208 UserOnline.Update; 209 User.Id := UserOnline.User; 210 User.Load; 211 end; 212 213 214 185 215 end. 186 216 -
trunk/Modules/User/UUserControlPage.pas
r103 r105 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UXmlClasses, 9 UWebObjects ;9 UWebObjects, UModuleUser, UModuleBase; 10 10 11 11 type … … 21 21 procedure HandleProfile(HandlerData: THTTPHandlerData); 22 22 public 23 { public declarations } 24 end; 23 ModuleUser: TModuleUser; 24 ModuleBase: TModuleBase; 25 end; 25 26 26 27 var … … 47 48 else PageName := ''; 48 49 with HtmlDocument.Body do begin 49 LoadUserInfo;50 ModuleUser.LoadUserInfo; 50 51 if PageName = '' then PageName := 'prihlaseni'; 51 52 if PageName = 'prihlaseni' then HandleLogin(HandlerData) … … 91 92 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 92 93 Text := 'Přihlášení uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 93 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,94 UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 94 95 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 95 96 if UserId = -1 then begin 96 97 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 97 98 Text := '<br/>Chybné jméno nebo heslo'; 98 end else UserOnline.Login(UserId);99 end else ModuleUser.UserOnline.Login(UserId); 99 100 Form.Free; 100 101 end else … … 149 150 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 150 151 Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 151 User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,152 ModuleUser.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 152 153 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value, 153 154 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value); 154 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,155 UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 155 156 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 156 if UserId <> -1 then UserOnline.Login(UserId);157 if UserId <> -1 then ModuleUser.UserOnline.Login(UserId); 157 158 Form.Free; 158 159 end else SubItems.AddNew(Form); … … 163 164 begin 164 165 with TWebSession(HandlerData), Core, HtmlDocument.Body do begin 165 UserOnline.Logout;166 ModuleUser.UserOnline.Logout; 166 167 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 167 168 Text := 'Uživatel odhlášen'; … … 185 186 Hint := 'Zadejte vaše přihlašovací jméno'; 186 187 Required := True; 187 Value.Value := User.Name;188 Value.Value := ModuleUser.User.Name; 188 189 end; 189 190 with AddNewItem do begin … … 200 201 Required := True; 201 202 ItemType := fitText; 202 Value.Value := User.Email;203 Value.Value := ModuleUser.User.Email; 203 204 end; 204 205 with AddNewItem do begin … … 208 209 Required := False; 209 210 ItemType := fitText; 210 Value.Value := User.FullName;211 Value.Value := ModuleUser.User.FullName; 211 212 end; 212 213 end; … … 218 219 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 219 220 Text := 'Profil uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value + ' uložen'; 220 User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;221 User.FullName := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('FullName').Value.Value;222 User.Email := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value;223 User.Save;221 ModuleUser.User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 222 ModuleUser.User.FullName := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('FullName').Value.Value; 223 ModuleUser.User.Email := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value; 224 ModuleUser.User.Save; 224 225 Form.Free; 225 226 end else SubItems.AddNew(Form); -
trunk/Modules/ZdechovNET/UAboutPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 37 37 begin 38 38 with TWebSession(HandlerData) do begin 39 LoadUserInfo;39 ModuleUser.LoadUserInfo; 40 40 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 41 41 Text := '<img align="left" src="' + NavigationLink('/images/umisteni.gif') + '" alt="Umístění obce"/>' + -
trunk/Modules/ZdechovNET/UContactPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 33 33 begin 34 34 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 35 LoadUserInfo;35 ModuleUser.LoadUserInfo; 36 36 Text := '<strong>Kontaktní informace</strong><br/>' + 37 37 'Provozovatel: <strong>Ing. Jiří Hajda</strong><br/>' + -
trunk/Modules/ZdechovNET/UDocumentsPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 35 35 begin 36 36 with TWebSession(HandlerData) do begin 37 LoadUserInfo;37 ModuleUser.LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := '<strong>O obci:</strong><br/>' + -
trunk/Modules/ZdechovNET/UHistoryPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, USqlDatabase; 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, USqlDatabase, 9 UModuleUser; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations }20 ModuleUser: TModuleUser; 20 21 end; 21 22 … … 38 39 begin 39 40 with TWebSession(HandlerData) do begin 40 LoadUserInfo;41 ModuleUser.LoadUserInfo; 41 42 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 42 43 Text := '<table>'; -
trunk/Modules/ZdechovNET/UHostingPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UHtmlClasses; 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UHtmlClasses, 9 UModuleUser; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations }20 ModuleUser: TModuleUser; 20 21 end; 21 22 … … 39 40 begin 40 41 with TWebSession(HandlerData) do begin 41 LoadUserInfo;42 ModuleUser.LoadUserInfo; 42 43 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 43 44 Text := 'V nabídce je provoz virtualizovaných Linuxových serverů dle dohodnutých parameterů.<br/><br/>' + -
trunk/Modules/ZdechovNET/UInternetPage.pas
r102 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 35 35 begin 36 36 with TWebSession(HandlerData) do begin 37 LoadUserInfo;37 ModuleUser.LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := Text + 'Hlavní náplní činnosti sítě je poskytovat výhodné připojení k internetu pro občany.<br/><br/>' + -
trunk/Modules/ZdechovNET/ULinksPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 35 35 begin 36 36 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 37 LoadUserInfo;37 ModuleUser.LoadUserInfo; 38 38 Text := '<strong>Odkazy související s obcí:</strong><br/>' + 39 39 -
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r104 r105 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UWebPage, 9 UWebSession, DateUtils; 9 UWebSession, DateUtils, UModuleBase, UModuleUser, 10 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, 11 ULinksPage, UPlansPage, UServerInfoPage, UWebCamPage, UUser, 12 UNetworkPage, UAboutPage, UContactPage, UProjectsPage; 10 13 11 14 type … … 15 18 TModuleZdechovNET = class(TModule) 16 19 private 20 InternetPage: TInternetPage; 21 HostingPage: THostingPage; 22 HistoryPage: THistoryPage; 23 DocumentsPage: TDocumentsPage; 24 VoIPPage: TVoIPPage; 25 LinksPage: TLinksPage; 26 ContactPage: TContactPage; 27 ServerInfoPage: TServerInfoPage; 28 WebCamPage: TWebCamPage; 29 PlansPage: TPlansPage; 30 NetworkPage: TNetworkPage; 31 ProjectsPage: TProjectsPage; 32 AboutPage: TAboutPage; 17 33 procedure Footer(Session: TWebSession); 18 34 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 19 35 procedure TopMenu(Session: TWebSession); 20 36 public 37 ModuleBase: TModuleBase; 38 ModuleUser: TModuleUser; 21 39 constructor Create(Owner: TComponent); override; 22 40 destructor Destroy; override; … … 32 50 33 51 uses 34 UCore, USqlDatabase, UXmlClasses, UHtmlClasses, UUtils, 35 UInternetPage, UHostingPage, UHistoryPage, UDocumentsPage, UVoIPPage, 36 ULinksPage, UPlansPage, UServerInfoPage, UWebCamPage, UUser, 37 UNetworkPage, UAboutPage, UContactPage, UProjectsPage; 52 UCore, USqlDatabase, UXmlClasses, UHtmlClasses, UUtils; 38 53 39 54 { TModuleZdechovNET } … … 48 63 Author := 'Chronosoft'; 49 64 Dependencies.Add('User'); 65 Dependencies.Add('Base'); 50 66 end; 51 67 … … 57 73 procedure TModuleZdechovNET.Start; 58 74 begin 59 with Core.Pages do begin 60 Core.GeneratePage := GeneratePage; 61 RegisterPage(TInternetPage, InternetPage, 'internet'); 62 RegisterPage(THostingPage, HostingPage, 'hosting'); 63 RegisterPage(THistoryPage, HistoryPage, 'historie'); 64 RegisterPage(TDocumentsPage, DocumentsPage, 'dokumenty'); 65 RegisterPage(TVoIPPage, VoIPPage, 'voip'); 66 RegisterPage(TLinksPage, LinksPage, 'odkazy'); 67 RegisterPage(TContactPage, ContactPage, 'kontakt'); 68 RegisterPage(TServerInfoPage, ServerInfoPage, 'serverinfo'); 69 RegisterPage(TWebCamPage, WebCamPage, 'kamery'); 70 RegisterPage(TPlansPage, PlansPage, 'plany'); 71 RegisterPage(TNetworkPage, NetworkPage, 'sit'); 72 RegisterPage(TProjectsPage, ProjectsPage, 'projekty'); 73 RegisterPage(TAboutPage, AboutPage, ''); 75 ModuleBase := TModuleBase(Manager.FindModuleByName('Base')); 76 ModuleUser := TModuleUser(Manager.FindModuleByName('User')); 77 with ModuleBase, Pages do begin 78 //GeneratePage := GeneratePage; 79 InternetPage := TInternetPage.Create(nil); 80 RegisterPage(InternetPage, 'internet'); 81 HostingPage := THostingPage.Create(nil); 82 RegisterPage(HostingPage, 'hosting'); 83 HistoryPage := THistoryPage.Create(nil); 84 RegisterPage(HistoryPage, 'historie'); 85 DocumentsPage := TDocumentsPage.Create(nil); 86 RegisterPage(DocumentsPage, 'dokumenty'); 87 VoIPPage := TVoIPPage.Create(nil); 88 RegisterPage(VoIPPage, 'voip'); 89 LinksPage := TLinksPage.Create(nil); 90 RegisterPage(LinksPage, 'odkazy'); 91 ContactPage := TContactPage.Create(nil); 92 RegisterPage(ContactPage, 'kontakt'); 93 ServerInfoPage := TServerInfoPage.Create(nil); 94 RegisterPage(ServerInfoPage, 'serverinfo'); 95 WebCamPage := TWebCamPage.Create(nil); 96 RegisterPage(WebCamPage, 'kamery'); 97 PlansPage := TPlansPage.Create(nil); 98 RegisterPage(PlansPage, 'plany'); 99 NetworkPage := TNetworkPage.Create(nil); 100 RegisterPage(NetworkPage, 'sit'); 101 ProjectsPage := TProjectsPage.Create(nil); 102 RegisterPage(ProjectsPage, 'projekty'); 103 AboutPage := TAboutPage.Create(nil); 104 RegisterPage(AboutPage, ''); 74 105 end; 75 106 inherited; … … 79 110 begin 80 111 inherited Stop; 81 with Core.Pages do begin 82 UnregisterPage('internet'); 83 UnregisterPage('hosting'); 84 UnregisterPage('historie'); 85 UnregisterPage('dokumenty'); 86 UnregisterPage('voip'); 87 UnregisterPage('odkazy'); 88 UnregisterPage('kontakt'); 89 UnregisterPage('serverinfo'); 90 UnregisterPage('kamery'); 91 UnregisterPage('plany'); 92 UnregisterPage('sit'); 93 UnregisterPage('projekty'); 94 UnregisterPage(''); 95 end; 112 with ModuleBase, Pages do begin 113 UnregisterPage(AboutPage); 114 FreeAndNil(AboutPage); 115 UnregisterPage(InternetPage); 116 FreeAndNil(InternetPage); 117 UnregisterPage(HostingPage); 118 FreeAndNil(HostingPage); 119 UnregisterPage(HistoryPage); 120 FreeAndNil(HistoryPage); 121 UnregisterPage(DocumentsPage); 122 FreeAndNil(DocumentsPage); 123 UnregisterPage(VoIPPage); 124 FreeAndNil(VoIPPage); 125 UnregisterPage(LinksPage); 126 FreeAndNil(LinksPage); 127 UnregisterPage(ContactPage); 128 FreeAndNil(ContactPage); 129 UnregisterPage(ServerInfoPage); 130 FreeAndNil(ServerInfoPage); 131 UnregisterPage(WebCamPage); 132 FreeAndNil(WebCamPage); 133 UnregisterPage(PlansPage); 134 FreeAndNil(PlansPage); 135 UnregisterPage(NetworkPage); 136 FreeAndNil(NetworkPage); 137 UnregisterPage(ProjectsPage); 138 FreeAndNil(ProjectsPage); 139 end; 140 ModuleBase := nil; 141 ModuleUser := nil; 96 142 end; 97 143 … … 179 225 begin 180 226 inherited Uninstall; 181 Core.GeneratePage := nil;227 ModuleBase.GeneratePage := nil; 182 228 try 183 229 DbRows := TDbRows.Create; … … 257 303 '<li><a href="http://wiki.zdechov.net/">Wiki</a></li>' + 258 304 '</ul><ul class="MenuItem2">'; //<li> </li>'; 259 if Assigned( TCore(MainModule).Pages.FindByName('uzivatel')) then begin260 if UserOnline.User = UnknownUser then begin305 if Assigned(ModuleBase.Pages.FindByName('uzivatel')) then begin 306 if ModuleUser.UserOnline.User = UnknownUser then begin 261 307 Text := Text + '</ul>' + 262 308 '<ul class="MenuItem2">' + … … 268 314 Text := Text + '</ul>' + 269 315 '<ul class="MenuItem2">' + 270 '<li>' + User.FullName + '</li>' +316 '<li>' + ModuleUser.User.FullName + '</li>' + 271 317 '<li>' + MakeLink('Odhlášení', NavigationLink('/uzivatel/odhlaseni/')) + '</li>' + 272 318 '<li>' + MakeLink('Profil', NavigationLink('/uzivatel/profil/')) + '</li>'; -
trunk/Modules/ZdechovNET/UNetworkPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses ;8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 37 37 begin 38 38 with TWebSession(HandlerData) do begin 39 LoadUserInfo;39 ModuleUser.LoadUserInfo; 40 40 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 41 41 Text := MakeLink('Historie', NavigationLink('/historie/')) + '<br/>' + -
trunk/Modules/ZdechovNET/UPlansPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer, USqlDatabase; 8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer, USqlDatabase, 9 UModuleUser; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations }20 ModuleUser: TModuleUser; 20 21 end; 21 22 … … 38 39 begin 39 40 with TWebSession(HandlerData) do begin 40 LoadUserInfo;41 ModuleUser.LoadUserInfo; 41 42 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 42 43 Text := '<table>'; -
trunk/Modules/ZdechovNET/UProjectsPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer, USqlDatabase; 8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer, USqlDatabase, 9 UModuleUser; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations }20 ModuleUser: TModuleUser; 20 21 end; 21 22 … … 38 39 begin 39 40 with TWebSession(HandlerData) do begin 40 LoadUserInfo;41 ModuleUser.LoadUserInfo; 41 42 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 42 43 try -
trunk/Modules/ZdechovNET/UVoIPPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer ;8 Classes, SysUtils, FileUtil, UWebPage, UHtmlClasses, UHTTPServer, UModuleUser; 9 9 10 10 type … … 17 17 { private declarations } 18 18 public 19 { public declarations }19 ModuleUser: TModuleUser; 20 20 end; 21 21 … … 35 35 begin 36 36 with TWebSession(HandlerData) do begin 37 LoadUserInfo;37 ModuleUser.LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := 'Volejte levněji do pevných a mobilních sítí s sekundovou tarifikací a bez měsíčního paušálu.' + -
trunk/Modules/ZdechovNET/UWebCamPage.pas
r103 r105 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, USqlDatabase; 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, USqlDatabase, 9 UModuleUser; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations }20 ModuleUser: TModuleUser; 20 21 end; 21 22 … … 46 47 begin 47 48 with TWebSession(HandlerData) do begin 48 LoadUserInfo;49 ModuleUser.LoadUserInfo; 49 50 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 50 51 Text := '';
Note:
See TracChangeset
for help on using the changeset viewer.