18 require_once dirname(__FILE__).
'/../../form_question/form_question_edit_fns.inc';
58 $elements = Array(
'd' =>
'Day',
'm' =>
'Month',
'y' =>
'Year',
'h' =>
'Hour',
'i' =>
'Minute',
's' =>
'Second',
'c' =>
'Circa');
60 $show_params = $asset->attr(
'show');
61 $text_params = $asset->attr(
'text');
62 $null_params = $asset->attr(
'null');
64 $default_params = $asset->getDefaultParameters();
67 if ($asset->writeAccess(
'attributes')) $edit = TRUE;
70 <table
class=
"sq-backend-table">
72 <td width=
"12%" align=
"center" class=
"sq-backend-table-header"> </td>
73 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
74 echo translate(
'circa');
76 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
77 echo translate(
'day');
79 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
80 echo translate(
'month'); ?>
82 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
83 echo translate(
'year');
85 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
86 echo translate(
'hour');
88 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
89 echo translate(
'minute');
91 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
92 echo translate(
'second');
94 <td width=
"11%" align=
"center" class=
"sq-backend-table-header"><?php
95 echo translate(
'core_form_datetime_12_hour_format');
99 <td
class=
"sq-backend-table-cell"><?php
100 echo translate(
'show_question')
102 <td align=
"center" class=
"sq-backend-table-cell"><?php
104 check_box($prefix.
'_c',
'1', $show_params[
'c']);
106 echo $show_params[
'c'] ?
'X' :
'';
109 <td align=
"center" class=
"sq-backend-table-cell"><?php
111 check_box($prefix.
'_d',
'1', $show_params[
'd']);
113 echo $show_params[
'd'] ?
'X' :
'';
116 <td align=
"center" class=
"sq-backend-table-cell"><?php
118 check_box($prefix.
'_m',
'1', $show_params[
'm']);
120 echo $show_params[
'm'] ?
'X' :
'';
123 <td align=
"center" class=
"sq-backend-table-cell"><?php
125 check_box($prefix.
'_y',
'1', $show_params[
'y']);
127 echo $show_params[
'y'] ?
'X' :
'';
130 <td align=
"center" class=
"sq-backend-table-cell"><?php
132 check_box($prefix.
'_h',
'1', $show_params[
'h']);
134 echo $show_params[
'h'] ?
'X' :
'';
137 <td align=
"center" class=
"sq-backend-table-cell"><?php
139 check_box($prefix.
'_i',
'1', $show_params[
'i']);
141 echo $show_params[
'i'] ?
'X' :
'';
144 <td align=
"center" class=
"sq-backend-table-cell"><?php
146 check_box($prefix.
'_s',
'1', $show_params[
's']);
148 echo $show_params[
's'] ?
'X' :
'';
151 <td align=
"center" class=
"sq-backend-table-cell"><?php
152 $show_params[
'a'] = (isset($show_params[
'a'])) ? $show_params[
'a'] : $default_params[
'show'][
'a'];
154 check_box($prefix.
'_a',
'1', $show_params[
'a']);
156 echo $show_params[
'a'] ?
'X' :
'';
161 <td colspan=
"2" class=
"sq-backend-table-cell"><?php
162 echo translate(
'allow_blank_question');
164 <td align=
"center" class=
"sq-backend-table-cell"><?php
166 check_box($prefix.
'_d_null',
'1', $null_params[
'd']);
168 echo $null_params[
'd'] ?
'X' :
'';
171 <td align=
"center" class=
"sq-backend-table-cell"><?php
173 check_box($prefix.
'_m_null',
'1', $null_params[
'm']);
175 echo $null_params[
'm'] ?
'X' :
'';
178 <td align=
"center" class=
"sq-backend-table-cell"><?php
180 check_box($prefix.
'_y_null',
'1', $null_params[
'y']);
182 echo $null_params[
'y'] ?
'X' :
'';
185 <td align=
"center" class=
"sq-backend-table-cell"><?php
187 check_box($prefix.
'_h_null',
'1', $null_params[
'h']);
189 echo $null_params[
'h'] ?
'X' :
'';
192 <td align=
"center" class=
"sq-backend-table-cell"><?php
194 check_box($prefix.
'_i_null',
'1', $null_params[
'i']);
196 echo $null_params[
'i'] ?
'X' :
'';
199 <td align=
"center" class=
"sq-backend-table-cell"><?php
201 check_box($prefix.
'_s_null',
'1', $null_params[
's']);
203 echo $null_params[
's'] ?
'X' :
'';
206 <td align=
"center" class=
"sq-backend-table-cell"> </td>
209 <td colspan=
"2" class=
"sq-backend-table-cell"><?php
210 echo translate(
'core_form_datetime_text_box_question');
212 <td align=
"center" class=
"sq-backend-table-cell"><?php
214 check_box($prefix.
'_d_text',
'1', $text_params[
'd']);
216 echo $text_params[
'd'] ?
'X' :
'';
219 <td align=
"center" class=
"sq-backend-table-cell"><?php
221 check_box($prefix.
'_m_text',
'1', $text_params[
'm']);
223 echo $text_params[
'm'] ?
'X' :
'';
226 <td align=
"center" class=
"sq-backend-table-cell"><?php
228 check_box($prefix.
'_y_text',
'1', $text_params[
'y']);
230 echo $text_params[
'y'] ?
'X' :
'';
233 <td align=
"center" class=
"sq-backend-table-cell"><?php
235 check_box($prefix.
'_h_text',
'1', $text_params[
'h']);
237 echo $text_params[
'h'] ?
'X' :
'';
240 <td align=
"center" class=
"sq-backend-table-cell"><?php
242 check_box($prefix.
'_i_text',
'1', $text_params[
'i']);
244 echo $text_params[
'i'] ?
'X' :
'';
247 <td align=
"center" class=
"sq-backend-table-cell"><?php
249 check_box($prefix.
'_s_text',
'1', $text_params[
's']);
251 echo $text_params[
's'] ?
'X' :
'';
254 <td align=
"center" class=
"sq-backend-table-cell"> </td>
274 $elements = Array(
'd',
'm',
'y',
'h',
'i',
's');
276 $show_params = $asset->attr(
'show');
277 $text_params = $asset->attr(
'text');
278 $null_params = $asset->attr(
'null');
280 foreach ($elements as $e) {
281 $entities = Array(
'',
'_null',
'_text');
282 foreach ($entities as $entity) {
284 if ($entity ==
'_null') {
285 $current_param =& $null_params;
286 }
else if ($entity ==
'_text') {
287 $current_param =& $text_params;
289 $current_param =& $show_params;
292 if (isset($_POST[$prefix.
'_'.$e.$entity])) {
293 $current_param[$e] = $_POST[$prefix.
'_'.$e.$entity];
295 $current_param[$e] =
'';
300 if (isset($_POST[$prefix.
'_c'])) {
301 $show_params[
'c'] = $_POST[$prefix.
'_c'];
303 $show_params[
'c'] =
'';
306 if (isset($_POST[$prefix.
'_a'])) {
307 $show_params[
'a'] = $_POST[$prefix.
'_a'];
309 $show_params[
'a'] =
'';
312 if (!$asset->setAttrValue(
'show', $show_params)) {
315 if (!$asset->setAttrValue(
'text', $text_params)) {
318 if (!$asset->setAttrValue(
'null', $null_params)) {
341 $extra_params = $asset->attr(
'extras');
342 $edit = ($asset->writeAccess(
'attributes')) ? TRUE : FALSE;
344 <table
class=
"sq-backend-table">
346 <td width=
"8%" class=
"sq-backend-table-header"><?php
347 echo translate(
'day');
349 <td
class=
"sq-backend-table-cell"><?php
351 text_box($prefix.
'_d_extras', $extra_params[
'd']);
353 echo $extra_params[
'd'];
359 <td width=
"8%" class=
"sq-backend-table-header"><?php
360 echo translate(
'month'); ?>
362 <td
class=
"sq-backend-table-cell"><?php
364 text_box($prefix.
'_m_extras', $extra_params[
'm']);
366 echo $extra_params[
'm'];
371 <td width=
"8%" class=
"sq-backend-table-header"><?php
372 echo translate(
'year');
374 <td
class=
"sq-backend-table-cell"><?php
376 text_box($prefix.
'_y_extras', $extra_params[
'y']);
378 echo $extra_params[
'y'];
383 <td width=
"8%" class=
"sq-backend-table-header"><?php
384 echo translate(
'hour');
386 <td
class=
"sq-backend-table-cell"><?php
388 text_box($prefix.
'_h_extras', $extra_params[
'h']);
390 echo $extra_params[
'h'];
395 <td width=
"8%" class=
"sq-backend-table-header"><?php
396 echo translate(
'minute');
398 <td
class=
"sq-backend-table-cell"><?php
400 text_box($prefix.
'_i_extras', $extra_params[
'i']);
402 echo $extra_params[
'i'];
407 <td width=
"8%" class=
"sq-backend-table-header"><?php
408 echo translate(
'second');
410 <td
class=
"sq-backend-table-cell"><?php
412 text_box($prefix.
'_s_extras', $extra_params[
's']);
414 echo $extra_params[
's'];
419 <td width=
"8%" class=
"sq-backend-table-header"><?php
420 echo translate(
'core_form_datetime_12_hour_format');
422 <td
class=
"sq-backend-table-cell"><?php
423 $extra_params[
'a'] = (isset($extra_params[
'a'])) ? $extra_params[
'a'] :
'';
425 text_box($prefix.
'_a_extras', $extra_params[
'a']);
427 echo $extra_params[
'a'];
449 $elements = Array(
'd',
'm',
'y',
'h',
'i',
's',
'a');
450 $current_param = Array();
452 foreach ($elements as $e) {
453 if (isset($_POST[$prefix.
'_'.$e.
'_extras'])) {
454 $current_param[$e] = $_POST[$prefix.
'_'.$e.
'_extras'];
456 $current_param[$e] =
'';
459 if (!$asset->setAttrValue(
'extras', $current_param)) {