Ignore:
Timestamp:
Sep 10, 2010, 8:09:21 AM (14 years ago)
Author:
george
Message:
  • Přidáno: Systém navigace pomocí "pěkných" URL.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/lazarus/Application/UCustomCGIApplication.pas

    r26 r27  
    77uses
    88  Classes, SysUtils, UCGIApplication, Contnrs, USqlDatabase, UConfig, DateUtils,
    9   UXmlClasses, UHtmlClasses, UCore;
     9  UXmlClasses, UHtmlClasses, UCore, UStringListEx;
    1010
    1111type
     
    8989  TitleTag: THtmlString;
    9090begin
    91   //SysInfo;
    92   Style := 'Basic';
     91  Style := ConfigStyle;
     92  BaseURL := ConfigBaseURL;
    9393
    9494  HtmlDocument.ContentLanguage := 'cs';
    9595  GlobalTitle := 'ZděchovNET';
    96   HtmlDocument.Styles.Add('Style/' + Style + '/Style.css');
    97   HtmlDocument.Scripts.Add('Style/' + Style + '/Global.js');
    98   HtmlDocument.Scripts.Add('Style/' + Style + '/jquery.js');
    99 
    100   PageName := Query.Values['p'];
    101   if PageName = '' then PageName := '';
    102   ModuleName := Query.Values['m'];
    103   if ModuleName = '' then ModuleName := 'Main';
     96  HtmlDocument.Styles.Add(NavigationLink('/Style/' + Style + '/Style.css'));
     97  HtmlDocument.Scripts.Add(NavigationLink('/Style/' + Style + '/Global.js'));
     98  HtmlDocument.Scripts.Add(NavigationLink('/Style/' + Style + '/jquery.js'));
     99
     100  if QueryParts.Count > 0 then PageName := QueryParts[0]
     101    else PageName := '';
    104102  I := 0;
    105   while (I < Pages.Count) and (TRegistredPage(Pages[I]).Name <> ModuleName) do Inc(I);
    106   if I < Pages.Count then begin
     103  while (I < Pages.Count) and (TRegistredPage(Pages[I]).Name <> PageName) do Inc(I);
     104  if (I < Pages.Count) then begin
    107105    TitleTag := THtmlString.Create;
    108106    HtmlDocument.Body.SubItems.Add(TitleTag);
     
    111109    TitleTag.Text := '<div class="TitlePanel"><span class="GlobalTitle">' + GlobalTitle +
    112110    '</span> - ' + HtmlDocument.Title + '</div>';
    113     with HtmlDocument.AsXmlDocument do begin
     111    HtmlDocument.Title := GlobalTitle + ' - ' + HtmlDocument.Title;
     112    with HtmlDocument.AsXmlDocument do try
    114113      Formated := ConfigFormatHTML;
    115114      Output.Add(AsString);
     115    finally
    116116      Free;
    117117    end;
     
    211211    // Visitor
    212212    Text := Text + '<ul class="MenuItem">' +
    213       '<li>' + MakeLink('O síti', NavigationMakeLink('Main', 'About')) + '</li>' +
    214       '<li>' + MakeLink('Internet', NavigationMakeLink('Main', 'Internet')) + '</li>' +
    215       '<li>' + MakeLink('Hosting', NavigationMakeLink('Main', 'Hosting')) + '</li>' +
    216       '<li>' + MakeLink('VoIP', NavigationMakeLink('Main', 'VoIP')) + '</li>' +
     213      '<li>' + MakeLink('O síti', NavigationLink('/')) + '</li>' +
     214      '<li>' + MakeLink('Internet', NavigationLink('/internet/')) + '</li>' +
     215      '<li>' + MakeLink('Hosting', NavigationLink('/hosting/')) + '</li>' +
     216      '<li>' + MakeLink('VoIP', NavigationLink('/voip/')) + '</li>' +
    217217      '<li><a href="https://mail.zdechov.net/">Pošta</a></li>' +
    218       '<li>' + MakeLink('Historie', NavigationMakeLink('Main', 'History')) + '</li>' +
    219       '<li>' + MakeLink('Dokumenty', NavigationMakeLink('Main', 'Documents')) + '</li>' +
    220       '<li>' + MakeLink('Odkazy', NavigationMakeLink('Main', 'Links')) + '</li>' +
    221       '<li>' + MakeLink('Kontakt', NavigationMakeLink('Main', 'Contact')) + '</li>';
     218      '<li>' + MakeLink('Historie', NavigationLink('/historie/')) + '</li>' +
     219      '<li>' + MakeLink('Dokumenty', NavigationLink('/dokumenty/')) + '</li>' +
     220      '<li>' + MakeLink('Odkazy', NavigationLink('/odkazy/')) + '</li>' +
     221      '<li>' + MakeLink('Kontakt', NavigationLink('/kontakt/')) + '</li>';
    222222    Text := Text + '</ul><ul class="MenuItem2"><li>&nbsp;</li>';
    223223(*    if System.UserOnline.User = System.UserOnline.AnonymousUserId then begin
Note: See TracChangeset for help on using the changeset viewer.