Changeset 104 for trunk/Modules
- Timestamp:
- Oct 8, 2012, 10:22:08 AM (12 years ago)
- Location:
- trunk/Modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/UModulePortal.pas
r103 r104 7 7 uses 8 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, USqlDatabase, 9 UUtils, UWebSession, SpecializedList, UUser ;9 UUtils, UWebSession, SpecializedList, UUser, UWebPage, UHtmlClasses; 10 10 11 11 type … … 18 18 function ShowFooter(Session: TWebSession): string; 19 19 function ShowHeader(Session: TWebSession): string; 20 procedure GeneratePage(ASession: TWebSession; Page: TWebPage); 20 21 public 21 22 constructor Create(Owner: TComponent); override; … … 54 55 procedure TModulePortal.Start; 55 56 begin 57 Core.GeneratePage := GeneratePage; 56 58 Core.Pages.RegisterPage(TWebPagePortal, WebPagePortal, 'portal'); 57 59 inherited; … … 220 222 end; 221 223 224 procedure TModulePortal.GeneratePage(ASession: TWebSession; Page: TWebPage); 225 var 226 I: Integer; 227 TitleTag: THtmlString; 228 begin 229 with ASession do begin 230 HtmlDocument.ContentLanguage := 'cs'; 231 GlobalTitle := 'Portál'; 232 HtmlDocument.Styles.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Style.css')); 233 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/Global.js')); 234 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + TCore(MainModule).Style + '/jquery.js')); 235 236 TitleTag := THtmlString.Create; 237 TitleTag.Text := ShowHeader(ASession); 238 HtmlDocument.Body.SubItems.Insert(0, TitleTag); 239 TitleTag := THtmlString.Create; 240 TitleTag.Text := ShowFooter(ASession); 241 HtmlDocument.Body.SubItems.Add(TitleTag); 242 //Page.Page.OnProduce(HandlerData); 243 HtmlDocument.Title := Page.Caption; 244 TitleTag.Text := '<div class="TitlePanel"><span class="GlobalTitle">' + GlobalTitle + 245 '</span> - ' + HtmlDocument.Title + '</div>'; 246 HtmlDocument.Title := GlobalTitle + ' - ' + HtmlDocument.Title; 247 with HtmlDocument.AsXmlDocument do 248 try 249 Formated := TCore(MainModule).FormatHTML; 250 Response.Content.WriteString(AsString); 251 finally 252 Free; 253 end; 254 end; 255 end; 256 222 257 function TModulePortal.ShowFooter(Session: TWebSession): string; 223 258 begin -
trunk/Modules/Portal/UPagePortal.lfm
r102 r104 4 4 OnProduce = DataModuleProduce 5 5 Height = 142 6 HorizontalOffset = 3137 VerticalOffset = 716 HorizontalOffset = 400 7 VerticalOffset = 193 8 8 Width = 214 9 9 end -
trunk/Modules/Portal/UPagePortal.pas
r103 r104 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, USqlDatabase, UUtils, 9 SpecializedDictionary, UWebSession, SpecializedList; 9 SpecializedDictionary, UWebSession, SpecializedList, UHtmlClasses, 10 UModularSystem; 10 11 11 12 type … … 20 21 function SystemMessage(Title, Text: string): string; 21 22 function ShowLinks(GroupId: Integer): string; 22 function Show: string;23 procedure Show(HandlerData: THTTPHandlerData); 23 24 function OnlineHostList: string; 24 25 function UserPanel: string; … … 48 49 Session := TWebSession(HandlerData); 49 50 with TWebSession(HandlerData) do begin 50 51 Show(HandlerData); 52 GeneratePage(Self); 51 53 end; 52 54 end; … … 85 87 end; 86 88 87 function TWebPagePortal.Show: string;89 procedure TWebPagePortal.Show(HandlerData: THTTPHandlerData); 88 90 var 89 91 Output: string; … … 97 99 I, J: Integer; 98 100 begin 101 try 102 DbRows := TDbRows.Create; 103 DbRows2 := TDbRows.Create; 99 104 Output := ''; 100 105 with Session.Request do … … 117 122 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Username').Value.Value, 118 123 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value)); 119 Output := Output + SystemMessage('Přihlášení', Result);124 Output := Output + SystemMessage('Přihlášení', 'Přihlášení provedeno'); 120 125 if Session.User.Id <> UnknownUser then begin 121 126 //Form.LoadValuesFromForm; … … 165 170 Form.Load(Session.Request.Post); 166 171 //Result = Session.User.PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 167 Output := Output + SystemMessage('Obnova hesla', Result);172 Output := Output + SystemMessage('Obnova hesla', 'Heslo obnoveno'); 168 173 //if Result <> USER_PASSWORD_RECOVERY_SUCCESS then begin 169 174 Output := Output + Form.AsXmlElement.AsString; … … 219 224 end; 220 225 end *); 226 end; 221 227 222 228 //Session.Database.Database := Config['Database']['Database']; … … 235 241 Session.Database.Query(DbRows2, 'SELECT * FROM `Panel` WHERE `PanelColumn`=' + 236 242 PanelColumn.Values['Id'] + ' ORDER BY `Order`'); 237 for J := 0 to DbRows2.Count - 1 do 238 Panel := DbRows [J];243 for J := 0 to DbRows2.Count - 1 do begin 244 Panel := DbRows2[J]; 239 245 if Panel.Values['Module'] = 'HyperlinkGroup' then 240 246 Output := Output + ShowLinks(StrToInt(Panel.Values['Parameters'])) … … 253 259 Output := Output + '</td>'; 254 260 end; 255 Output := Output + '</table>'; 256 Result := Output; 261 Output := Output + '</tr></table>'; 262 with TWebSession(HandlerData) do begin 263 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do 264 Text := Text + Output; 265 end; 266 finally 267 DbRows2.Free; 268 DbRows.Free; 257 269 end; 270 end; 258 271 259 272 function TWebPagePortal.OnlineHostList: string; -
trunk/Modules/ZdechovNET/UModuleZdechovNET.pas
r103 r104 58 58 begin 59 59 with Core.Pages do begin 60 Core.GeneratePage := GeneratePage; 60 61 RegisterPage(TInternetPage, InternetPage, 'internet'); 61 62 RegisterPage(THostingPage, HostingPage, 'hosting'); … … 103 104 DbRows := TDbRows.Create; 104 105 Data := TDictionaryStringString.Create; 105 106 Core.GeneratePage := GeneratePage;107 106 108 107 Core.CommonDatabase.Query(DbRows,
Note:
See TracChangeset
for help on using the changeset viewer.