1 | {strip}
|
---|
2 |
|
---|
3 | {assign var="level" value=false}
|
---|
4 | {assign var="skill" value=false}
|
---|
5 | {assign var="reagents" value=false}
|
---|
6 |
|
---|
7 | {foreach from=$data item=curr}
|
---|
8 | {if $curr.level}{assign var="level" value=true}{/if}
|
---|
9 | {if $curr.skill}{assign var="skill" value=true}{/if}
|
---|
10 | {if $curr.reagents}{assign var="reagents" value=true}{/if}
|
---|
11 | {/foreach}
|
---|
12 |
|
---|
13 | new Listview({ldelim}
|
---|
14 | template:'spell',
|
---|
15 | id:'{$id}',
|
---|
16 | {if isset($name)}name: LANG.tab_{$name},{/if}
|
---|
17 | visibleCols: [{if $level}'level'{/if}],
|
---|
18 | hiddenCols: [{if !$reagents}'reagents',{/if}{if !$skill}'skill',{/if}'school'],
|
---|
19 | sort: [{if isset($sort)}{$sort}{else}'name'{/if}],
|
---|
20 | {if $script}note: sprintf(LANG.lvnote_scripttype, '{$script|escape:"quotes"}'),{/if}
|
---|
21 | {if isset($tabsid)}tabs:{$tabsid}, parent: 'listview-generic',{/if}
|
---|
22 | data:[
|
---|
23 | {section name=i loop=$data}
|
---|
24 | {ldelim}
|
---|
25 | name: '{$data[i].quality}{$data[i].name|escape:"quotes"}',
|
---|
26 | {if $level}level: {$data[i].level},{/if}
|
---|
27 | school: {$data[i].school},
|
---|
28 | {if isset($data[i].rank)}
|
---|
29 | rank: '{$data[i].rank|escape:"quotes"}',
|
---|
30 | {/if}
|
---|
31 | {if isset($data[i].skill)}
|
---|
32 | skill: [{$data[i].skill}],
|
---|
33 | {/if}
|
---|
34 | {if $data[i].reagents}
|
---|
35 | reagents:[
|
---|
36 | {section name=j loop=$data[i].reagents}
|
---|
37 | [{$data[i].reagents[j].entry},{$data[i].reagents[j].count}]
|
---|
38 | {if $smarty.section.j.last}{else},{/if}
|
---|
39 | {/section}
|
---|
40 | ],
|
---|
41 | {/if}
|
---|
42 | {if isset($data[i].creates)}
|
---|
43 | creates:[
|
---|
44 | {section name=j loop=$data[i].creates}
|
---|
45 | {$data[i].creates[j].entry},
|
---|
46 | {$data[i].creates[j].count}
|
---|
47 | {if $smarty.section.j.last}{else},{/if}
|
---|
48 | {/section}
|
---|
49 | ],
|
---|
50 | {/if}
|
---|
51 | {if isset($data[i].learnedat)}
|
---|
52 | learnedat: {$data[i].learnedat},
|
---|
53 | {/if}
|
---|
54 | {if isset($data[i].colors)}
|
---|
55 | colors:[
|
---|
56 | {section name=j loop=$data[i].colors}
|
---|
57 | {$data[i].colors[j]}
|
---|
58 | {if $smarty.section.j.last}{else},{/if}
|
---|
59 | {/section}
|
---|
60 | ],
|
---|
61 | {/if}
|
---|
62 | id: {$data[i].entry}
|
---|
63 | {rdelim}
|
---|
64 | {if $smarty.section.i.last}{else},{/if}
|
---|
65 | {/section}
|
---|
66 | ]
|
---|
67 | {rdelim});
|
---|
68 | {/strip} |
---|