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/UCore.pas

    r25 r27  
    1111  TArrayOfString = array of string;
    1212
     13function NavigationLink(URL: string): string;
    1314function MakeLink(Text, URL: string): string;
    14 function NavigationMakeLink(Module, Page: string): string;
    1515function InsertIcon(FileName: string): string;
    1616function IconedLink(Link, Text: string): string;
     
    8484function InsertIcon(FileName: string): string;
    8585begin
    86   Result := '<img alt="" src="images/favicons/' + FileName + '" width="16" height="16" />';
     86  Result := '<img alt="" src="' + NavigationLink('/images/favicons/' + FileName) + '" width="16" height="16" />';
    8787end;
    8888
     
    100100  Icon: string;
    101101begin
    102   Extension := Copy(Link, LastPos(Link, '.') + 1, Length(Link));
    103   Icon := '<img src="images/icons/' + Extension + '.gif" alt="' + Extension + '"> ';
     102  Extension := Copy(Link, LastPos('.', Link) + 1, Length(Link));
     103  Icon := '<img src="' + NavigationLink('/images/icons/' + Extension + '.gif') + '" alt="' + Extension + '"> ';
    104104  Result := Icon + '<a href="' + Link + '">' + Text + '</a>';
    105105end;
     
    110110end;
    111111
    112 function NavigationMakeLink(Module, Page: string): string;
     112function NavigationLink(URL: string): string;
    113113begin
    114   Result := '?m=' + Module + '&amp;p=' + Page;
     114  if (Length(URL) > 0) and (URL[1] = '/') then
     115    Result := ConfigBaseURL + URL
     116    else Result := URL;
    115117end;
    116118
Note: See TracChangeset for help on using the changeset viewer.