var Color,BorderColor:string;
PathFile,Masque,LeftCode,RightCode,Width:string;
TopBorder,LeftBorder,BottomBorder,RightBorder:string;
Share:string;
strings:TStringList;
LeftWidth,RightWidth:integer;
css_filename:string;
begin
TopBorder := GetParam('TopBorderWidth','1');
LeftBorder := GetParam('LeftBorderWidth','1');
BottomBorder:= GetParam('BottomBorderWidth','1');
RightBorder := GetParam('RightBorderWidth','1');
LeftWidth := StrToInt(GetParam('LeftWidth','49'));
RightWidth := 100 - LeftWidth - 2;
Color := GetParam('Color','$D5AAAA');
BorderColor := GetParam('BorderColor',Color);
LeftCode := GetParam('LeftCode','');
RightCode := GetParam('RightCode','');

Share := GetParam('LeftShare','');
if Share<>'' then LeftCode := GetContenuPartage(Share);
Share := GetParam('RightShare','');
if Share<>'' then RightCode := GetContenuPartage(Share);


if Condition('_HTML_') then
begin
css_filename := GetParam('FilenameCss',GetProjet+'_hw.css');
// ne générer qu'une seule fois les css
if GetVarInt('oppositeleftright',0)=0 then
begin
// on positionne la variable globale à 1, comme cela la prochaine fois
// que ce script sera exécuté dans ce projet on ne viendra pas ici
SetVarInt('oppositeleftright',1);

SetCss(css_filename,'div.row span.left','float','left');
SetCss(css_filename,'div.row span.left','text-align','left');
SetCss(css_filename,'div.row span.left','width',IntToStr(LeftWidth)+'%');

SetCss(css_filename,'div.row span.right','float','right');
SetCss(css_filename,'div.row span.right','text-align','right');
SetCss(css_filename,'div.row span.right','width',IntToStr(RightWidth)+'%');

SetCss(css_filename,'div.spacer','clear','both');
end;

// insérer lien vers css externe qu'une fois par page
if GetVarInt(css_filename+GetTitre,0)=0 then
begin
SetVarInt(css_filename+GetTitre,1);
writeln('<<WEB(head:<link rel="stylesheet" type="text/css" href="')>>+css_filename+<<FNT(STRING.-,-,-,-:'" />)>>');
end;

Width := GetParam('Width','100%');
Masque := '<<WEB(<div style= "width: %s; background-color: %s;')>>+
<<FNT(STRING.-,-,-,-:'border-style:solid; border-color:%s; border-width:%spx %spx %spx %spx; padding: 1px; margin: 0px auto;">)>>'
+
'<<WEB(<div class="spacer"></div>)>>'+
'<<WEB(<div class="row"><span class="left">)>>'+'%s'+
'<<WEB(</span><span class="right">)>>%s'+'<<WEB(</span></div>)>>'+
'<<WEB(<div class="spacer"></div></div>)>>';
write(Format(Masque,[width,ColorToHtml(color),ColorToHtml(bordercolor),TopBorder,LeftBorder,BottomBorder,RightBorder,LeftCode,RightCode]));

end else begin
Masque := '<<TABLE:%s,%s!,RIGHT,,,@TOP,>>'+
'<<TR.:>><<TD: 0,0@%s>><<ALIGNE :Gauche>>%s'+
'<<¶>><</TD>><<TD: 1,0@%s>><<ALIGNE :Droite>>%s'+
'<<¶>><</TD>><</TR>><</TABLE>>';
color := IntTostr(StrToInt(color));
width := IntToStr(StrToInt(GetParam('WidthPixel','800')) div 2);
write(format(Masque,[width,width,color,leftcode,color,rightcode]));
end;


end;
end.

Sommaire