mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
{.for line.} and {.if|var.}
This commit is contained in:
parent
d1a4b8574a
commit
bfe0265119
@ -923,6 +923,37 @@ var
|
|||||||
finally free end;
|
finally free end;
|
||||||
end; // foreach
|
end; // foreach
|
||||||
|
|
||||||
|
procedure forLine();
|
||||||
|
var
|
||||||
|
lines: TStringList;
|
||||||
|
line, code, run: string;
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
code:=macroDequote(par(pars.count-1));
|
||||||
|
with TfastStringAppend.create do
|
||||||
|
try
|
||||||
|
lines:=TStringList.create();
|
||||||
|
lines.text:= getVar(par('var'));
|
||||||
|
for line in lines do
|
||||||
|
begin
|
||||||
|
i:=pos('=',line);
|
||||||
|
if i > 0 then
|
||||||
|
begin
|
||||||
|
setVar('line-key', Copy(line, 1, i-1));
|
||||||
|
setVar('line-value', Copy(line, i+1, MAXINT));
|
||||||
|
end;
|
||||||
|
setVar('line', line);
|
||||||
|
run:=code;
|
||||||
|
applyMacrosAndSymbols(run, cbMacros, cbData);
|
||||||
|
append(run);
|
||||||
|
end;
|
||||||
|
result:=reset();
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
lines.Free;
|
||||||
|
end;
|
||||||
|
end; //forLine
|
||||||
|
|
||||||
procedure for_();
|
procedure for_();
|
||||||
var
|
var
|
||||||
b, e, i, d: integer;
|
b, e, i, d: integer;
|
||||||
@ -2427,8 +2458,12 @@ try
|
|||||||
minOrMax();
|
minOrMax();
|
||||||
|
|
||||||
if stringExists(name, ['if','if not']) then
|
if stringExists(name, ['if','if not']) then
|
||||||
if isFalse(p) xor (length(name) > 2) then result:=macroDequote(par(2))
|
begin
|
||||||
|
try p:=getVar(parEx('var'));
|
||||||
|
except end;
|
||||||
|
if isTrue(p) xor (length(name) = 2) then result:=macroDequote(par(2))
|
||||||
else result:=macroDequote(par(1));
|
else result:=macroDequote(par(1));
|
||||||
|
end;
|
||||||
|
|
||||||
if stringExists(name, ['=','>','>=','<','<=','<>','!=']) then
|
if stringExists(name, ['=','>','>=','<','<=','<>','!=']) then
|
||||||
trueIf(compare(name, p, par(1)));
|
trueIf(compare(name, p, par(1)));
|
||||||
@ -2444,6 +2479,9 @@ try
|
|||||||
if name = 'cut' then
|
if name = 'cut' then
|
||||||
cut();
|
cut();
|
||||||
|
|
||||||
|
if name ='for line' then
|
||||||
|
forLine();
|
||||||
|
|
||||||
if pars.count < 3 then exit; // from here, only macros with at least 3 parameters
|
if pars.count < 3 then exit; // from here, only macros with at least 3 parameters
|
||||||
|
|
||||||
if name ='for each' then
|
if name ='for each' then
|
||||||
|
|||||||
@ -12,12 +12,16 @@ propaganda
|
|||||||
Mobile-friendly template
|
Mobile-friendly template
|
||||||
Unicode support
|
Unicode support
|
||||||
Encrypted login, and logout
|
Encrypted login, and logout
|
||||||
|
IPv6
|
||||||
/propaganda
|
/propaganda
|
||||||
+ new default template
|
+ new default template
|
||||||
+ new login system, session based, with logout
|
+ new login system, session based, with logout
|
||||||
|
+ IPv6 support
|
||||||
+ {.set item|name.}
|
+ {.set item|name.}
|
||||||
+ {.get item|icon.}
|
+ {.get item|icon.}
|
||||||
+ {.set cfg.}
|
+ {.set cfg.}
|
||||||
|
+ {.for line.}
|
||||||
|
+ {.if|var}
|
||||||
+ cache for jquery and template sections
|
+ cache for jquery and template sections
|
||||||
+ new template commands: base64, base64decode, md5, sha1
|
+ new template commands: base64, base64decode, md5, sha1
|
||||||
+ *.diff.tpl in exe's folder
|
+ *.diff.tpl in exe's folder
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user