edit_lookuptree.smarty
4.16 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{$context->oPage->requireCSSResource('resources/css/kt-treewidget.css')}
<h2><img src="{if $config->get("ui/morphEnabled") == '1'}{$rootUrl}/skins/kts_{$config->get("ui/morphTo")}/title_bullet.png{else}{$rootUrl}/resources/graphics/title_bullet.png{/if}"/>{i18n}Edit Lookup Tree{/i18n}:<br />{$field->getName()}</h2>
<p class="descriptiveText">{i18n}Many "lookup" fields make sense in a hierachy:
countries are part of continents and sub-continents, school classes are part of grades
and programs, Powerbooks are Apple Macs, while Thinkpads are made by Lenovo. This
page will allow you to arrange the lookups in the field in a hierachy. All changes
are immediately stored, so when you are done simply navigate back to the field menu.{/i18n}</p>
<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n arg_category="$category_name"}Add New Subcategory to <strong>#category#</strong>{/i18n}</legend>
<p class="descriptiveText">{i18n}In order to organise the options into a "tree", you
need to add subcategories at each level. The "top" level is called the root, and
holds all the toplevel items. "Root" will not be shown to the final user, but
provides a single "parent" to the toplevel items.{/i18n}</p>
<p class="descriptiveText">{i18n}As an example, if you are creating a tree of the
countries in the world, the actual countries would be <strong>keywords</strong>
(e.g. South Africa, England, Pakistan, India, etc.). The highest group of categories
would be continents — e.g. Africa, Europe, Asia, The Americas — followed by
subcategories that contain actual countries — e.g. Western Europe, Sub-Saharan Africa,
Australasia.{/i18n}</p>
{foreach from=$args item=v key=k}
<input type="hidden" name="{$k}" value="{$v}" />
{/foreach}
<input type="hidden" name="subaction" value="addCategory" />
<input type="hidden" name="current_node" value="{$currentNode}" />
<input type="text" name="category_name"/>
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}add new subcategory{/i18n}" />
</div>
</fieldset>
</form>
{if ($currentNode != 0)}
{if (empty($freechildren))}
<p class="descriptiveText">{i18n}Keywords which are directly below the
<strong>Root</strong> are considered "free" — they are not attached to
a subcategory. Only free keywords can be associated with a subcategory. To
free a keyword, click on the "unlink" command next to it in the preview tree below.
Deleting a subcategory will automatically unlink all keywords below it (including
those in subcategories of the subcategory).
{/i18n}</p>
<div class="ktInfoMessage"><span>{i18n}No free keywords. Use the "unlink" action on a keyword to
make it available.{/i18n}</span></div>
{else}
<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n arg_category=$category_name}Attach keywords to <strong>#category#</strong>{/i18n}</legend>
<p class="descriptiveText">{i18n}Keywords which are directly below the
<strong>Root</strong> are considered "free" — they are not attached to
a subcategory. Only free keywords can be associated with a subcategory. To
free a keyword, click on the "unlink" command next to it in the preview tree below.
{/i18n}</p>
{foreach from=$args item=v key=k}
<input type="hidden" name="{$k}" value="{$v}" />
{/foreach}
<input type="hidden" name="subaction" value="linkKeywords" />
<input type="hidden" name="current_node" value="{$currentNode}" />
<select multiple="1" name="keywordsToAdd[]">
{foreach item=oKeyword from=$freechildren name=kc}
<option value="{$oKeyword->getId()}" {if $smarty.foreach.kc.total == 1} SELECTED="true"{/if}>{$oKeyword->getName()}</option>
{/foreach}
</select>
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Add to category{/i18n}" />
</div>
</fieldset>
</form>
{/if}
{/if}
<h2>{i18n}Preview{/i18n}</h2>
<div><p class="descriptiveText">
{i18n}Use the +/- arrows to open or close the tree. Bold items are metadata keywords.
To edit a category (including adding or removing keywords) click on the "attach keywords" link next to it.{/i18n}
</p>
</div>
{$renderedTree}