18 require_once SQ_PACKAGES_PATH.
'/cms/form/form_action/form_action.inc';
20 require_once SQ_FUDGE_PATH.
'/general/general.inc';
45 parent::__construct();
57 if (!isset($settings[
'set_session_var'])) {
58 $var_settings = Array();
60 $var_settings = $settings[
'set_session_var'];
62 $name = array_get_index($var_settings,
'var_name',
'');
63 $value = array_get_index($var_settings,
'var_value',
'');
67 <table
class=
"no-borders" style=
"width:auto">
69 <td><?php echo translate(
'variable_name');?></td>
72 text_box($prefix.
'_var_name', $name, 30);
77 <td><?php echo translate(
'set_value');?></td>
80 text_box($prefix.
'_var_value', $value, 30);
97 if (!isset($settings[
'set_session_var'])) {
98 $var_settings = Array();
100 $var_settings = $settings[
'set_session_var'];
103 $var_settings[
'var_name'] = array_get_index($_POST, $prefix.
'_var_name',
'');
104 $var_settings[
'var_value'] = array_get_index($_POST, $prefix.
'_var_value',
'');
106 $settings[
'set_session_var'] = $var_settings;
120 if (!isset($settings[
'set_session_var'])) {
121 $var_settings = Array();
123 $var_settings = $settings[
'set_session_var'];
125 $name = array_get_index($var_settings,
'var_name',
'');
126 $value = array_get_index($var_settings,
'var_value',
'');
128 ?><table
class=
"no-borders">
135 <td
class=
"sq-backend-table-cell" style=
"vertical-align: top"><p><strong><?php echo translate(
'variable_name');?></strong></p></td>
136 <td
class=
"sq-backend-table-cell" style=
"vertical-align: top"><p><?php echo $name; ?></p></td>
139 <td
class=
"sq-backend-table-cell" style=
"vertical-align: top"><p><strong><?php echo translate(
'set_value');?></strong></p></td>
140 <td
class=
"sq-backend-table-cell" style=
"vertical-align: top"><p><?php echo $value; ?></p></td>
155 $var_settings = $settings[
'set_session_var'];
162 $found = preg_match_all(
'/%(response_(\\d+_)?q\\d+(_raw)?)%/U', $var_settings[
'var_value'], $set_matches, PREG_SET_ORDER);
163 $matches += $set_matches;
164 $found = preg_match_all(
'/%(form_submission_.*)%/U', $var_settings[
'var_value'], $set_matches, PREG_SET_ORDER);
165 $matches = array_merge($matches, $set_matches);
167 foreach ($matches as $match) {
168 if (empty($match))
continue;
169 $var_settings[
'var_value'] = preg_replace(
'/%'.$match[1].
'%/U', html_entity_decode($form->
_getThankYouKeywordReplacement($match[1])), $var_settings[
'var_value']);
172 $_SESSION[SQ_SESSION_SANDBOX_INDEX][$var_settings[
'var_name']] = $var_settings[
'var_value'];
185 if (!isset($settings[
'set_session_var'])) {
186 $var_settings = Array();
188 $var_settings = $settings[
'set_session_var'];
190 self::_fillDefaultValues($var_settings);
193 if (!isset($var_settings[
'var_name']) || empty($var_settings[
'var_name'])) {
197 if (!isset($var_settings[
'var_value']))
return FALSE;
211 private static function _fillDefaultValues(&$session_format)
213 if (!isset($session_format[
'var_value'])) {
214 $session_format[
'var_value'] =
'';
216 if (!isset($session_format[
'var_name'])) {
217 $session_format[
'var_name'] =
'';