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