-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathViewedLast.xxm
72 lines (65 loc) · 1.98 KB
/
ViewedLast.xxm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
[[@txDefs,DataLank,txSession,txCache,txNodes]][[!var
qr:TQueryResult;
i,id,pid:integer;
LocationCache:TItemCache;
ln:TLocationNode;
s:string;
]][[
Context.Include('dHead.xxmi',['Viewed recently']);
<h2>Viewed recently</h2>
if (ViewedLastCount=0) or (Session.ViewedLast[0]=0) then
begin
<<p class="information">No items viewed yet.</p>
<p>
<a href="Item.xxm">browse...</a>,
<a href="Filter.xxm">filter...</a>,
<a href="Search.xxm">search...</a>,
<a href="Log.xxm">log...</a>
</p>>
end
else
begin
LocationCache:=TItemCache.Create;
try
<<p id="xliTitle"></p>
<p>>
i:=0;
while not(i=ViewedLastCount) and not(Session.ViewedLast[i]=0) and Context.Connected do
begin
id:=Session.ViewedLast[i];
qr:=TQueryResult.Create(Session.DbCon,sqlObjByID,[id]);
try
s:=' ';
pid:=qr.GetInt('pid');
while (pid<>0) and Context.Connected do
begin
ln:=LocationCache[pid] as TLocationNode;
if ln=nil then ln:=LocationCache.Add(pid,TLocationNode.Create(itObj,pid)) as TLocationNode;
s:=ln.GetHTML([ghLink,ghIcon,ghTitle,ghFrameListClass],pid)+s;
end;
Context.SendHTML(s);
Context.Include('dObjLink.xxmi',[],[qr]);
Context.Include('dObjTokRef.xxmi',[id,#13#10' ',' '],[qr]);
Context.Include('d_cmw.xxmi',[],[qr]);
<<br />>
finally
qr.Free;
end;
inc(i);
end;
<</p>
<script><!--
$(".fli")
.mouseenter(function(){$("."+this.className.split(" ")[1]).addClass("highlight1");$("#xliTitle").text(this.title);})
.mouseleave(function(){$("."+this.className.split(" ")[1]).removeClass("highlight1");$("#xliTitle").text("");});
//--></script>>
finally
LocationCache.Free;
end;
end;
<<p>
<a class="linkbutton" href="Search.xxm">search...</a>
<a class="linkbutton" href="Filter.xxm">filter objects...</a>
<a class="linkbutton" href="SelectedLast.xxm">selected recently...</a>
</p>>
Context.Include('dFoot.xxmi');