source: aowow/templates/wowhead/bricks/creature_table.tpl

Last change on this file was 170, checked in by maron, 16 years ago
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1{*
2 ШАБЛОН ТАБЛИЦЫ СОЗДАНИЙ
3 Переменные, передаваемые шаблону:
4 id - идентификатор/тип табл
5 name - название табл
6 tabsid - идентификатор вкладок
7 data - данные для табл
8
9 Пример вставки модуля в текст:
10 Со вкладками:
11 {include file='bricks/creature_table.tpl' id='dropped-by' tabsid='tabsRelated' data=$droppedby name=#droppedby#}
12 Без вкладок:
13 {include file='bricks/creature_table.tpl' id='items' data=$items}
14*}
15{strip}
16
17{assign var="cost" value=false}
18{assign var="stack" value=false}
19{assign var="group" value=false}
20{assign var="percent" value=false}
21
22{foreach from=$data item=curr}
23 {if isset($curr.cost)}{assign var="cost" value=true}{/if}
24 {if isset($curr.stack)}{assign var="stack" value=true}{/if}
25 {if isset($curr.percent)}{assign var="percent" value=true}{/if}
26 {if isset($curr.group)}{assign var="group" value=true}{/if}
27{/foreach}
28
29new Listview(
30 {ldelim}template:'npc',
31 id:'{$id}',
32 {if isset($name)}name: LANG.tab_{$name},{/if}
33 {if isset($tabsid)}tabs:{$tabsid},parent: 'listview-generic',{/if}
34 extraCols:[
35 {if $percent}Listview.extraCols.percent{/if}
36 {if $cost}Listview.extraCols.stock, {if $stack}Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'),{/if} Listview.extraCols.cost{/if}
37 ],
38 hiddenCols:[{if $cost}'type'{else}'location'{/if}],
39 sort: [{if $percent}'-percent',{/if} 'name'],
40 data:[
41 {section name=i loop=$data}
42 {ldelim}
43 name: '{$data[i].name|escape:"quotes"}',
44 {if $data[i].subname}
45 tag: '{$data[i].subname|escape:"quotes"}',
46 {/if}
47 minlevel: {$data[i].minlevel},
48 maxlevel: {$data[i].maxlevel},
49 type: {$data[i].type},
50 classification: {$data[i].classification},
51 react: [{$data[i].react}],
52 {if $percent}
53 percent: {$data[i].percent},
54 {/if}
55 {if $cost}
56 stock: {$data[i].stock},
57 {if isset($data[i].stack)}
58 stack: {$data[i].stack},
59 {/if}
60 cost: [
61 {if isset($data[i].cost.money)}{$data[i].cost.money}{/if}
62 {if isset($data[i].cost.honor) or isset($data[i].cost.arena) or isset($data[i].cost.items)}
63 ,{if isset($data[i].cost.honor)}{$data[i].cost.honor}{/if}
64 {if isset($data[i].cost.arena) or isset($data[i].cost.items)}
65 ,{if isset($data[i].cost.arena)}{$data[i].cost.arena}{/if}
66 {if isset($data[i].cost.items)}
67 ,[
68 {foreach from=$data[i].cost.items item=curitem name=c}
69 [{$curitem.item},{$curitem.count}]
70 {if $smarty.foreach.c.last}{else},{/if}
71 {/foreach}
72 ]
73 {/if}
74 {/if}
75 {/if}
76 ],
77 {/if}
78 id: {$data[i].entry}
79 {rdelim}
80 {if $smarty.section.i.last}{else},{/if}
81 {/section}
82 ]
83 {rdelim}
84);
85{/strip}
86
Note: See TracBrowser for help on using the repository browser.