18 require_once SQ_PACKAGES_PATH.
'/cms/page_templates/page_decision_tree/decision_tree_question/decision_tree_question.inc';
44 parent::__construct($assetid);
58 $page_links = parent::_getAllowedLinks();
72 if ($this->
attr(
'style') ==
'DROP_DOWN') {
89 $name =
'q'.$this->id;
92 $extras =
'id="'.str_replace(
':',
'_', $name).
'" '.$this->
attr(
'extra');
93 $extras .=
' onChange="get_next_step(this.value,'.$this->id.
')"';
95 $default_value = $this->
attr(
'empty_key');
97 if (is_null($default_value)) {
102 combo_box($name, $this->
getOptions(), FALSE, $default_value, 0, $extras);
103 $html = ob_get_contents();
118 $name =
'q'.$this->id;
121 $default_value = $this->
attr(
'empty_key');
123 if (is_null($default_value)) {
128 $onclick =
'get_next_step(this.value,'.$this->id.
')';
133 foreach ($options as $value => $title){
134 if ($value === $default_value)
continue;
135 $for = htmlspecialchars($name.
'_'.$i);
136 $extras =
'id="'.$name.
'_'.$i.
'" '.$this->
attr(
'extra');
139 $extras =
'id="'.$name.
'" '.$this->
attr(
'extra');
143 radio_button($this->
attr(
'name'), $value, FALSE, $onclick, $extras);
149 $html = ob_get_contents();
164 $options = $this->
attr(
'options');
166 if (count($options) > 0) {
167 $decoded_options = Array();
168 $decoded_options[$this->
attr(
'empty_key')] = $this->
attr(
'empty_text');
170 foreach (array_keys($options) as $k) {
171 if ($options[$k] !=
'') {
172 $decoded_options[html_entity_decode($k, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)] = html_entity_decode($options[$k], ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET);
175 $options = $decoded_options;