5 public $typ =
"radioButton";
14 $this->
set_value(
"Option {$this->index}");
21 if( is_array($this->
config) ){
23 if( isset($this->
config[
"br"]) ){
24 return $this->
config[
"br"];
44 $this->
config[
"br"] = $val;
62 $this->data[
"br"] =
true;
64 $this->data[
"br"] =
false;
78 if( isset($this->data[
"br"]) ){
79 return $this->data[
"br"];
90 $val = htmlspecialchars($val , ENT_QUOTES ,
"UTF-8",
true);
93 if( (strlen($val) > 256) ){
94 $err_reason =
"Wert der Option mit der ID {$this->ID} enthält mehr als 256 Zeichen.";
96 if( (strlen($val) == 0) ){
97 $err_reason =
"Bitte Wert für die Wert Option mit der ID {$this->ID} angeben.";
113 $checked =
"checked='checked'";
119 if( (isset($_SESSION[
"last_option_edit"])) AND ( $_SESSION[
"last_option_edit"] == $this->ID ) ){
120 $edited =
"option_last_edit";
121 unset($_SESSION[
"last_option_edit"] );
124 echo
"<tr class='$edited'>";
125 echo
"<td>{$this->ID}</td>";
126 echo
"<td style='text-align:center'>
127 <input type='text' value='{$this->dispName}' name='option_ID{$this->ID}_name' placeholder='Antwortmöglichkeit' style='width:90%'/>
130 echo
"<td style='text-align:center'>
131 <input type='text' value='{$this->value}' name='option_ID{$this->ID}_value' placeholder='Wert in der Datenbank' style='width:90%'/>
136 <input type='submit' name='add_option_ID{$this->ID}' title='Option Einfügen' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/list-add.png );background-repeat:no-repeat;width:26px;height:26px;' />
137 <input type='submit' name='rm_option_ID{$this->ID}' title='Option Löschen' value='' tabindex='-1' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/edit-delete.png );background-repeat:no-repeat;width:26px;height:26px;' />
138 <input type='submit' name='mvup_option_ID{$this->ID}' title='Option nach Oben schieben' tabindex='-1' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/go-up.png );background-repeat:no-repeat;width:26px;height:26px;' />
139 <input type='submit' name='mvdwn_option_ID{$this->ID}' title='Option nach Unten schieben' tabindex='-1' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/go-down.png );background-repeat:no-repeat;width:26px;height:26px' />
140 <input type='checkbox' value='br' name='option_ID{$this->ID}_linebr' tabindex='-1' style='margin-left:1em' $checked/> Umbruch
141 <span style='margin-left:1em'>Limit:</span><input type='text' name='option_ID{$this->ID}_max' size='3' tabindex='-1' value='$max'/>
149 if( (isset($_POST[
"option_ID{$this->ID}_name"])) AND ($_POST[
"option_ID{$this->ID}_name"] !=
"") ){
150 $dispName = htmlspecialchars($_POST[
"option_ID{$this->ID}_name"] , ENT_QUOTES ,
"UTF-8",
true);
154 return "Name der Option mit ID {$this->ID} enthält mehr als 256 Zeichen!";
157 return "Name der Option mit ID {$this->ID} nicht angegeben!";
160 if( (isset($_POST[
"option_ID{$this->ID}_linebr"])) AND ($_POST[
"option_ID{$this->ID}_linebr"] ==
"br") ){
165 if( isset($_POST[
"option_ID{$this->ID}_max"]) ){
166 if( $_POST[
"option_ID{$this->ID}_max"] !=
"" ){
167 $this->
set_config(
"max" , intval($_POST[
"option_ID{$this->ID}_max"]) );
175 if( isset($_POST[
"option_ID{$this->ID}_value"]) ){
176 if( ($_POST[
"option_ID{$this->ID}_value"] !=
"") ){
177 return $this->
set_value( $_POST[
"option_ID{$this->ID}_value"] );
179 return $this->
set_value( $this->dispName);
182 return $this->
set_value( $this->dispName);
191 if( !(isset($this->
name)) OR !(isset($this->
value)) OR ($this->
value ==
"") OR ($this->
name ==
"") ){
192 throw new exception(
"name or value not set");
195 $s =
"checked='checked'";
199 if( ($this->
get_data(
"count") >= $max) AND ($max != -1) ){
204 $active =
"disabled='disabled'";
206 $active_style =
"disabled_widget_text";
207 }
else{$active=
"";$active_style=
"";}
209 echo
"<td><input type='radio' value='{$this->value}' name='{$name}' id='{$this->ID}' $s $active/> </td>".PHP_EOL;
210 echo
"<td><label class='widget_answer $active_style' style='margin-right:2em' for='{$this->ID}' >{$this->dispName}</label></td>".PHP_EOL;
211 if( $columns ==
"rows" ){
215 }
else if($columns ==
"columns"){
226 if( !(isset($this->
name)) OR !(isset($this->
value)) OR ($this->
value ==
"") OR ($this->
name ==
"") ){
227 throw new exception(
"name or value not set");
230 $s =
"selected='selected'";
234 if( ($this->
get_data(
"count") >= $max) AND ($max != -1) ){
239 $active =
"disabled='disabled'";
241 $active_style =
"disabled_widget_text";
242 }
else{$active=
"";$active_style=
"";}
244 echo
"<option value='{$this->value}' $s $active class='$active_style' style='min-width:15em'>{$this->dispName}</option>";
262 echo
"<td></td><td></td>";
263 if( $columns ==
"rows" ){
267 }
else if($columns ==
"columns"){