editsimple.smarty
4.21 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{capture assign=sCSS}
{literal}
/* inactivity */
.active .inactivity_message { display: none; }
/* select { width: 100%; } */
.edit_button { margin-bottom: 0.5em; }
.save_button,
.done_button { display: none; margin-bottom: 0.5em;}
.active.editing .save_button,
.active.editing .done_button { display: block; }
.active.editing .edit_button { display: none; }
td { vertical-align: top; }
.buttonset.inactive { background: transparent; }
.inactive { background: #ccc; }
.inactive .fixed_message,
.inactive .unassigned_items,
.inactive .available_behaviours,
.inactive .behaviour_edit_options
{
display: none;
}
.inactive .item_list { display: none; }
.helpText {
color: #666;
}
/* logging support */
#brad-log .severity-INFO { color: blue; font-weight: bold; }
#brad-log .severity-DEBUG { color: green; font-weight: bold; }
#brad-log .severity-ERROR { color: red; font-weight: bold; }
#brad-log .explanation { font-family: monospace; white-space: pre; }
{/literal}
{/capture}
{$context->oPage->requireCSSStandalone($sCSS)}
<!-- include the mochikit js -->
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Base.js")}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DateTime.js")}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Iter.js")}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/Async.js")}
{$context->oPage->requireJSResource("thirdpartyjs/MochiKit/DOM.js")}
{$context->oPage->requireJSResource("resources/js/taillog.js")}
{$context->oPage->requireJSResource("resources/js/conditional_simple_edit.js")}
{capture assign=sJS}
addLoadEvent(partial(editSimpleField, {$iMasterFieldId}));
{/capture}
{$context->oPage->requireJSStandalone($sJS)}
<h2>{i18n}Editing Fieldset Rules (Simple){/i18n}</h2>
<p class="descriptiveText">{i18n}To make a value in a <strong>child field</strong> available to the user when another value is
selected in a <strong>parent field</strong>, first ensure that the parent field is being edited (it will have "save" and "done"
as the buttons at the bottom of the column) and then select the value for the parent field. Now select the value(s) in
the child column(s) you wish to be available to the user when the parent field's value is selected,
and click "save". Note you that you can use Ctrl-<click> to select multiple child values
at the same time.{/i18n}</p>
<p class="descriptiveText important">{i18n}Changes made here are stored immediately, without you needing to
refresh the page.{/i18n}</p>
<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="fieldset_id" id="global-fieldset-id" value="{$fieldset_id}" />
<table id="simple_conditional_edit">
<thead>
<tr>
{foreach from=$aFields item=oField}
<th id="header_{$oField->getId()}">{$oField->getName()}</th>
{/foreach}
</tr>
</thead>
<tbody>
<tr valign="top">
{foreach from=$aFields item=oField}
<td class="inactive" id="md_{$oField->getId()}">
<p class="inactivity_message">{i18n}This field is not controlled by the currently active group.{/i18n}</p>
<div class="lookup_items">
<select class="item_list" size="5">
{foreach from=$oField->getEnabledValues() item=oMetaData}
<option value="{$oMetaData->getId()}">{$oMetaData->getName()}</option>
{/foreach}
</select>
</div>
</td>
{/foreach}
</tr>
</tbody>
<tfoot>
<tr>
{foreach from=$aFields item=oField}
<td class="buttonset" id="buttons_{$oField->getId()}">
<div class="form_actions">{capture assign=fid}{$oField->getId()}{/capture}
{if (!empty($ordering.$fid))}<input type="button" value="{i18n}edit field{/i18n}" class="edit_button" onclick="editSimpleField({$oField->getId()})" />{/if}
<input type="button" value="{i18n}save this dependency{/i18n}" class="save_button" onclick="saveSimpleField({$oField->getId()})" />
{if ($iMasterFieldId != $oField->getId())} {* Only for non-initial fields. *}
<input type="button" value="{i18n}finished with this field{/i18n}" class="done_button" onclick="finishSimpleField({$oField->getId()})" />
{/if}
</div>
</td>
{/foreach}
</tr>
</tfoot>
</table>
</form>
{*
<table id="brad-log">
<tr>
<th>Severity</th>
<th>Time</th>
<th>Entry</th>
</tr>
<tbody >
</tbody>
</table>
*}