5 public $typ =
"checkBox";
13 $val = htmlspecialchars($val , ENT_QUOTES ,
"UTF-8",
true);
16 if( (strlen($val) > 256) ){
17 $err_reason =
"Wert der Option mit der ID {$this->ID} enthält mehr als 256 Zeichen.";
19 if( (strlen($val) == 0) ){
20 $err_reason =
"Bitte Wert für die Wert Option mit der ID {$this->ID} angeben.";
34 $this->
set_value(
"Option {$this->index}");
41 if( is_array($this->
config) ){
43 if( isset($this->
config[
"br"]) ){
44 return $this->
config[
"br"];
64 $this->
config[
"br"] = $val;
82 $this->data[
"br"] =
true;
84 $this->data[
"br"] =
false;
98 if( isset($this->data[
"br"]) ){
99 return $this->data[
"br"];
112 $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'/>
147 if( (isset($_POST[
"option_ID{$this->ID}_name"])) AND ($_POST[
"option_ID{$this->ID}_name"] !=
"") ){
148 $dispName = htmlspecialchars($_POST[
"option_ID{$this->ID}_name"] , ENT_QUOTES ,
"UTF-8",
true);
152 return "Name der Option mit ID {$this->ID} enthält mehr als 256 Zeichen!";
155 return "Name der Option mit ID {$this->ID} nicht angegeben!";
158 if( (isset($_POST[
"option_ID{$this->ID}_linebr"])) AND ($_POST[
"option_ID{$this->ID}_linebr"] ==
"br") ){
163 if( isset($_POST[
"option_ID{$this->ID}_max"]) ){
164 if( $_POST[
"option_ID{$this->ID}_max"] !=
"" ){
165 $this->
set_config(
"max" , intval($_POST[
"option_ID{$this->ID}_max"]) );
172 if( isset($_POST[
"option_ID{$this->ID}_value"]) ){
173 if( ($_POST[
"option_ID{$this->ID}_value"] !=
"") ){
174 return $this->
set_value( $_POST[
"option_ID{$this->ID}_value"] );
176 return $this->
set_value( $this->dispName);
179 return $this->
set_value( $this->dispName);
186 function display($sel=
false,$columns=
"columns"){
187 if( !(isset($this->
name)) OR !(isset($this->
value)) OR ($this->
value ==
"") OR ($this->
name ==
"") ){
188 throw new exception(
"name or value not set");
191 $s =
"checked='checked'";
196 if( ($this->
get_data(
"count") >= $max) AND ($max != -1) ){
197 $active_style =
"disabled_widget_text";
199 if( $sel ===
false ){
200 $active=
"disabled='disabled'";
204 }
else{$active_style = $active =
"";}
206 echo
"<td><input type='checkbox' value='{$this->value}' name='{$this->ID}' id='{$this->ID}' $s $active/> </td>".PHP_EOL;
207 echo
"<td><label class='widget_answer $active_style' style='margin-right:2em' for='{$this->ID}' >{$this->dispName}</label></td>".PHP_EOL;
210 if( $columns ==
"rows" ){
214 }
else if($columns ==
"columns"){