48 |
if (@ds && $#ds > 0) { |
if (@ds && $#ds > 0) { |
49 |
print qq{<response> |
print qq{<response> |
50 |
<action type='html' target='div_record' errorCode='' errorMessage='' > |
<action type='html' target='div_record' errorCode='' errorMessage='' > |
51 |
}, $out->apply( |
}, $iconv_utf8->convert( $out->apply( |
52 |
template => $template, |
template => $template, |
53 |
data => \@ds, |
data => \@ds, |
54 |
), qq{ |
) ), qq{ |
55 |
|
|
56 |
<script type='text/javascript'> |
</action> |
57 |
|
<action type='javascript' errorCode='' errorMessage='' > |
58 |
<!-- |
<!-- |
59 |
var el = iwfGetById('div_record_nr'); |
var el = iwfGetById('div_record_nr'); |
60 |
if (el) el.innerHTML = '# <b>$rec</b>'; |
if (el) el.innerHTML = '# <b>$rec</b>'; |
61 |
//iwfShow('div_record'); |
//iwfShow('div_record'); |
62 |
iwfOpacity('div_record', 100); |
iwfOpacity('div_record', 100); |
63 |
//--> |
//--> |
|
</script> |
|
|
|
|
64 |
</action> |
</action> |
65 |
</response> |
</response> |
66 |
}; |
}; |
70 |
<action type='html' target='div_record' errorCode='' errorMessage='' > |
<action type='html' target='div_record' errorCode='' errorMessage='' > |
71 |
|
|
72 |
<b>Record $rec not found!</b> |
<b>Record $rec not found!</b> |
73 |
<script type='text/javascript'> |
</action> |
74 |
|
<action type='javascript' errorCode='' errorMessage='' > |
75 |
<!-- |
<!-- |
76 |
var el = iwfGetById('div_record_nr'); |
var el = iwfGetById('div_record_nr'); |
77 |
if (el) el.innerHTML = '<strike>$rec</strike>'; |
if (el) el.innerHTML = '<strike> $rec </strike>'; |
78 |
//--> |
//--> |
|
</script> |
|
|
|
|
79 |
</action> |
</action> |
80 |
</response> |
</response> |
81 |
}; |
}; |
88 |
|
|
89 |
if ($q->param('save_template')) { |
if ($q->param('save_template')) { |
90 |
|
|
91 |
my $tmpl = $q->param('tt_template') || die "no template?"; |
my $tmpl = $iconv_loc->convert( $q->param('tt_template') ) || die "no template?"; |
92 |
|
sub _conv_js { |
93 |
|
my $t = shift || return; |
94 |
|
return $iconv_loc->convert(chr(hex($t))); |
95 |
|
} |
96 |
|
$tmpl =~ s/%u([a-fA-F0-9]{4})/_conv_js($1)/gex; |
97 |
|
$tmpl =~ s/[\n\r]+$//s; |
98 |
|
|
99 |
my $tmpl_file = $out->{'include_path'} . '/' . $template; |
my $tmpl_file = $out->{'include_path'} . '/' . $template; |
100 |
write_file($tmpl_file . '.new', $iconv_loc->convert($tmpl)) || die "can't save $tmpl_file: $!"; |
write_file($tmpl_file . '.new', $tmpl) || die "can't save $tmpl_file: $!"; |
101 |
rename $tmpl_file . '.new', $tmpl_file || die "can't rename to $tmpl_file: $!"; |
rename $tmpl_file . '.new', $tmpl_file || die "can't rename to $tmpl_file: $!"; |
102 |
|
|
103 |
print qq{<response> |
print qq{<response> |
104 |
<action type='html' target='div_status' errorCode='' errorMessage='' > |
<action type='html' target='div_status' errorCode='' errorMessage='' > |
105 |
$template saved |
<tt>$template</tt> saved |
106 |
</action> |
</action> |
107 |
<action type='js'> |
<action type='js'> |
108 |
<!-- |
<!-- |
109 |
|
iwfShow('div_status', 1); |
110 |
reload_rec(); |
reload_rec(); |
111 |
|
iwfHideGentlyDelay('div_status', 2, 2000, 1); |
112 |
--> |
--> |
113 |
</action> |
</action> |
114 |
</response> |
</response> |
124 |
<action type='html' target='div_template' errorCode='' errorMessage='' > |
<action type='html' target='div_template' errorCode='' errorMessage='' > |
125 |
<pre>}, Dumper($q->Vars), qq{</pre> |
<pre>}, Dumper($q->Vars), qq{</pre> |
126 |
|
|
127 |
<form name="frmEditor" action="$self" method="post" |
<form name="frmEditor" action="$self" method="post" iwfTarget="div_status" > |
|
iwfTarget="div_status" |
|
|
> |
|
128 |
|
|
129 |
<textarea name="tt_template" cols="80" rows="10" style="display: block;"> |
<textarea name="tt_template" cols="80" rows="10" style="display: block;"> |
130 |
$tmpl |
$tmpl |
132 |
|
|
133 |
<br/> |
<br/> |
134 |
<input type="button" name="save_template" value="Save" onclick="javascript:iwfRequest(this);" /> |
<input type="button" name="save_template" value="Save" onclick="javascript:iwfRequest(this);" /> |
135 |
<input type="checkbox" name="checkin_template" id="checkin_checkbox" label="checkin" /> |
<!-- |
136 |
<span id="div_status" style="color: #808080;">idle</span> |
<input type="checkbox" name="checkin_template" id="checkin_checkbox" label="checkin" /> checkin |
137 |
|
--> |
138 |
|
<span id="div_status" style="color: #808080;">idle</span> |
139 |
|
|
140 |
<input type='hidden' value='hidden post value' name='hidValue' /> |
<input type='hidden' value='hidden post value' name='hidValue' /> |
141 |
|
|
142 |
</form> |
</form> |
143 |
</action> |
</action> |
144 |
|
<action type='js'> |
145 |
|
<!-- |
146 |
|
iwfHideGentlyDelay('div_status', 2, 2000, 1); |
147 |
|
--> |
148 |
|
</action> |
149 |
</response> |
</response> |
150 |
}; |
}; |
151 |
|
|
171 |
} |
} |
172 |
|
|
173 |
function load_rec(nr) { |
function load_rec(nr) { |
174 |
|
if (nr == 1) { |
175 |
|
iwfHide('a_left_arr', 1); |
176 |
|
} else { |
177 |
|
iwfShow('a_left_arr', 1); |
178 |
|
} |
179 |
update_status(nr+'...'); |
update_status(nr+'...'); |
180 |
iwfRequest( url+'/xml/?rec='+nr, 'div_record' ); |
iwfRequest( url+'/xml/?rec='+nr, 'div_record' ); |
181 |
iwfOpacity('div_record', 30); |
iwfOpacity('div_record', 30); |
188 |
} |
} |
189 |
|
|
190 |
function dec_rec() { |
function dec_rec() { |
191 |
rec--; |
if (rec > 1) { |
192 |
load_rec(rec); |
rec--; |
193 |
|
load_rec(rec); |
194 |
|
} |
195 |
return false; |
return false; |
196 |
} |
} |
197 |
|
|
217 |
</div> |
</div> |
218 |
|
|
219 |
<div style="background: #e0e0e0; padding: 0.5em; display: block;"> |
<div style="background: #e0e0e0; padding: 0.5em; display: block;"> |
220 |
<a href="$self?rec=}, $rec - 1, qq{" onClick="return dec_rec();">⇦</a> |
<a id="a_left_arr" href="$self?rec=}, $rec - 1, qq{" onClick="return dec_rec();">⇦</a> |
221 |
<span id="div_record_nr"> none </span> |
<span id="div_record_nr"> none </span> |
222 |
|
|
223 |
<a href="$self?rec=}, $rec + 1, qq{" onClick="return inc_rec();">⇨</a> |
<a id="a_right_arr" href="$self?rec=}, $rec + 1, qq{" onClick="return inc_rec();">⇨</a> |
224 |
<a href="$self?rec=}, $rec, qq{" onClick="return reload_rec();">↺</a> |
<a id="a_reload" href="$self?rec=}, $rec, qq{" onClick="return reload_rec();">↺</a> |
225 |
<a href="#" onClick="iwfRefreshLog(); return false;">▤</a> |
<a href="#" onClick="iwfRefreshLog(); return false;">▤</a> |
226 |
|
|
227 |
</div> |
</div> |
228 |
|
|